Switches - Reverse Flashcards

1
Q

type

returns all of the places that contain an executable named file

A

type -a

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

uname

show all information

A

uname -a

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

history

clear the history

A

history -c

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

man

search man pages for a topic; requires the whatis database to work

A

man -k

man -k ““system information””

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

man

select the section in the man page to open

A

man #

man 5 passwd

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

xargs

specify the delimiter

A

xargs -d

defaults to space

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

cat

display a “”$”” at the end of each line

A

cat -E

–show-ends

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

cat

adds line numbers to the beginning of every line.

A

cat -n

–number

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

cat

adds line numbers to the beginning of every line that contains text

A

cat -b

–number-nonblank

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

cat

compresses groups of blank lines down to a single blank line

A

cat -s

–squeeze-blank

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

cat

displays tab characters as ““∧I””

A

cat -T

–show-tabs

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

cat

displays most control and other special characters using carat ( ∧ ) and M- notations.

A

cat -v

–show-nonprinting

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

join

use CHAR as input and output field separator

A

join -t CHAR

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

join

ignore differences in case when comparing fields

A

join -i

–ignore-case

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

expand

have tabs NUMBER characters apart; not 8

A

expand -t NUMBER

–tabs=NUMBER

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

sort

ignore case

A

sort -f

–ignore-case; (fold)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

sort

sort by three-letter month abbreviation ( JAN through DEC )

A

sort -M

–month-sort

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

sort

compare according to string numerical value

A

sort -n

–numeric-sort

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

sort

reverse the result of comparisons

A

sort -r

–reverse

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

sort

sort via a key; KEYDEF gives location and type

A

sort -k KEYDEF
–key=KEYDEF
(KEYDEF can be two numbered fields separated by commas; to sort on multiple fields.)
E.G. sort -k 3 listing1.1.txt

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

split

put NUMBER bytes per output file

A

split -b NUMBER

–bytes=NUMBER

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

split

put at most NUMBER bytes of records per output file

A

split -C NUMBER

–line-bytes=NUMBER

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
Q

split

put NUMBER lines/records per output file

A

split -l NUMBER

–lines=NUMBER

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
24
Q

tr

first truncate SET1 to length of SET2

A

tr -t

–truncate-set1

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
tr | delete characters in SET1; do not translate
tr -d | --delete
26
unexpand | use comma separated LIST of tab positions (enables -a)
unexpand -t LIST | --tabs=LIST
27
fmt | maximum line width (default of 75 columns)
fmt -w NUMBER | --width=NUMBER
28
nl | use STYLE for numbering body lines
nl -b STYLE --body-numbering=STYLE STYLE is: t (The default behavior is to number lines that aren't empty. You can make this default explicit by using a style code of t .) a (This style code causes all lines to be numbered; including empty lines.) n (This style code causes all line numbers to be omitted; which may be desirable for headers or footers.) pREGEXP (This option causes only lines that match the specified regular expression ( REGEXP ) to be numbered.)
29
nl | use STYLE for numbering header lines
nl -h STYLE --header-numbering=STYLE STYLE is: t (The default behavior is to number lines that aren't empty. You can make this default explicit by using a style code of t .) a (This style code causes all lines to be numbered; including empty lines.) n (This style code causes all line numbers to be omitted; which may be desirable for headers or footers.) pREGEXP (This option causes only lines that match the specified regular expression ( REGEXP ) to be numbered.)
30
nl | use STYLE for numbering footer lines
nl -f STYLE --footer-numbering=STYLE STYLE is: t (The default behavior is to number lines that aren't empty. You can make this default explicit by using a style code of t .) a (This style code causes all lines to be numbered; including empty lines.) n (This style code causes all line numbers to be omitted; which may be desirable for headers or footers.) pREGEXP (This option causes only lines that match the specified regular expression ( REGEXP ) to be numbered.)
31
nl | use CC for logical page delimiters
nl -d CC | --section-delimiter=CC
32
nl | insert line numbers according to FORMAT
``` nl -n FORMAT --number-format=FORMAT format is: ln (left justified; no leading zeros); rn (right justified; no leading zeros); rz (right justified with leading zeros). ```
33
pr | output COLUMN columns and print columns down; unless -a is used
pr -NUMBER --columns=NUMBER default is 80
34
pr | double space the output
pr -d | --double-space
35
pr use form feeds instead of newlines to separate pages (by a 3-line page header with -F or a 5-line header and trailer without -F)
pr -f - -form-feed - F
36
pr set the page length to PAGE_LENGTH (66) lines (default number of lines of text 56; and with -F 63). implies -t if PAGE_LENGTH <= 10
pr -l NUMBER | --length=NUMBER
37
pr | use a centered STRING instead of filename in page header; -h """" prints a blank line; don't use -h""""
pr -h STRING | --header=STRING
38
pr | omit page headers and trailers; implied if PAGE_LENGTH <= 10
pr -t | --omit-header
39
pr | offset each line with MARGIN (zero) spaces; do not affect -w or -W; MARGIN will be added to PAGE_WIDTH
pr -o | --indent=NUMBER
40
pr | set page width to NUMBER (72) characters for multiple text-column output only; -s[char] turns off (72)
pr -w NUMBER | --width=NUMBER
41
head | print the first NUM bytes of each file; with the leading '-'; print all but the last NUM bytes of each file
head -c NUMBER | --bytes=[-]NUMBER
42
head | print the first NUM lines instead of the first 10; with the leading '-'; print all but the last NUM lines of each file
head -n NUMBER | --lines=[-]NUMBER
43
tail | output the last NUMBER bytes; or use -c +NUMBER to output starting with byte NUMBER of each file
tail -c NUMBER | --bytes=[+]NUMBER
44
tail | output the last NUM lines; instead of the last 10; or use -n +NUM to output starting with line NUM
tail -n NUMBER | --lines=[+]NUMBER
45
tail | output appended data as the file grows;
tail -f | --follow[={name|descriptor}]
46
tail | with -f; terminate after process ID; PID dies
tail --pid=NUMBER
47
cut | select only these bytes
cut -b LIST --bytes=LIST LIST can be a single number (such as 4 ); a closed range of numbers (such as 2-4 ); or an open range of numbers (such as -4 or 4- ).
48
cut | select only these characters
cut -c LIST --characters=LIST LIST can be a single number (such as 4 ); a closed range of numbers (such as 2-4 ); or an open range of numbers (such as -4 or 4- ).
49
cut | select only these fields; also print any line that contains no delimiter character; unless the -s option is specified
cut -f LIST --fields=LIST LIST can be a single number (such as 4 ); a closed range of numbers (such as 2-4 ); or an open range of numbers (such as -4 or 4- ).
50
cut | use DELIM instead of TAB for field delimiter
cut -d STRING | --delimiter=STRING
51
cut | do not print lines not containing delimiters
cut -s | --only-delimited
52
wc | print the newline counts
wc -l | --lines
53
wc | print the word counts
wc -w | --words
54
wc | print the byte counts
wc -c | --bytes
55
wc | print the character counts
wc -m | --chars
56
wc | print the maximum display width
wc -L | --max-line-length
57
grep Suppress normal output; instead print a count of matching lines for each input file. With the -v; --invert-match option (see below); count non-matching lines.
grep -c | --count
58
grep Obtain patterns from file STRING; one per line. If this option is used multiple times or is combined with the -e (--regexp) option; search for all patterns given. The empty file contains zero patterns; and therefore matches nothing.
grep -f STRING | --file=STRING
59
grep | Ignore case distinctions; so that characters that differ only in case match each other.
grep -i | --ignore-case
60
grep Read all files under each directory; recursively; following symbolic links only if they are on the command line. Note that if no file operand is given; grep searches the working directory. This is equivalent to the -d recurse option.
grep -r --recursive or use rgrep
61
grep Interpret PATTERN as a list of fixed strings (instead of regular expressions); separated by newlines; any of which is to be matched.
grep -F --fixed-strings or use fgrep
62
grep | Interpret PATTERN as an extended regular expression (ERE; see below).
grep -E --extended-regexp or use egrep
63
sed | Display the current line number
sed =
64
sed | Append text to the file.
sed a\text
65
sed | Insert text into the file
sed i\text
66
sed | Append text from filename into the file
sed r filename
67
sed | Replace the selected range of lines with the provided text
sed c\text
68
sed | Replace text that matches the regular expression ( regexp ) with replacement
sed s/regexp/replacement/[g]
69
sed | Write the current pattern space to the specified file.
sed w filename
70
sed | Immediately quit the script; but print the current pattern space.
sed q
71
sed | Immediately quit the script.
sed Q
72
rpm Modifies the Linux system having a root directory located at dir . This option can be used to maintain one Linux installation discrete from another one (say; during OS installation or emergency maintenance).
rpm --root STRING
73
rpm | Forces installation of a package even when it means overwriting existing files or packages.
rpm --force | used with: -i ; -U ; -F
74
rpm | Displays a series of hash marks ( # ) to indicate the progress of the operation.
rpm -h --hash used with: -i ; -U ; -F
75
rpm | Used in conjunction with the -h option to produce a uniform number of hash marks for each package.
rpm -v | used with: -i ; -U ; -F
76
rpm Specifies that no dependency checks be performed. Installs or removes the package even if it relies on a package or file that's not present or is required by a package that's not being uninstalled.
rpm --nodeps | used wih: -i ; -U ; -F ; -e
77
rpm | Checks for dependencies; conflicts; and other problems without actually installing the package.
rpm --test | used with: -i ; -U ; -F
78
rpm | Sets the installation directory to STRING (works only for some packages).
rpm --prefix STRING | used with: -i ; -U ; -F
79
rpm | Queries or verifies all packages.
rpm -a --all used with: -q ; -V
80
rpm | Queries or verifies the package that owns file
rpm -f STRING --file STRING used with: -q ; -V
81
rpm | Queries the uninstalled RPM STRING
rpm -p STRING | used with -q
82
rpm | Displays package information; including the package maintainer; a short description; and so on
rpm -i | used with -q
83
rpm | Displays the packages and files on which this one depends
rpm -R --requires used with -q
84
rpm | Displays the files contained in the package.
rpm -l --list used with -q
85
rpm | Installs a package; system must not contain a package of the same name
rpm -i
86
rpm | Installs a new package or upgrades an existing one
rpm -U
87
rpm | Upgrades a package only if an earlier version already exists
rpm -F | --freshen
88
rpm | Queries a package—finds whether a package is installed; what files it contains; and so on
rpm -q
89
rpm | Verifies a package—checks that its files are present and unchanged since installation
rpm -v | --verify
90
rpm | Uninstalls a package
rpm -e
91
rpm | Builds a binary package; given source code and configuration files; moved to the rpmbuild program with RPM version 4.2
rpm -b
92
rpm | Builds a binary package; given a source RPM file; moved to the rpmbuild program with RPM version 4.2
rpm --rebuild
93
rpm | Rebuilds the RPM database to fix errors
rpm --rebuilddb
94
cpio | extract an archive
cpio -i
95
cpio | create directories
cpio --make-directories
96
yum | Installs one or more packages by package name. Also installs dependencies of the specified package or packages.
yum install
97
yum Updates the specified package or packages to the latest available version. If no packages are specified; yum updates every installed package.
yum update
98
yum Checks to see whether updates are available. If they are; yum displays their names; versions; and repository area ( updates or extras ; for instance).
yum check-update
99
yum Works like update with the --obsoletes flag set; which handles obsolete packages in a way that's superior when performing a distribution version upgrade
yum upgrade
100
yum | Deletes a package from the system; similar to rpm -e ; but yum also removes depended-on packages
yum remove | or erase
101
yum | Displays information about a package; such as the installed version and whether an update is available
yum list
102
yum Displays information about packages that provide a specified program or feature. For instance; typing yum provides samba lists all the Samba-related packages; including every available update. Note that the output can be copious.
yum provides | or whatprovides
103
yum Searches package names; summaries; packagers; and descriptions for a specified keyword. This is useful if you don't know a package's name but can think of a word that's likely to appear in one of these fields but not in these fields for other packages
yum search
104
yum | Displays information about a package; similar to the rpm -qi command
yum info
105
yum Cleans up the Yum cache directory. Running this command from time to time is advisable; lest downloaded packages chew up too much disk space.
yum clean
106
yum | Enters the Yum shell mode; in which you can enter multiple Yum commands one after another
yum shell
107
yum | Displays packages matching the specified dependency.
yum resolvedep
108
yum | Installs the specified local RPM files; using your Yum repositories to resolve dependencies
yum localinstall
109
yum Updates the system using the specified local RPM files; using your Yum repositories to resolve dependencies. Packages other than those updated by local files and their dependencies are not updated
yum localupdate
110
yum | Displays dependencies of the specified package.
yum deplist
111
dpkg | Installs a package
dpkg -i | --install
112
dpkg | Reconfigures an installed package: runs the post-installation script to set site-specific options
dpkg --configure
113
dpkg | Removes a package but leaves configuration files intact
dpkg -r | --remove
114
dpkg | Removes a package; including configuration files
dpkg -P | --purge
115
dpkg | Displays currently installed packages
dpkg --get-selections
116
dpkg | Displays information about an installed package
dpkg -p | --print-avail
117
dpkg | Displays information about an uninstalled package file
dpkg -I | --info
118
dpkg | Lists all installed packages whose names match pattern
dpkg -l STRING | --list pattern
119
dpkg | Lists the installed files associated with a package
dpkg -L | --listfiles
120
dpkg | Locates the package(s) that own the file(s) specified by pattern
dpkg -S STRING | --search pattern
121
dpkg | pattern -C or --audit Searches for partially installed packages and suggests what to do with them
dpkg -c | --audit
122
dpkg Modifies the Linux system using a root directory located at STRING . Can be used to maintain one Linux installation discrete from another one; say during OS installation or emergency maintenance.
dpkg --root=STRING | used with: all
123
dpkg | Disables packages that rely on one that is being removed.
dpkg -B --auto-deconfigure used with -r
124
dpkg Overrides defaults that would ordinarily cause dpkg to abort. Consult the dpkg man page for details of what (specified by things ) this option does.
dpkg --force-things | used with: assorted
125
dpkg | ignores dependency information for the specified package
dpkg --ignore-depends=package | used with: -i; -r
126
dpkg | Checks for dependencies; conflicts; and other problems without actually installing or removing the package
dpkg --no-act | used with: -i; -r
127
dpkg | Installs all packages that match the package-name wildcard in the specified directory and all subdirectories
dpkg --recursive | used with: -i
128
dpkg | Doesn't install the package if a newer version of the same package is already installed.
dpkg -G | used with: -i
129
dpkg | Doesn't install the package if the same version of the package is already installed.
dpkg -E --skip-same-version used with: -i
130
apt-cache | displays information about the packages listed on the command line.
apt-cache showpkg | eg: apt-cache showpkg samba
131
apt-cache You can learn how many packages you've installed; how many dependencies are recorded; and various other statistics about the package database
apt-cache stats
132
apt-cache | Find Unmet Dependencies
apt-cache unmet
133
apt-cache | Display Dependencies
apt-cache depends
134
apt-cache | Locate All Packages
apt-cache pkgnames If you include a second parameter; as in apt-cache pkgnames sa ; the program returns only those packages that begin with the specified string.
135
apt-get | Downloads package files but doesn't install them.
apt-get -d --download-only used with: upgrade ; dselect- upgrade ; install ; source
136
apt-get | Attempts to fix a system on which dependencies are unsatisfied.
apt-get -f --fix-broken used with: install ; remove
137
apt-get | Ignores all package files that can't be retrieved (because of network errors; missing files; or the like)
apt-get -m --ignore-missing ; or --fix-missing used with: upgrade ; dselect- upgrade ; install ; remove ; source
138
apt-get Omits some progress indicator information. May be doubled (for instance; -qq ) to produce still less progress information
apt-get -q --quiet used with: all
139
apt-get | Performs a simulation of the action without actually modifying; installing; or removing files
apt-get -s --simulate ; --just- print ; --dry-run ; -- recon ; or --no-act used with: all
140
apt-get | Produces a ""yes'' response to any yes/no prompt in installation scripts.
apt-get -y --yes ; or --assume- yes used with: all
141
apt-get | Compiles a source package after retrieving it.
apt-get -b --compile; or --build used with: source
142
apt-get | auses apt-get to not upgrade a package if an older version is already installed.
apt-get --no-upgrade | used with: install
143
apt-get | Obtains updated information about packages available from the installation sources listed in /etc/apt/sources.list .
apt-get update
144
apt-get Upgrades all installed packages to the newest versions available; based on locally stored information about available packages.
apt-get upgrade
145
apt-get | Performs any changes in package status (installation; removal; and so on) left undone after running dselect .
apt-get dselect-upgrade
146
apt-get Similar to upgrade ; but performs ``smart'' conflict resolution to avoid upgrading a package if doing so would break a dependency.
apt-get dist-upgrade
147
apt-get Installs a package by package name (not by package filename); obtaining the package from the source that contains the most up-to-date version.
apt-get install
148
apt-get | Removes a specified package by package name
apt-get remove
149
apt-get Retrieves the newest available source package file by package filename using information about available packages and installation archives listed in /etc/apt/sources.list
apt-get source
150
apt-get | Checks the package database for consistency and broken package installations
apt-get check
151
apt-get Performs housekeeping to help clear out information about retrieved files from the Debian package database. If you don't use dselect for package management; run this from time to time in order to save disk space.
apt-get clean
152
apt-get | Similar to clean ; but removes information only about packages that can no longer be downloaded.
apt-get autoclean
153
aptitude | install package STRING
aptitude install STRING
154
aptitude | uninstall package STRING
aptitude install STRING- | also remove STRING
155
aptitude | uninstall package STRING
aptitude remove STRING | also install STRING-
156
aptitude less conservative about removing packages in the upgrade process; and so it is more likely to complete its tasks. However; it may break software in the process.
aptitude full-upgrade
157
aptitude | conservative about removing packages or installing new ones and so may fail
aptitude safe-upgrade
158
aptitude | earches the database for packages matching the specified name
aptitude search
159
aptitude | removes already-downloaded packages that are no longer available
aptitude autoclean
160
aptitude | removes all downloaded packages
aptitude clean
161
aptitude | displays a complete list of options.
aptitude help
162
alien | converts to debian
alien --to-deb
163
alien | converts to rpm
alien --to-rpm
164
alien | converts to tgz
alien --to-tgz
165
ldconfig | Display Verbose Information
ldconfig -v
166
ldconfig causes ldconfig not to perform its primary duty of updating the library cache. It will; though; update symbolic links to libraries; which is a secondary duty of this program.
ldconfig -N
167
ldconfig causes ldconfig to update the links contained in the directories specified on the command line. The system won't examine the directories specified in /etc/ld.so.conf or the trusted directories ( /lib and /usr/lib )
ldconfig -n
168
ldconfig | the opposite of -N ; it causes ldconfig to update the cache but not manage links.
ldconfig -X
169
ldconfig | change the configuration file from /etc/ld.so.conf to STRING
ldconfig -f STRING
170
ldconfig | change the cache file that ldconfig creates to STRING
ldconfig -C STRING
171
ldconfig tells ldconfig to treat dir as if it were the root ( / ) directory. This option is helpful when you're recovering a badly corrupted system or installing a new OS
ldconfig -r STRING
172
ldconfig | Causes ldconfig to display the current cache—all of the library directories and the libraries they contain
ldconfig -p
173
uname | display all information
uname -a
174
uname | displays the system's node name; that is; its network hostname.
uname -n | --nodename
175
uname | displays the kernel name; which is Linux on a Linux system
uname -s | --kernel-name
176
uname | find the kernel version
uname -v | --kernel-version
177
uname | The actual kernel version number
uname -r | --kernel-release
178
uname | returns information about your machine. This is likely to be a CPU code; such as i686 or x86_64 .
uname -m | --machine
179
uname may return information about your CPU; such as the manufacturer; model; and clock speed; in practice; it returns unknown on many systems
uname -p | --processor
180
uname | theoretically returns hardware platform information; this option often returns unknown
uname -i | --hardware-platform
181
uname | returns the OS name—normally GNU/Linux for a Linux system
uname -o | --operating-system
182
ps | Display Help
ps --help
183
ps | Display All Processes
ps -A | also -e
184
ps | Display All Processes
ps -e | also -A
185
ps Lift the BSD-style ""must have a tty"" restriction; displays all processes owned by the user who gives the command
ps x
186
ps | display processes owned by user STRING
ps -u STRING --User user also U STRING STRING may be a user name or uid
187
ps | display processes owned by user STRING
ps U STRING --User user also U STRING STRING may be a user name or uid
188
ps | Display Process Hierarchy
ps -H --forest also -f
189
ps | Display Process Hierarchy
ps -f --forest also -f
190
ps | don't truncate output at 80 columns
ps -w | also w
191
top | how often top updates
top -d NUMBER | defaults to 5 seconds
192
top | only display the listed processes
top -p NUMBER NUMBER is a pid up to 20 pids can be listed
193
top | display NUMBER updates then quit
top -n NUMBER
194
top specifies batch mode; in which top doesn't use the normal screen-update commands. You might use this to log CPU use of targeted programs to a file; for instance
top -b
195
top | display help
top h while running | also ?
196
top | kill a process
top k while running
197
top | quit
top q while running
198
top | change a process's priority
top r while running
199
top | changes the display's update rate
top s while running
200
top | sets the display to sort by CPU usage; which is the default
top P while running
201
top | change the display to sort by memory usage with this command
top M while running
202
nice | run the program with NUMBER niceness
nice -n NUMBER also -NUMBER --adjustment=NUMBER
203
nice | run the program with NUMBER niceness
nice -NUMBER also -n NUMBER --adjustment=NUMBER
204
renice | Specify the scheduling priority to be used for the process; process group; or user.
renice [-n] NUMBER | --priority NUMBER
205
renice | change niceness on the pid NUMBER
renice -p NUMBER
206
renice | change niceness on the gid NUMBER
renice -g NUMBER
207
renice | change niceness on the uid NUMBER
renice -u NUMBER | e.g. renice 7 16580 -u pdavison tbaker
208
kill | List signal names
kill -l
209
kill specify the signal to send common signals are 1(SIGHUP); 9(SIGKILL); 15(SIGTERM)
kill -s STRING
210
killall | Interactively ask for confirmation before killing
killall -i | --interactive
211
lspci | Increases verbosity of output.
lspci -v | This option may be doubled ( -vv ) or tripled ( -vvv ) to produce yet more output
212
lspci | Displays information in numeric codes rather than translating the codes to manufacturer and device names.
lspci -n
213
lspci | Displays both the manufacturer and device names and their associated numeric codes
lspci -nn
214
lspci | Displays the PCI configuration space for each device as a hexadecimal dump.
lspci -x This is an extremely advanced option. Tripling ( -xxx ) or quadrupling ( -xxxx ) this option displays information about more devices
215
lspci | hows IRQ numbers and other data as seen by devices rather than as seen by the kernel
lspci -b
216
lspci | Displays a tree view depicting the relationship between devices
lspci -t
217
lspci Displays only devices that match the listed specification. This can be used to trim the results of the output -s [[[[ domain ]:] bus ]:] [ slot ][.[ func ]]
lspci -s STRING
218
lspci | Shows data on the specified device.
lspci -d STRING | -d [ vendor ]: [ device ]
219
lspci | Uses the specified file to map vendor and device IDs to names. (The default is /usr/share/misc/pci.ids .)
lspci -i STRING
220
lspci Dumps data in a machine-readable form intended for use by scripts. A single -m uses a backward-compatible format; whereas doubling ( - mm ) uses a newer format
lspci -m
221
lspci | Displays PCI domain numbers. These numbers normally aren't displayed.
lspci -D
222
lspci Performs a scan in bus-mapping mode; which can reveal devices hidden behind a misconfigured PCI bridge. This is an advanced option that can be used only by root .
lspci -M
223
lspci | Displays version information.
lspci --version
224
modprobe | display extra information
modprobe -v | --verbose
225
modprobe | This option overrides the default configuration directory (/etc/modprobe.d)
modprobe -C STRING | --config
226
modprobe | This option does everything but actually insert or delete the modules
modprobe -n --dry-run useful when combined with -v
227
``` modprobe Reverses modprobe 's usual effect; it causes the program to remove the specified module and any on which it depends ```
modprobe -r | --remove
228
``` modprobe force the module loading even if the kernel version doesn't match what the module expects. This action is potentially dangerous ```
modprobe -f | --force
229
``` modprobe shows all of the modules on which the specified module depends ```
modprobe --show-depends
230
modprobe | displays a list of available options whose names match the wildcard you specify
modprobe -l STRING - -list eg. modprobe -l v* displays all modules whose names begin with v
231
rmmod | display some extra information about what it's doing
rmmod -v | --verbose
232
``` rmmod forces module removal even if the module is marked as being in use. Naturally; this is a very dangerous option; ```
rmmod -f | --force
233
``` rmmod wait for the module to become unused rather than return an error message if the module is in use. Once the module is no longer being used (say; after a bluetooth device is disconnected); rmmod unloads the module and returns ```
rmmod -w | --wait
234
lsusb | display more information
lsusb -v
235
lsusb | restricts output to the specified bus and device number.
lsusb -s STRING | -s [[ bus ]:][ devnum ]
236
lsusb | restrict output to a particular vendor and product
lsusb -d STRING | -d [ vendor ]: [ product ]
237
lsusb displays information about the device that's accessible via filename ; which should be a file in the /proc/bus/usb directory tree
lsusb -D STRING
238
lsusb | displays the device list as a tree so that you can see what devices are connected to specific controllers more easily
lsusb -t
239
lsusb | displays the version of the lsusb utility
lsusb -V | --version
240
fdisk | display the current partition table
fdisk -l
241
fdisk | delete a partition
fdisk d while running
242
fdisk | display help
fdisk m while running | also ?
243
fdisk | change the partition type code
fdisk t while running
244
fdisk | display common partition type codes
fdisk l while running
245
fdisk | set the bootable flag
fdisk a while running
246
fdisk | exit
fdisk q while running
247
fdisk | save changes and exit
fdisk w while running
248
gdisk | display existing partitions
gdisk print while running
249
mkfs | sets the reserved-space percentage to NUMBER
mkfs -m NUMBER
250
tune2fs | Adjust the number of mounts after which the filesystem will be checked by e2fsck
tune2fs -c NUMBER
251
tune2fs Adjust the maximal time between two filesystem checks. No suffix or d will interpret the number interval-between-checks as days; m as months; and w as weeks. A value of zero will disable the time-dependent checking.
tune2fs -i NUMBER
252
tune2fs | converts ext2 to ext3
tune2fs -j
253
tune2fs | sets the reserved-space blocks to NUMBER
tune2fs -r NUMBER
254
xfs_admin | enable version 2 log (journal) format
xfs_admin -j
255
xfs_admin | obtain the filesystem's label (name)
xfs_admin -l
256
xfs_admin | obtain the filesystem's uuid
xfs_admin -u
257
xfs_admin | set the filesystem's label (name)
xfs_admin -L STRING
258
xfs_admin | set the filesystem's uuid
xfs_admin -U STRING
259
debugfs | produces superblock information; similar to what dumpe2fs displays
debugfs show_super_stats while running | also stats
260
debugfs | display the inode data on a file or directory
debugfs stat STRING (while running) | STRING is the name of a file or directorhy
261
debugfs | undelete a file
debugfs undelete NUMBER STRING (while running) also undel NUMBER is the inode number and STRING is the name you want to give i
262
debugfs | obtain a list of deleted inodes
``` debugfs lsdel (while running) also list_deleted_inodes ```
263
debugfs | extract a file from the filesystem
debugfs write STRING1 STRING2 (while running) STRING1 is the name of a file in the filesystem that you're manipulating and STRING2 is a filename on your main Linux system.
264
debugfs | produces a summary of available commands
``` debugfs list_requests (while running) also lr; help; or ? ```
265
debugfs | exit the program
debugfs quit
266
fsck | check all of the filesystems marked to be checked in /etc/fstab .
fsck -A
267
fsck | displays a text-mode progress indicator of the check process
fsck -c
268
fsck | produces verbose output of the check process
fsck -v
269
fsck | display what it would normally do without actually doing it
fsck -N
270
fsck | causes the program to check only the specified filesystem types; even if others are marked to be checked
fsck -t STRING used with -A If STRING is prefixed with no ; then all filesystems except the specified type are checked
271
fsck | passes STRING to the underlying check program
fsck --STRING
272
df includes pseudo-filesystems with a size of 0 in the output. These filesystems may include /proc ; /sys ; /proc/bus/usb ; and others
df -a | --all
273
df | scale and label its units
df -h | --human-readable
274
df | scale and label its units using powers of 10
df -H | --si
275
df | scale and label its units using kilobytes
df -k | --kilobytes
276
df | scale and label its units using megabytes
df -m | --megabytes
277
df | report on available and used inodes
df -i | --inodes
278
df | omit network filesystems
df -l | --local
279
df | display filesystem type
df -T | --print
280
df | displays only information about filesystems of the specified type
df -t STRING | --type=STRING
281
df | don't display information about filesystems of the specified type
df -x STRING | --exclude=STRING
282
du | report on individual files as well.
du -a | --all
283
du | add a grand total to the end of its output
du -c | --total
284
du | scale and label its units;
du -h | --human-readable
285
du | scale and label its units using powers of 10
du -H | --si
286
du | scale and label its units using kilobytes
du -k | --kilobytes
287
du | scale and label its units using megabytes
du -m | --megabytes
288
du | count the space each hardlink takes (useful if you want to burn to optical storage)
du -l | --count-links
289
du | limits the report to NUMBER levels
du --max-depth=NUMBER
290
du | equivalent to --max=depth=0
du -s | --summarize
291
du limits the report to the current filesystem. If another filesystem is mounted within the tree that you want summarized; its contents aren't included in the report
du -x | --one-file-system
292
mount | mount all of the filesystems listed in the /etc/fstab
mount -a
293
mount | mount the filesystem read-only
mount -r
294
mount | produces verbose output
mount -v
295
mount | mount the filesystem for both read and write
mount -w | also: -o rw
296
mount | specify the filesystem type
mount -t STRING
297
mount | mount the filesystem whose label matches STRING
mount -L STRING
298
mount | mount the filesystem whose UUID matches STRING
mount -U STRING
299
mount Causes the default options for this filesystem to be used. It's used primarily in the /etc/fstab file to ensure that the file includes an options column
mount -o defaults | supported filesystems: all
300
mount Causes the loopback device for this mount to be used. Allows you to mount a file as if it were a disk partition. For instance; mount -t vfat -o loop image.img /mnt/image mounts the file image.img as if it were a disk
mount -o loop | supported filesystems: all
301
mount Mounts or doesn't mount the filesystem at boot time or when root issues the mount -a command. The default is auto ; but noauto is appropriate for removable media. Used in /etc/fstab
mount -o auto or noauto | supported filesystems: all
302
mount Allows or disallows ordinary users to mount the filesystem. The default is nouser ; but user is often appropriate for removable media. Used in /etc/fstab . When included in this file; user allows users to type mount /mountpoint (where / mountpoint is the assigned mount point) to mount a disk. Only the user who mounted the filesystem may unmount it.
mount -o user or nouser | supported filesystems: all
303
mount | Similar to user ; except that any user may unmount a filesystem once it's been mounted.
mount -o users | supported filesystems: all
304
mount Similar to user ; except that the user must own the device file. Some distributions; such as Red Hat; assign ownership of some device files (such as /dev/fd0 for the floppy disk) to the console user; so this can be a helpful option
mount -o owner | supported filesystems: all
305
mount Changes one or more mount options without explicitly unmounting a partition. To use this option; you issue a mount command on an already-mounted filesystem but with remount along with any options that you want to change. This feature can be used to enable or disable write access to a partition; for example
mount -o remount | supported filesystems: all
306
mount Specifies a read-only mount of the filesystem. This is the default for filesystems that include no write access and for some with particularly unreliable write support
mount -o ro | supported filesystems: all
307
mount | Specifies a read/write mount of the filesystem. This is the default for most read/write filesystems
mount -o rw | supported filesystems: All read/write filesystems
308
mount Sets the owner of all files. For instance; uid=1000 sets the owner to whomever has Linux user ID 1000. (Check Linux user IDs in the /etc/passwd file.)
mount -o uid=NUMBER | supported filesystmes: Most filesystems that don't support Unix-style permissions; such as vfat ; hpfs ; ntfs ; and hfs
309
mount | Works like uid= value ; but sets the group of all files on the filesystem. You can find group IDs in the /etc/group file
mount -o gid=value | supported filesystems: Most filesystems that don't support Unix-style permissions; such as vfat ; hpfs ; ntfs ; and hfs
310
mount Sets the umask for the permissions on files. value is interpreted in binary as bits to be removed from permissions on files. For instance; umask=027 yields permissions of 750; or –rwxr-x--- . Used in conjunction with uid= value and gid= value ; this option lets you control who can access files on FAT; HPFS; and many other foreign filesystems.
mount -o umask=value | supported filesystems: Most filesystems that don't support Unix-style permissions; such as vfat ; hpfs ; ntfs ; and hfs
311
mount | Similar to umask ; but sets the umask for directories only; not for files.
mount -o dmask=value | supported filesystems: Most filesystems that don't support Unix-style permissions; such as vfat ; hpfs ; ntfs ; and hfs
312
mount | Similar to umask ; but sets the umask for files only; not for directories.
mount -o fmask=value | supported filesystems: Most filesystems that don't support Unix-style permissions; such as vfat ; hpfs ; ntfs ; and hfs
313
mount If code is b or binary ; Linux doesn't modify the files' contents. If code is t or text ; Linux auto-converts files between Linux-style and Windows- or Macintosh-style end-of-line characters. If code is a or auto ; Linux applies the conversion unless the file is a known binary file format. It's usually best to leave this at its default value of binary because file conversions can cause serious problems for some applications and file types.
mount -o conv=code | supported filesystems: Most filesystems used on Microsoft and Apple OSs: msdos ; umsdos ; vfat ; hpfs ; and hfs
314
mount | Disables Rock Ridge extensions for ISO-9660 CD-ROMs.
mount -o norock | supported filesystems: iso9660
315
mount | Disables Joliet extensions for ISO-9660 CD-ROMs.
mount -o nojoliet | supported filesystems: iso9660
316
umount | attempt to unmount all of the partitions listed in /etc/mtab
umount -a
317
umount force an unmount operation that might otherwise fail. This feature is sometimes helpful when unmounting NFS mounts shared by servers that have become unreachable
umount -f
318
umount | if it can't unmount a filesystem; it should attempt to remount it in read-only mode
umount -r
319
umount | unmount only partitions of the specified type. You can list multiple filesystem types by separating them with commas.
umount -t STRING
320
``` ls append indicator (one of */=>@|) to entries ```
``` ls -F --classify / Directory * Executable | Named pipe = Socket @ Symbolic Link ```
321
ls | show hidden files (dot)
ls -a | --all
322
ls | long listing
ls -l
323
ls | colored listing
ls --color
324
ls | only list the directory's name; useful for globbing for directories
ls -d | --directory
325
ls | display directory contents recursively.
ls -R | --recursive
326
cp | overwrite any existing files without prompting
cp -f | --force
327
cp | prompt before overwriting
cp -i | --interactive
328
cp | preserves ownership and permissions; if possible
cp -p | --preserve
329
cp | copy recursively
cp -R --recursive Although -r also performs a recursive copy; its behavior with files other than ordinary files and directories is unspecified. Most cp implementations use -r as a synonym for -R ; but this behavior isn't guaranteed
330
cp similar to -R ; but it also preserves ownership and copies links as is. The -R option copies the files to which symbolic links point rather than the symbolic links themselves.
cp -a | --archive
331
cp | copy the file only if the original is newer than the target or if the target doesn't exist
cp -u | --update
332
touch | change the access time alone; not the modification time
touch -a | --time=atime
333
touch | change the modification time alone; not the access time
touch -m | --time=mtime
334
touch | don't create the file if it doesn't exist
touch -c | --no-create
335
touch | ets the time to the value specified by STRING
touch -t STRING | MMDDhhmm[[CC]YY][.ss]
336
tar | Changes to directory dir before performing operations
tar C - -directory eg. tar -xvzf bigfile.tar.gz -C /folder/subfolder/
337
tar | Uses the file called file on the computer called host as the archive file
tar f | --file [host:]file
338
tar | Performs an incremental backup or restore; using file as a list of previously archived files
tar g STRING | --listed- incremental file
339
tar | Creates or extracts a multi-volume archive
tar M | --multi- volume
340
tar | Preserves all protection information
tar p | --preserve- permissions
341
tar | Retains the leading / on filenames
tar P | --absolute- paths
342
tar | Lists all files read or extracted; when used with --list ; displays file sizes; ownership; and time stamps
tar v | --verbose
343
tar | Verifies the archive after writing it
tar W | --verify
344
tar | Compresses an archive with gzip
tar z | --gzip or -- ungzip
345
tar | Compresses an archive with bzip2
tar j --bzip2 some older versions used I or y
346
tar | Compresses an archive with xz
tar J | --xz
347
tar | Creates an archive
tar c | --create
348
tar | Appends tar files to an archive
tar A | --concatenate
349
tar | Appends non- tar files to an archive
tar r | --append
350
tar | Appends files that are newer than those in an archive
tar u | --update
351
tar | Compares an archive to files on disk
tar d | --diff or --compare
352
tar | Lists an archive's contents
tar t | --list
353
tar | Extracts files from an archive
tar x | --extract or --get
354
cpio | creates an archive and copies files into it
cpio -o | --create
355
cpio | extracts data from an existing archive.
cpio -i | --extract
356
cpio | combines the copy-out and copy-in modes; enabling you to copy a directory tree from one location to another.
cpio -p | --pass-through
357
cpio | Resets the access time after reading a file so that it doesn't appear to have been read.
cpio -a | --reset- access-time
358
cpio | Appends data to an existing archive.
cpio -A | --append
359
cpio | Uses the contents of filename as a list of files to be extracted in copy-in mode.
cpio -E STRING | --pattern-file=filename
360
cpio | Uses filename as the cpio archive file; if this parameter is omitted; cpio uses standard input or output.
cpio -F STRING | --file=filename
361
cpio Uses a specified format for the archive file. Common values for format include bin (the default; an old binary format); crc (a newer binary format with a checksum); and tar (the format used by tar ).
cpio -H STRING | --format=format
362
cpio Uses the filename specified by STRING instead of standard input. (Unlike -F ; this option does not redirect output data.)
cpio -I STRING
363
cpio In copy-in mode; extracts files relative to the current directory; even if filenames in the archive contain full directory paths.
cpio --no-absolute-filenames
364
cpio Uses the filename specified by STRING instead of standard output. (Unlike -F ; this option does not redirect input data.)
cpio -o STRING
365
cpio | Displays a table of contents for the input
cpio -t | --list
366
cpio | Replaces all files without first asking for verification.
cpio -u | --unconditional
367
cpio Displays filenames as they're added to or extracted from the archive. When used with -t ; displays additional listing information (similar to ls -l ).
cpio -v | --verbose
368
dd | use STRING as the input file
dd if=STRING | dd if=/dev/sda3 of=/dev/dvd
369
dd | use STRING as the output file
dd of=STRING | dd if=/dev/sda3 of=/dev/dvd
370
dd read the filesystem using a block size of NUMBER 1024 seems good
dd bs=NUMBER
371
dd | read count*bs bytes from the input file
dd count=NUMBER
372
ln | overwrite any existing files without prompting
ln -f | --force
373
ln | prompt before overwriting
ln -i | --interactive
374
ln | attempt to make a hard link to a directory
ln -d or -F or --directory usually fails
375
ln | make a symbolic link
ln -s | --symbolic
376
mkdir | causes the new directory to have the specified permission mode; expressed as an octal number.
mkdir -m STRING | --mode=mode
377
mkdir | create parent directories as needed
mkdir -p | --parents
378
rmdir | don't display an error message if the directory isn't empty
rmdir --ignore-fail-on-non-empty
379
rmdir | delete parent directories recursively
rmdir -p - -parents eg. rmdir -p one/two/three
380
chown
chown -R | --recursive
381
chmod | set permissions for the owner
chmod u
382
chmod | set permissions for the group
chmod g
383
chmod | set permissions for all others (world)
chmod o
384
chmod | set permissions for ugo
chmod a
385
chmod | add permissions
chmod +
386
chmod | remove permissions
chmod -
387
chmod | set permissions equal to
chmod =
388
chmod | read permission
chmod r
389
chmod | write permission
chmod w
390
chmod | execute permission
chmod x
391
chmod | execute permission only if it's already set
chmod X
392
chmod | SUID or SGID
chmod s
393
chmod | sticky bit
chmod t
394
chmod | existing owner's permissions
chmod u
395
chmod | existing other permissions
chmod o
396
umask display permissions that will not be removed from files/folder symbolically e.g. u=rwx;g=rx;o=rx
umask -S
397
newgrp | reinitializes the environment as if the user had just logged in
newgrp -l
398
chattr Linux won't update the access time stamp when you access a file. This can reduce disk input/output; which is particularly helpful for saving battery life on laptops.
chattr [+-]A
399
chattr | disables write access to the file except for appending data.
chattr [+-]a
400
chattr | causes the kernel to compress data written to the file automatically and uncompress it when it's read back.
chattr [+-]c
401
chattr cannot be modified: it cannot be deleted or renamed; no link can be created to this file and no data can be written to the file.
chattr [+-]i
402
chattr tells the kernel to journal all data written to the file. This improves recoverability of data written to the file after a system crash but can slow performance. This flag has no effect on ext2 filesystems.
chattr [+-]j
403
chattr | when the file is deleted; the kernel zeros its data blocks
chattr [+-]s
404
chattr disables this behavior: small data pieces at a file's end that don't fill a complete block are merged with similar pieces of data from other files
chattr [+-]t
405
quotacheck | create aquota.user and aquota.group files
quotacheck -c
406
quotacheck | check user quotas
quotacheck -u
407
quotacheck | check group quotas
quotacheck -g
408
edquota sets the soft limit grace period 0 disables it grace periods are per filesystem, not per user
edquota -t
409
edquota | edit the quota for the group STRING
edquota -g STRING
410
quota | display group quotas
quota -g
411
quota | omits NFS mounts
quota -l
412
quota | limits output to filesystems on which usage is over the limit
quota -q
413
find | find files that have the specified permissions
find -perm NUMBER also symbolically e.g. -perm g=w
414
find | find files that have any of the specified permission bits set
find -perm +NUMBER
415
find | locate files that use NUMBER units of space; rounding up
``` find -size NUMBER NUMBER is specified in 512k blocks trail with c for bytes trail with k for kibibytes trail with M for Mebibytes ```
416
find | locate files larger than NUMBER units of space; rounding up
find -size +NUMBER
417
find | locate files less than NUMBER units of space; rounding up
find -size -NUMBER
418
find | locates files whose gid matches GID
find -gid NUMBER
419
find | locate files whose group matches STRING
find -group STRING
420
find | locates files whose uid matches UID
find -uid NUMBER
421
find | locate files whose owner matches STRING
find -user STRING
422
find | only recuse NUMBER directories
find -maxdepth NUMBER
423
which | show all matches
which -a
424
type | shortens the output to builtin ; file ; alias ; or other short identifiers.
type -t
425
type provides a complete list; for instance; it provides both the alias expansion and the location of the ultimate executable when provided with an alias name.
type -a
426
chkconfig | list the services and their applicable runlevels
chkconfig --list
427
chkconfig | set the STRING1 program to on or off (STRING2) on the runlevels specified in NUMBER with no delimiters
chkconfig --level NUMBER STRING1 STRING2 | chkconfig --level 23 nfs-common on
428
chkconfig adds the STRING script to those managed by chkconfig This approach may not work if the script lacks the necessary comment lines with runlevel sequence numbers for chkconfig 's benefit
chkconfig --add STRING
429
shutdown | shutdown now
shutdown now
430
shutdown | cancel a pending shutdown
shutdown -c
431
shutdown | reboot
shutdown -r
432
shutdown | halt
shutdown -H
433
shutdown | power off
shutdown -P
434
shutdown | usually powers off; may halt
shutdown -h
435
systemctl | Displays the current status of all configured units.
systemctl list-units
436
systemctl | Changes to the default target uni
systemctl default
437
systemctl | Starts the named unit and stops all others.
systemctl isolate systemctl isolate rescue.target go into single user mode
438
systemctl | Starts the named unit.
systemctl start STRING
439
systemctl | Stops the named unit.
systemctl stop STRING
440
systemctl | Causes the named unit to reload its configuration file.
systemctl reload STRING
441
systemctl | Causes the named unit to shut down and restart.
systemctl restart STRING
442
systemctl | Displays the status of the named unit. (You can pass a PID value; rather than a name; if you like.)
systemctl status STRING
443
systemctl | Configures the unit to start when the computer next boots.
systemctl enable STRING
444
systemctl | Configures the unit not to start when the computer next boots.
systemctl disable STRING
445
vi commands while running | opens a new line immediately below the current line; moves the cursor to that line; and enters insert mode
vi commands while running o
446
vi commands while running | copy # lines
vi commands while running #yy
447
vi commands while running | cut # lines
vi commands while running #dd
448
vi commands while running | copy from cursor to end of word
vi commands while running yw
449
vi commands while running | cut from cursor to end of word
vi commands while running dw
450
vi commands while running | paste
vi commands while running p
451
vi commands while running | enter text replacement mode
vi commands while running R
452
vi commands while running | enter insert mode and advance the cursor 1 space
vi commands while running a
453
vi commands while running | :wq
vi commands while running ZZ
454
vi commands while running | change case under cursor and advance 1
vi commands while running ~
455
vi commands while running | undo
vi commands while running u
456
vi commands while running | inserts a new line immediately below the current one and enters insert mode on that line
vi commands while running o
457
vi commands while running | search forward for text
vi commands while running /
458
vi commands while running | search backward for text
vi commands while running ?
459
vi commands while running | clear from cursor to the end of the word and enter insert mode
vi commands while running cw
460
vi commands while running | clear line and enter insert mode
vi commands while running cc
461
vi commands while running | go to line #
vi commands while running #G
462
vi commands while running | move cursor to top of screen
vi commands while running H
463
vi commands while running | move cursor to bottom of screen
vi commands while running L
464
vi commands while running | replace STRING1 with STRING2 globally
vi commands while running :%s/STRING1/STRING2/g remove g to do the first occurance on each line to do only lines 3 through 5; replace % with 3,5
465
vi commands while running | load file STRING for editing
vi commands while running :e STRING | closes the currently open file
466
vi commands while running | load file STRING on the line after the cursor
vi commands while running :r STRING
467
vi commands while running | run external command STRING
vi commands while running :!STRING | :!ls runs ls ; enabling you to see what files are present in the current directory