mirror of https://github.com/cheat/cheat.git
Made trivial changes to some of the cheatsheets to make them play more nicely with colorized output.
This commit is contained in:
parent
b2159662f3
commit
bbbe9193e0
|
@ -1,17 +1,17 @@
|
||||||
To view the php version:
|
# To view the php version:
|
||||||
php -v
|
php -v
|
||||||
|
|
||||||
To view the installed php modules:
|
# To view the installed php modules:
|
||||||
php -m
|
php -m
|
||||||
|
|
||||||
To enter an interactive shell:
|
# To enter an interactive shell:
|
||||||
php -a
|
php -a
|
||||||
|
|
||||||
To view phpinfo() information:
|
# To view phpinfo() information:
|
||||||
php -i
|
php -i
|
||||||
|
|
||||||
To locate the system's php.ini files:
|
# To locate the system's php.ini files:
|
||||||
php -i | grep "php.ini"
|
php -i | grep "php.ini"
|
||||||
|
|
||||||
To start a local webserver for the cwd on port 3000 (requires php >= 5.4):
|
# To start a local webserver for the cwd on port 3000 (requires php >= 5.4):
|
||||||
php -S localhost:3000
|
php -S localhost:3000
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
To replace all occurrences of "day" with "night" and write to stdout:
|
# To replace all occurrences of "day" with "night" and write to stdout:
|
||||||
sed 's/day/night/g' file.txt
|
sed 's/day/night/g' file.txt
|
||||||
|
|
||||||
To replace all occurrences of "day" with "night" within file.txt:
|
# To replace all occurrences of "day" with "night" within file.txt:
|
||||||
sed -i 's/day/night/g' file.txt
|
sed -i 's/day/night/g' file.txt
|
||||||
|
|
||||||
To replace all occurrences of "day" with "night" on stdin:
|
# To replace all occurrences of "day" with "night" on stdin:
|
||||||
echo 'It is daytime' | sed 's/day/night/g'
|
echo 'It is daytime' | sed 's/day/night/g'
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
To clear the contents from a file:
|
# To clear the contents from a file:
|
||||||
truncate -s 0 file.txt
|
truncate -s 0 file.txt
|
||||||
|
|
||||||
To truncate a file to 100 bytes:
|
# To truncate a file to 100 bytes:
|
||||||
truncate -s 100 file.txt
|
truncate -s 100 file.txt
|
||||||
|
|
||||||
To truncate a file to 100 KB:
|
# To truncate a file to 100 KB:
|
||||||
truncate -s 100K file.txt
|
truncate -s 100K file.txt
|
||||||
|
|
||||||
(M, G, T, P, E, Z, and Y may be used in place of "K" as required.)
|
# (M, G, T, P, E, Z, and Y may be used in place of "K" as required.)
|
||||||
|
|
|
@ -1,29 +1,28 @@
|
||||||
To install the latest version of a package:
|
# To install the latest version of a package:
|
||||||
yum install <package name>
|
yum install <package name>
|
||||||
|
|
||||||
To perform a local install:
|
# To perform a local install:
|
||||||
yum localinstall <package name>
|
yum localinstall <package name>
|
||||||
|
|
||||||
To remove a package:
|
# To remove a package:
|
||||||
yum remove <package name>
|
yum remove <package name>
|
||||||
|
|
||||||
To search for a package:
|
# To search for a package:
|
||||||
yum search <package name>
|
yum search <package name>
|
||||||
|
|
||||||
To find what package installs a program:
|
# To find what package installs a program:
|
||||||
yum whatprovides </path/to/program>
|
yum whatprovides </path/to/program>
|
||||||
|
|
||||||
To find the dependencies of a package:
|
# To find the dependencies of a package:
|
||||||
yum deplist <package name>
|
yum deplist <package name>
|
||||||
|
|
||||||
To find information about a package:
|
# To find information about a package:
|
||||||
yum info <package name>
|
yum info <package name>
|
||||||
|
|
||||||
List currently enabled repositories:
|
# List currently enabled repositories:
|
||||||
yum repolist
|
yum repolist
|
||||||
|
|
||||||
To download the source RPM for a package:
|
# To download the source RPM for a package:
|
||||||
yumdownloader --source <package name>
|
yumdownloader --source <package name>
|
||||||
|
|
||||||
(You have to install yumdownloader first, which is installed by the
|
# (You have to install yumdownloader first, which is installed by the yum-utils package)
|
||||||
yum-utils package)
|
|
||||||
|
|
Loading…
Reference in New Issue