Switches Flashcards

1
Q

type -a

A

returns all of the places that contain an executable named file

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

uname -a

A

show all information

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

history -c

A

clear the history

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

man -k

A

search man pages for a topic; requires the whatis database to work
man -k ““system information””

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

man #

A

select the section in the man page to open

man 5 passwd

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

xargs -d

A

specify the delimiter

defaults to space

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

cat -E

A

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

–show-ends

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

cat -n

A

adds line numbers to the beginning of every line.

–number

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

cat -b

A

adds line numbers to the beginning of every line that contains text
–number-nonblank

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

cat -s

A

compresses groups of blank lines down to a single blank line

–squeeze-blank

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

cat -T

A

displays tab characters as ““∧I””

–show-tabs

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

cat -v

A

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

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

join -t CHAR

A

use CHAR as input and output field separator

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

join -i

A

ignore differences in case when comparing fields

–ignore-case

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

expand -t NUMBER

A

have tabs NUMBER characters apart; not 8

–tabs=NUMBER

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

sort -f

A

ignore case

–ignore-case; (fold)

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

sort -M

A

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

–month-sort

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

sort -n

A

compare according to string numerical value

–numeric-sort

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

sort -r

A

reverse the result of comparisons

–reverse

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

sort -k KEYDEF

A

sort via a key; KEYDEF gives location and type
–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 -b NUMBER

A

put NUMBER bytes per output file

–bytes=NUMBER

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

split -C NUMBER

A

put at most NUMBER bytes of records per output file

–line-bytes=NUMBER

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

split -l NUMBER

A

put NUMBER lines/records per output file

–lines=NUMBER

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

tr -t

A

first truncate SET1 to length of SET2

–truncate-set1

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