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
Q

tr

delete characters in SET1; do not translate

A

tr -d

–delete

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

unexpand

use comma separated LIST of tab positions (enables -a)

A

unexpand -t LIST

–tabs=LIST

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

fmt

maximum line width (default of 75 columns)

A

fmt -w NUMBER

–width=NUMBER

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

nl

use STYLE for numbering body lines

A

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.)

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

nl

use STYLE for numbering header lines

A

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.)

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

nl

use STYLE for numbering footer lines

A

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.)

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

nl

use CC for logical page delimiters

A

nl -d CC

–section-delimiter=CC

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

nl

insert line numbers according to FORMAT

A
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).
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
33
Q

pr

output COLUMN columns and print columns down; unless -a is used

A

pr -NUMBER
–columns=NUMBER
default is 80

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

pr

double space the output

A

pr -d

–double-space

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

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)

A

pr -f

  • -form-feed
  • F
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
36
Q

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

A

pr -l NUMBER

–length=NUMBER

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

pr

use a centered STRING instead of filename in page header; -h “””” prints a blank line; don’t use -h””””

A

pr -h STRING

–header=STRING

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

pr

omit page headers and trailers; implied if PAGE_LENGTH <= 10

A

pr -t

–omit-header

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

pr

offset each line with MARGIN (zero) spaces; do not affect -w or -W; MARGIN will be added to PAGE_WIDTH

A

pr -o

–indent=NUMBER

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

pr

set page width to NUMBER (72) characters for multiple text-column output only; -s[char] turns off (72)

A

pr -w NUMBER

–width=NUMBER

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

head

print the first NUM bytes of each file; with the leading ‘-‘; print all but the last NUM bytes of each file

A

head -c NUMBER

–bytes=[-]NUMBER

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

head

print the first NUM lines instead of the first 10; with the leading ‘-‘; print all but the last NUM lines of each file

A

head -n NUMBER

–lines=[-]NUMBER

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

tail

output the last NUMBER bytes; or use -c +NUMBER to output starting with byte NUMBER of each file

A

tail -c NUMBER

–bytes=[+]NUMBER

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

tail

output the last NUM lines; instead of the last 10; or use -n +NUM to output starting with line NUM

A

tail -n NUMBER

–lines=[+]NUMBER

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

tail

output appended data as the file grows;

A

tail -f

–follow[={name|descriptor}]

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

tail

with -f; terminate after process ID; PID dies

A

tail –pid=NUMBER

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

cut

select only these bytes

A

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- ).

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

cut

select only these characters

A

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- ).

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

cut

select only these fields; also print any line that contains no delimiter character; unless the -s option is specified

A

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- ).

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

cut

use DELIM instead of TAB for field delimiter

A

cut -d STRING

–delimiter=STRING

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

cut

do not print lines not containing delimiters

A

cut -s

–only-delimited

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

wc

print the newline counts

A

wc -l

–lines

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

wc

print the word counts

A

wc -w

–words

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

wc

print the byte counts

A

wc -c

–bytes

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

wc

print the character counts

A

wc -m

–chars

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

wc

print the maximum display width

A

wc -L

–max-line-length

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

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.

A

grep -c

–count

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

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.

A

grep -f STRING

–file=STRING

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

grep

Ignore case distinctions; so that characters that differ only in case match each other.

A

grep -i

–ignore-case

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

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.

A

grep -r
–recursive
or use rgrep

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

grep
Interpret PATTERN as a list of fixed strings (instead of regular expressions); separated by newlines; any of which is to be matched.

A

grep -F
–fixed-strings
or use fgrep

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

grep

Interpret PATTERN as an extended regular expression (ERE; see below).

A

grep -E
–extended-regexp
or use egrep

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

sed

Display the current line number

A

sed =

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

sed

Append text to the file.

A

sed a\text

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

sed

Insert text into the file

A

sed i\text

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

sed

Append text from filename into the file

A

sed r filename

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

sed

Replace the selected range of lines with the provided text

A

sed c\text

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

sed

Replace text that matches the regular expression ( regexp ) with replacement

A

sed s/regexp/replacement/[g]

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

sed

Write the current pattern space to the specified file.

A

sed w filename

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

sed

Immediately quit the script; but print the current pattern space.

A

sed q

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

sed

Immediately quit the script.

A

sed Q

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

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).

A

rpm –root STRING

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

rpm

Forces installation of a package even when it means overwriting existing files or packages.

A

rpm –force

used with: -i ; -U ; -F

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

rpm

Displays a series of hash marks ( # ) to indicate the progress of the operation.

A

rpm -h
–hash
used with: -i ; -U ; -F

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

rpm

Used in conjunction with the -h option to produce a uniform number of hash marks for each package.

A

rpm -v

used with: -i ; -U ; -F

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

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.

A

rpm –nodeps

used wih: -i ; -U ; -F ; -e

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

rpm

Checks for dependencies; conflicts; and other problems without actually installing the package.

A

rpm –test

used with: -i ; -U ; -F

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

rpm

Sets the installation directory to STRING (works only for some packages).

A

rpm –prefix STRING

used with: -i ; -U ; -F

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

rpm

Queries or verifies all packages.

A

rpm -a
–all
used with: -q ; -V

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

rpm

Queries or verifies the package that owns file

A

rpm -f STRING
–file STRING
used with: -q ; -V

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

rpm

Queries the uninstalled RPM STRING

A

rpm -p STRING

used with -q

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

rpm

Displays package information; including the package maintainer; a short description; and so on

A

rpm -i

used with -q

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

rpm

Displays the packages and files on which this one depends

A

rpm -R
–requires
used with -q

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

rpm

Displays the files contained in the package.

A

rpm -l
–list
used with -q

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

rpm

Installs a package; system must not contain a package of the same name

A

rpm -i

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

rpm

Installs a new package or upgrades an existing one

A

rpm -U

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

rpm

Upgrades a package only if an earlier version already exists

A

rpm -F

–freshen

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

rpm

Queries a package—finds whether a package is installed; what files it contains; and so on

A

rpm -q

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

rpm

Verifies a package—checks that its files are present and unchanged since installation

A

rpm -v

–verify

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

rpm

Uninstalls a package

A

rpm -e

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

rpm

Builds a binary package; given source code and configuration files; moved to the rpmbuild program with RPM version 4.2

A

rpm -b

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

rpm

Builds a binary package; given a source RPM file; moved to the rpmbuild program with RPM version 4.2

A

rpm –rebuild

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

rpm

Rebuilds the RPM database to fix errors

A

rpm –rebuilddb

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

cpio

extract an archive

A

cpio -i

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

cpio

create directories

A

cpio –make-directories

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

yum

Installs one or more packages by package name. Also installs dependencies of the specified package or packages.

A

yum install

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

yum
Updates the specified package or packages to the latest available version. If no packages are specified; yum updates every installed package.

A

yum update

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

yum
Checks to see whether updates are available. If they are; yum displays their names; versions; and repository area ( updates or extras ; for instance).

A

yum check-update

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

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

A

yum upgrade

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

yum

Deletes a package from the system; similar to rpm -e ; but yum also removes depended-on packages

A

yum remove

or erase

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

yum

Displays information about a package; such as the installed version and whether an update is available

A

yum list

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

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.

A

yum provides

or whatprovides

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

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

A

yum search

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

yum

Displays information about a package; similar to the rpm -qi command

A

yum info

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

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.

A

yum clean

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

yum

Enters the Yum shell mode; in which you can enter multiple Yum commands one after another

A

yum shell

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

yum

Displays packages matching the specified dependency.

A

yum resolvedep

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

yum

Installs the specified local RPM files; using your Yum repositories to resolve dependencies

A

yum localinstall

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

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

A

yum localupdate

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

yum

Displays dependencies of the specified package.

A

yum deplist

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

dpkg

Installs a package

A

dpkg -i

–install

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

dpkg

Reconfigures an installed package: runs the post-installation script to set site-specific options

A

dpkg –configure

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

dpkg

Removes a package but leaves configuration files intact

A

dpkg -r

–remove

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

dpkg

Removes a package; including configuration files

A

dpkg -P

–purge

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

dpkg

Displays currently installed packages

A

dpkg –get-selections

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

dpkg

Displays information about an installed package

A

dpkg -p

–print-avail

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

dpkg

Displays information about an uninstalled package file

A

dpkg -I

–info

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

dpkg

Lists all installed packages whose names match pattern

A

dpkg -l STRING

–list pattern

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

dpkg

Lists the installed files associated with a package

A

dpkg -L

–listfiles

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

dpkg

Locates the package(s) that own the file(s) specified by pattern

A

dpkg -S STRING

–search pattern

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

dpkg

pattern -C or –audit Searches for partially installed packages and suggests what to do with them

A

dpkg -c

–audit

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

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.

A

dpkg –root=STRING

used with: all

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

dpkg

Disables packages that rely on one that is being removed.

A

dpkg -B
–auto-deconfigure
used with -r

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

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.

A

dpkg –force-things

used with: assorted

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

dpkg

ignores dependency information for the specified package

A

dpkg –ignore-depends=package

used with: -i; -r

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

dpkg

Checks for dependencies; conflicts; and other problems without actually installing or removing the package

A

dpkg –no-act

used with: -i; -r

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

dpkg

Installs all packages that match the package-name wildcard in the specified directory and all subdirectories

A

dpkg –recursive

used with: -i

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

dpkg

Doesn’t install the package if a newer version of the same package is already installed.

A

dpkg -G

used with: -i

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

dpkg

Doesn’t install the package if the same version of the package is already installed.

A

dpkg -E
–skip-same-version
used with: -i

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

apt-cache

displays information about the packages listed on the command line.

A

apt-cache showpkg

eg: apt-cache showpkg samba

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

apt-cache
You can learn how many packages you’ve installed; how many dependencies are recorded; and various other statistics about the package database

A

apt-cache stats

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

apt-cache

Find Unmet Dependencies

A

apt-cache unmet

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

apt-cache

Display Dependencies

A

apt-cache depends

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

apt-cache

Locate All Packages

A

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.

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

apt-get

Downloads package files but doesn’t install them.

A

apt-get -d
–download-only
used with: upgrade ; dselect- upgrade ; install ; source

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

apt-get

Attempts to fix a system on which dependencies are unsatisfied.

A

apt-get -f
–fix-broken
used with: install ; remove

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

apt-get

Ignores all package files that can’t be retrieved (because of network errors; missing files; or the like)

A

apt-get -m
–ignore-missing ; or –fix-missing
used with: upgrade ; dselect- upgrade ; install ; remove ; source

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

apt-get
Omits some progress indicator information. May be doubled (for instance; -qq ) to produce still less progress information

A

apt-get -q
–quiet
used with: all

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

apt-get

Performs a simulation of the action without actually modifying; installing; or removing files

A

apt-get -s
–simulate ; –just- print ; –dry-run ; – recon ; or –no-act
used with: all

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

apt-get

Produces a ““yes’’ response to any yes/no prompt in installation scripts.

A

apt-get -y
–yes ; or –assume- yes
used with: all

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

apt-get

Compiles a source package after retrieving it.

A

apt-get -b
–compile; or –build
used with: source

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

apt-get

auses apt-get to not upgrade a package if an older version is already installed.

A

apt-get –no-upgrade

used with: install

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

apt-get

Obtains updated information about packages available from the installation sources listed in /etc/apt/sources.list .

A

apt-get update

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

apt-get
Upgrades all installed packages to the newest versions available; based on locally stored information about available packages.

A

apt-get upgrade

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

apt-get

Performs any changes in package status (installation; removal; and so on) left undone after running dselect .

A

apt-get dselect-upgrade

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

apt-get
Similar to upgrade ; but performs ``smart’’ conflict resolution to avoid upgrading a package if doing so would break a dependency.

A

apt-get dist-upgrade

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

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.

A

apt-get install

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

apt-get

Removes a specified package by package name

A

apt-get remove

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

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

A

apt-get source

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

apt-get

Checks the package database for consistency and broken package installations

A

apt-get check

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

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.

A

apt-get clean

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

apt-get

Similar to clean ; but removes information only about packages that can no longer be downloaded.

A

apt-get autoclean

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

aptitude

install package STRING

A

aptitude install STRING

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

aptitude

uninstall package STRING

A

aptitude install STRING-

also remove STRING

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

aptitude

uninstall package STRING

A

aptitude remove STRING

also install STRING-

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

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.

A

aptitude full-upgrade

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

aptitude

conservative about removing packages or installing new ones and so may fail

A

aptitude safe-upgrade

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

aptitude

earches the database for packages matching the specified name

A

aptitude search

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

aptitude

removes already-downloaded packages that are no longer available

A

aptitude autoclean

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

aptitude

removes all downloaded packages

A

aptitude clean

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

aptitude

displays a complete list of options.

A

aptitude help

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

alien

converts to debian

A

alien –to-deb

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

alien

converts to rpm

A

alien –to-rpm

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

alien

converts to tgz

A

alien –to-tgz

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

ldconfig

Display Verbose Information

A

ldconfig -v

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

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.

A

ldconfig -N

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

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 )

A

ldconfig -n

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

ldconfig

the opposite of -N ; it causes ldconfig to update the cache but not manage links.

A

ldconfig -X

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

ldconfig

change the configuration file from /etc/ld.so.conf to STRING

A

ldconfig -f STRING

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

ldconfig

change the cache file that ldconfig creates to STRING

A

ldconfig -C STRING

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

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

A

ldconfig -r STRING

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

ldconfig

Causes ldconfig to display the current cache—all of the library directories and the libraries they contain

A

ldconfig -p

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

uname

display all information

A

uname -a

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

uname

displays the system’s node name; that is; its network hostname.

A

uname -n

–nodename

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

uname

displays the kernel name; which is Linux on a Linux system

A

uname -s

–kernel-name

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

uname

find the kernel version

A

uname -v

–kernel-version

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

uname

The actual kernel version number

A

uname -r

–kernel-release

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

uname

returns information about your machine. This is likely to be a CPU code; such as i686 or x86_64 .

A

uname -m

–machine

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

uname
may return information about your CPU; such as the manufacturer; model; and clock speed; in practice; it returns unknown on many systems

A

uname -p

–processor

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

uname

theoretically returns hardware platform information; this option often returns unknown

A

uname -i

–hardware-platform

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

uname

returns the OS name—normally GNU/Linux for a Linux system

A

uname -o

–operating-system

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

ps

Display Help

A

ps –help

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

ps

Display All Processes

A

ps -A

also -e

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

ps

Display All Processes

A

ps -e

also -A

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

ps
Lift the BSD-style ““must have a tty”” restriction;
displays all processes owned by the user who gives the command

A

ps x

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

ps

display processes owned by user STRING

A

ps -u STRING
–User user
also U STRING
STRING may be a user name or uid

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

ps

display processes owned by user STRING

A

ps U STRING
–User user
also U STRING
STRING may be a user name or uid

188
Q

ps

Display Process Hierarchy

A

ps -H
–forest
also -f

189
Q

ps

Display Process Hierarchy

A

ps -f
–forest
also -f

190
Q

ps

don’t truncate output at 80 columns

A

ps -w

also w

191
Q

top

how often top updates

A

top -d NUMBER

defaults to 5 seconds

192
Q

top

only display the listed processes

A

top -p NUMBER
NUMBER is a pid
up to 20 pids can be listed

193
Q

top

display NUMBER updates then quit

A

top -n NUMBER

194
Q

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

A

top -b

195
Q

top

display help

A

top h while running

also ?

196
Q

top

kill a process

A

top k while running

197
Q

top

quit

A

top q while running

198
Q

top

change a process’s priority

A

top r while running

199
Q

top

changes the display’s update rate

A

top s while running

200
Q

top

sets the display to sort by CPU usage; which is the default

A

top P while running

201
Q

top

change the display to sort by memory usage with this command

A

top M while running

202
Q

nice

run the program with NUMBER niceness

A

nice -n NUMBER
also -NUMBER
–adjustment=NUMBER

203
Q

nice

run the program with NUMBER niceness

A

nice -NUMBER
also -n NUMBER
–adjustment=NUMBER

204
Q

renice

Specify the scheduling priority to be used for the process; process group; or user.

A

renice [-n] NUMBER

–priority NUMBER

205
Q

renice

change niceness on the pid NUMBER

A

renice -p NUMBER

206
Q

renice

change niceness on the gid NUMBER

A

renice -g NUMBER

207
Q

renice

change niceness on the uid NUMBER

A

renice -u NUMBER

e.g. renice 7 16580 -u pdavison tbaker

208
Q

kill

List signal names

A

kill -l

209
Q

kill
specify the signal to send
common signals are 1(SIGHUP); 9(SIGKILL); 15(SIGTERM)

A

kill -s STRING

210
Q

killall

Interactively ask for confirmation before killing

A

killall -i

–interactive

211
Q

lspci

Increases verbosity of output.

A

lspci -v

This option may be doubled ( -vv ) or tripled ( -vvv ) to produce yet more output

212
Q

lspci

Displays information in numeric codes rather than translating the codes to manufacturer and device names.

A

lspci -n

213
Q

lspci

Displays both the manufacturer and device names and their associated numeric codes

A

lspci -nn

214
Q

lspci

Displays the PCI configuration space for each device as a hexadecimal dump.

A

lspci -x
This is an extremely advanced option. Tripling ( -xxx ) or quadrupling ( -xxxx ) this option displays information about more devices

215
Q

lspci

hows IRQ numbers and other data as seen by devices rather than as seen by the kernel

A

lspci -b

216
Q

lspci

Displays a tree view depicting the relationship between devices

A

lspci -t

217
Q

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 ]]

A

lspci -s STRING

218
Q

lspci

Shows data on the specified device.

A

lspci -d STRING

-d [ vendor ]: [ device ]

219
Q

lspci

Uses the specified file to map vendor and device IDs to names. (The default is /usr/share/misc/pci.ids .)

A

lspci -i STRING

220
Q

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

A

lspci -m

221
Q

lspci

Displays PCI domain numbers. These numbers normally aren’t displayed.

A

lspci -D

222
Q

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 .

A

lspci -M

223
Q

lspci

Displays version information.

A

lspci –version

224
Q

modprobe

display extra information

A

modprobe -v

–verbose

225
Q

modprobe

This option overrides the default configuration directory (/etc/modprobe.d)

A

modprobe -C STRING

–config

226
Q

modprobe

This option does everything but actually insert or delete the modules

A

modprobe -n
–dry-run
useful when combined with -v

227
Q
modprobe
Reverses modprobe 's usual effect; it causes the program to remove the specified module and any on which it depends
A

modprobe -r

–remove

228
Q
modprobe
force the module loading even if the kernel version doesn't match what the module expects. This action is potentially dangerous
A

modprobe -f

–force

229
Q
modprobe
shows all of the modules on which the specified module depends
A

modprobe –show-depends

230
Q

modprobe

displays a list of available options whose names match the wildcard you specify

A

modprobe -l STRING

  • -list
    eg. modprobe -l v* displays all modules whose names begin with v
231
Q

rmmod

display some extra information about what it’s doing

A

rmmod -v

–verbose

232
Q
rmmod
forces module removal even if the module is marked as being in use. Naturally; this is a very dangerous option;
A

rmmod -f

–force

233
Q
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
A

rmmod -w

–wait

234
Q

lsusb

display more information

A

lsusb -v

235
Q

lsusb

restricts output to the specified bus and device number.

A

lsusb -s STRING

-s [[ bus ]:][ devnum ]

236
Q

lsusb

restrict output to a particular vendor and product

A

lsusb -d STRING

-d [ vendor ]: [ product ]

237
Q

lsusb
displays information about the device that’s accessible via filename ; which should be a file in the /proc/bus/usb directory tree

A

lsusb -D STRING

238
Q

lsusb

displays the device list as a tree so that you can see what devices are connected to specific controllers more easily

A

lsusb -t

239
Q

lsusb

displays the version of the lsusb utility

A

lsusb -V

–version

240
Q

fdisk

display the current partition table

A

fdisk -l

241
Q

fdisk

delete a partition

A

fdisk d while running

242
Q

fdisk

display help

A

fdisk m while running

also ?

243
Q

fdisk

change the partition type code

A

fdisk t while running

244
Q

fdisk

display common partition type codes

A

fdisk l while running

245
Q

fdisk

set the bootable flag

A

fdisk a while running

246
Q

fdisk

exit

A

fdisk q while running

247
Q

fdisk

save changes and exit

A

fdisk w while running

248
Q

gdisk

display existing partitions

A

gdisk print while running

249
Q

mkfs

sets the reserved-space percentage to NUMBER

A

mkfs -m NUMBER

250
Q

tune2fs

Adjust the number of mounts after which the filesystem will be checked by e2fsck

A

tune2fs -c NUMBER

251
Q

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.

A

tune2fs -i NUMBER

252
Q

tune2fs

converts ext2 to ext3

A

tune2fs -j

253
Q

tune2fs

sets the reserved-space blocks to NUMBER

A

tune2fs -r NUMBER

254
Q

xfs_admin

enable version 2 log (journal) format

A

xfs_admin -j

255
Q

xfs_admin

obtain the filesystem’s label (name)

A

xfs_admin -l

256
Q

xfs_admin

obtain the filesystem’s uuid

A

xfs_admin -u

257
Q

xfs_admin

set the filesystem’s label (name)

A

xfs_admin -L STRING

258
Q

xfs_admin

set the filesystem’s uuid

A

xfs_admin -U STRING

259
Q

debugfs

produces superblock information; similar to what dumpe2fs displays

A

debugfs show_super_stats while running

also stats

260
Q

debugfs

display the inode data on a file or directory

A

debugfs stat STRING (while running)

STRING is the name of a file or directorhy

261
Q

debugfs

undelete a file

A

debugfs undelete NUMBER STRING (while running)
also undel
NUMBER is the inode number and STRING is the name you want to give i

262
Q

debugfs

obtain a list of deleted inodes

A
debugfs lsdel (while running)
also list_deleted_inodes
263
Q

debugfs

extract a file from the filesystem

A

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
Q

debugfs

produces a summary of available commands

A
debugfs list_requests (while running)
also lr; help; or ?
265
Q

debugfs

exit the program

A

debugfs quit

266
Q

fsck

check all of the filesystems marked to be checked in /etc/fstab .

A

fsck -A

267
Q

fsck

displays a text-mode progress indicator of the check process

A

fsck -c

268
Q

fsck

produces verbose output of the check process

A

fsck -v

269
Q

fsck

display what it would normally do without actually doing it

A

fsck -N

270
Q

fsck

causes the program to check only the specified filesystem types; even if others are marked to be checked

A

fsck -t STRING
used with -A
If STRING is prefixed with no ; then all filesystems except the specified type are checked

271
Q

fsck

passes STRING to the underlying check program

A

fsck –STRING

272
Q

df
includes pseudo-filesystems with a size of 0 in the output. These filesystems may include /proc ; /sys ; /proc/bus/usb ; and others

A

df -a

–all

273
Q

df

scale and label its units

A

df -h

–human-readable

274
Q

df

scale and label its units using powers of 10

A

df -H

–si

275
Q

df

scale and label its units using kilobytes

A

df -k

–kilobytes

276
Q

df

scale and label its units using megabytes

A

df -m

–megabytes

277
Q

df

report on available and used inodes

A

df -i

–inodes

278
Q

df

omit network filesystems

A

df -l

–local

279
Q

df

display filesystem type

A

df -T

–print

280
Q

df

displays only information about filesystems of the specified type

A

df -t STRING

–type=STRING

281
Q

df

don’t display information about filesystems of the specified type

A

df -x STRING

–exclude=STRING

282
Q

du

report on individual files as well.

A

du -a

–all

283
Q

du

add a grand total to the end of its output

A

du -c

–total

284
Q

du

scale and label its units;

A

du -h

–human-readable

285
Q

du

scale and label its units using powers of 10

A

du -H

–si

286
Q

du

scale and label its units using kilobytes

A

du -k

–kilobytes

287
Q

du

scale and label its units using megabytes

A

du -m

–megabytes

288
Q

du

count the space each hardlink takes (useful if you want to burn to optical storage)

A

du -l

–count-links

289
Q

du

limits the report to NUMBER levels

A

du –max-depth=NUMBER

290
Q

du

equivalent to –max=depth=0

A

du -s

–summarize

291
Q

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

A

du -x

–one-file-system

292
Q

mount

mount all of the filesystems listed in the /etc/fstab

A

mount -a

293
Q

mount

mount the filesystem read-only

A

mount -r

294
Q

mount

produces verbose output

A

mount -v

295
Q

mount

mount the filesystem for both read and write

A

mount -w

also: -o rw

296
Q

mount

specify the filesystem type

A

mount -t STRING

297
Q

mount

mount the filesystem whose label matches STRING

A

mount -L STRING

298
Q

mount

mount the filesystem whose UUID matches STRING

A

mount -U STRING

299
Q

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

A

mount -o defaults

supported filesystems: all

300
Q

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

A

mount -o loop

supported filesystems: all

301
Q

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

A

mount -o auto or noauto

supported filesystems: all

302
Q

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.

A

mount -o user or nouser

supported filesystems: all

303
Q

mount

Similar to user ; except that any user may unmount a filesystem once it’s been mounted.

A

mount -o users

supported filesystems: all

304
Q

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

A

mount -o owner

supported filesystems: all

305
Q

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

A

mount -o remount

supported filesystems: all

306
Q

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

A

mount -o ro

supported filesystems: all

307
Q

mount

Specifies a read/write mount of the filesystem. This is the default for most read/write filesystems

A

mount -o rw

supported filesystems: All read/write filesystems

308
Q

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.)

A

mount -o uid=NUMBER

supported filesystmes: Most filesystems that don’t support Unix-style permissions; such as vfat ; hpfs ; ntfs ; and hfs

309
Q

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

A

mount -o gid=value

supported filesystems: Most filesystems that don’t support Unix-style permissions; such as vfat ; hpfs ; ntfs ; and hfs

310
Q

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.

A

mount -o umask=value

supported filesystems: Most filesystems that don’t support Unix-style permissions; such as vfat ; hpfs ; ntfs ; and hfs

311
Q

mount

Similar to umask ; but sets the umask for directories only; not for files.

A

mount -o dmask=value

supported filesystems: Most filesystems that don’t support Unix-style permissions; such as vfat ; hpfs ; ntfs ; and hfs

312
Q

mount

Similar to umask ; but sets the umask for files only; not for directories.

A

mount -o fmask=value

supported filesystems: Most filesystems that don’t support Unix-style permissions; such as vfat ; hpfs ; ntfs ; and hfs

313
Q

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.

A

mount -o conv=code

supported filesystems: Most filesystems used on Microsoft and Apple OSs: msdos ; umsdos ; vfat ; hpfs ; and hfs

314
Q

mount

Disables Rock Ridge extensions for ISO-9660 CD-ROMs.

A

mount -o norock

supported filesystems: iso9660

315
Q

mount

Disables Joliet extensions for ISO-9660 CD-ROMs.

A

mount -o nojoliet

supported filesystems: iso9660

316
Q

umount

attempt to unmount all of the partitions listed in /etc/mtab

A

umount -a

317
Q

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

A

umount -f

318
Q

umount

if it can’t unmount a filesystem; it should attempt to remount it in read-only mode

A

umount -r

319
Q

umount

unmount only partitions of the specified type. You can list multiple filesystem types by separating them with commas.

A

umount -t STRING

320
Q
ls
append indicator (one of */=>@|) to entries
A
ls -F
--classify
/ Directory
* Executable
| Named pipe
= Socket
@ Symbolic Link
321
Q

ls

show hidden files (dot)

A

ls -a

–all

322
Q

ls

long listing

A

ls -l

323
Q

ls

colored listing

A

ls –color

324
Q

ls

only list the directory’s name; useful for globbing for directories

A

ls -d

–directory

325
Q

ls

display directory contents recursively.

A

ls -R

–recursive

326
Q

cp

overwrite any existing files without prompting

A

cp -f

–force

327
Q

cp

prompt before overwriting

A

cp -i

–interactive

328
Q

cp

preserves ownership and permissions; if possible

A

cp -p

–preserve

329
Q

cp

copy recursively

A

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
Q

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.

A

cp -a

–archive

331
Q

cp

copy the file only if the original is newer than the target or if the target doesn’t exist

A

cp -u

–update

332
Q

touch

change the access time alone; not the modification time

A

touch -a

–time=atime

333
Q

touch

change the modification time alone; not the access time

A

touch -m

–time=mtime

334
Q

touch

don’t create the file if it doesn’t exist

A

touch -c

–no-create

335
Q

touch

ets the time to the value specified by STRING

A

touch -t STRING

MMDDhhmm[[CC]YY][.ss]

336
Q

tar

Changes to directory dir before performing operations

A

tar C

  • -directory
    eg. tar -xvzf bigfile.tar.gz -C /folder/subfolder/
337
Q

tar

Uses the file called file on the computer called host as the archive file

A

tar f

–file [host:]file

338
Q

tar

Performs an incremental backup or restore; using file as a list of previously archived files

A

tar g STRING

–listed- incremental file

339
Q

tar

Creates or extracts a multi-volume archive

A

tar M

–multi- volume

340
Q

tar

Preserves all protection information

A

tar p

–preserve- permissions

341
Q

tar

Retains the leading / on filenames

A

tar P

–absolute- paths

342
Q

tar

Lists all files read or extracted; when used with –list ; displays file sizes; ownership; and time stamps

A

tar v

–verbose

343
Q

tar

Verifies the archive after writing it

A

tar W

–verify

344
Q

tar

Compresses an archive with gzip

A

tar z

–gzip or – ungzip

345
Q

tar

Compresses an archive with bzip2

A

tar j
–bzip2
some older versions used I or y

346
Q

tar

Compresses an archive with xz

A

tar J

–xz

347
Q

tar

Creates an archive

A

tar c

–create

348
Q

tar

Appends tar files to an archive

A

tar A

–concatenate

349
Q

tar

Appends non- tar files to an archive

A

tar r

–append

350
Q

tar

Appends files that are newer than those in an archive

A

tar u

–update

351
Q

tar

Compares an archive to files on disk

A

tar d

–diff or –compare

352
Q

tar

Lists an archive’s contents

A

tar t

–list

353
Q

tar

Extracts files from an archive

A

tar x

–extract or –get

354
Q

cpio

creates an archive and copies files into it

A

cpio -o

–create

355
Q

cpio

extracts data from an existing archive.

A

cpio -i

–extract

356
Q

cpio

combines the copy-out and copy-in modes; enabling you to copy a directory tree from one location to another.

A

cpio -p

–pass-through

357
Q

cpio

Resets the access time after reading a file so that it doesn’t appear to have been read.

A

cpio -a

–reset- access-time

358
Q

cpio

Appends data to an existing archive.

A

cpio -A

–append

359
Q

cpio

Uses the contents of filename as a list of files to be extracted in copy-in mode.

A

cpio -E STRING

–pattern-file=filename

360
Q

cpio

Uses filename as the cpio archive file; if this parameter is omitted; cpio uses standard input or output.

A

cpio -F STRING

–file=filename

361
Q

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 ).

A

cpio -H STRING

–format=format

362
Q

cpio
Uses the filename specified by STRING instead of standard input. (Unlike -F ; this option does not redirect output data.)

A

cpio -I STRING

363
Q

cpio
In copy-in mode; extracts files relative to the current directory; even if filenames in the archive contain full directory paths.

A

cpio –no-absolute-filenames

364
Q

cpio
Uses the filename specified by STRING instead of standard output. (Unlike -F ; this option does not redirect input data.)

A

cpio -o STRING

365
Q

cpio

Displays a table of contents for the input

A

cpio -t

–list

366
Q

cpio

Replaces all files without first asking for verification.

A

cpio -u

–unconditional

367
Q

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 ).

A

cpio -v

–verbose

368
Q

dd

use STRING as the input file

A

dd if=STRING

dd if=/dev/sda3 of=/dev/dvd

369
Q

dd

use STRING as the output file

A

dd of=STRING

dd if=/dev/sda3 of=/dev/dvd

370
Q

dd
read the filesystem using a block size of NUMBER
1024 seems good

A

dd bs=NUMBER

371
Q

dd

read count*bs bytes from the input file

A

dd count=NUMBER

372
Q

ln

overwrite any existing files without prompting

A

ln -f

–force

373
Q

ln

prompt before overwriting

A

ln -i

–interactive

374
Q

ln

attempt to make a hard link to a directory

A

ln -d
or -F or –directory
usually fails

375
Q

ln

make a symbolic link

A

ln -s

–symbolic

376
Q

mkdir

causes the new directory to have the specified permission mode; expressed as an octal number.

A

mkdir -m STRING

–mode=mode

377
Q

mkdir

create parent directories as needed

A

mkdir -p

–parents

378
Q

rmdir

don’t display an error message if the directory isn’t empty

A

rmdir –ignore-fail-on-non-empty

379
Q

rmdir

delete parent directories recursively

A

rmdir -p

  • -parents
    eg. rmdir -p one/two/three
380
Q

chown

A

chown -R

–recursive

381
Q

chmod

set permissions for the owner

A

chmod u

382
Q

chmod

set permissions for the group

A

chmod g

383
Q

chmod

set permissions for all others (world)

A

chmod o

384
Q

chmod

set permissions for ugo

A

chmod a

385
Q

chmod

add permissions

A

chmod +

386
Q

chmod

remove permissions

A

chmod -

387
Q

chmod

set permissions equal to

A

chmod =

388
Q

chmod

read permission

A

chmod r

389
Q

chmod

write permission

A

chmod w

390
Q

chmod

execute permission

A

chmod x

391
Q

chmod

execute permission only if it’s already set

A

chmod X

392
Q

chmod

SUID or SGID

A

chmod s

393
Q

chmod

sticky bit

A

chmod t

394
Q

chmod

existing owner’s permissions

A

chmod u

395
Q

chmod

existing other permissions

A

chmod o

396
Q

umask
display permissions that will not be removed from files/folder symbolically
e.g. u=rwx;g=rx;o=rx

A

umask -S

397
Q

newgrp

reinitializes the environment as if the user had just logged in

A

newgrp -l

398
Q

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.

A

chattr [+-]A

399
Q

chattr

disables write access to the file except for appending data.

A

chattr [+-]a

400
Q

chattr

causes the kernel to compress data written to the file automatically and uncompress it when it’s read back.

A

chattr [+-]c

401
Q

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.

A

chattr [+-]i

402
Q

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.

A

chattr [+-]j

403
Q

chattr

when the file is deleted; the kernel zeros its data blocks

A

chattr [+-]s

404
Q

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

A

chattr [+-]t

405
Q

quotacheck

create aquota.user and aquota.group files

A

quotacheck -c

406
Q

quotacheck

check user quotas

A

quotacheck -u

407
Q

quotacheck

check group quotas

A

quotacheck -g

408
Q

edquota
sets the soft limit grace period
0 disables it
grace periods are per filesystem, not per user

A

edquota -t

409
Q

edquota

edit the quota for the group STRING

A

edquota -g STRING

410
Q

quota

display group quotas

A

quota -g

411
Q

quota

omits NFS mounts

A

quota -l

412
Q

quota

limits output to filesystems on which usage is over the limit

A

quota -q

413
Q

find

find files that have the specified permissions

A

find -perm NUMBER
also symbolically
e.g. -perm g=w

414
Q

find

find files that have any of the specified permission bits set

A

find -perm +NUMBER

415
Q

find

locate files that use NUMBER units of space; rounding up

A
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
Q

find

locate files larger than NUMBER units of space; rounding up

A

find -size +NUMBER

417
Q

find

locate files less than NUMBER units of space; rounding up

A

find -size -NUMBER

418
Q

find

locates files whose gid matches GID

A

find -gid NUMBER

419
Q

find

locate files whose group matches STRING

A

find -group STRING

420
Q

find

locates files whose uid matches UID

A

find -uid NUMBER

421
Q

find

locate files whose owner matches STRING

A

find -user STRING

422
Q

find

only recuse NUMBER directories

A

find -maxdepth NUMBER

423
Q

which

show all matches

A

which -a

424
Q

type

shortens the output to builtin ; file ; alias ; or other short identifiers.

A

type -t

425
Q

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.

A

type -a

426
Q

chkconfig

list the services and their applicable runlevels

A

chkconfig –list

427
Q

chkconfig

set the STRING1 program to on or off (STRING2) on the runlevels specified in NUMBER with no delimiters

A

chkconfig –level NUMBER STRING1 STRING2

chkconfig –level 23 nfs-common on

428
Q

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

A

chkconfig –add STRING

429
Q

shutdown

shutdown now

A

shutdown now

430
Q

shutdown

cancel a pending shutdown

A

shutdown -c

431
Q

shutdown

reboot

A

shutdown -r

432
Q

shutdown

halt

A

shutdown -H

433
Q

shutdown

power off

A

shutdown -P

434
Q

shutdown

usually powers off; may halt

A

shutdown -h

435
Q

systemctl

Displays the current status of all configured units.

A

systemctl list-units

436
Q

systemctl

Changes to the default target uni

A

systemctl default

437
Q

systemctl

Starts the named unit and stops all others.

A

systemctl isolate
systemctl isolate rescue.target
go into single user mode

438
Q

systemctl

Starts the named unit.

A

systemctl start STRING

439
Q

systemctl

Stops the named unit.

A

systemctl stop STRING

440
Q

systemctl

Causes the named unit to reload its configuration file.

A

systemctl reload STRING

441
Q

systemctl

Causes the named unit to shut down and restart.

A

systemctl restart STRING

442
Q

systemctl

Displays the status of the named unit. (You can pass a PID value; rather than a name; if you like.)

A

systemctl status STRING

443
Q

systemctl

Configures the unit to start when the computer next boots.

A

systemctl enable STRING

444
Q

systemctl

Configures the unit not to start when the computer next boots.

A

systemctl disable STRING

445
Q

vi commands while running

opens a new line immediately below the current line; moves the cursor to that line; and enters insert mode

A

vi commands while running o

446
Q

vi commands while running

copy # lines

A

vi commands while running #yy

447
Q

vi commands while running

cut # lines

A

vi commands while running #dd

448
Q

vi commands while running

copy from cursor to end of word

A

vi commands while running yw

449
Q

vi commands while running

cut from cursor to end of word

A

vi commands while running dw

450
Q

vi commands while running

paste

A

vi commands while running p

451
Q

vi commands while running

enter text replacement mode

A

vi commands while running R

452
Q

vi commands while running

enter insert mode and advance the cursor 1 space

A

vi commands while running a

453
Q

vi commands while running

:wq

A

vi commands while running ZZ

454
Q

vi commands while running

change case under cursor and advance 1

A

vi commands while running ~

455
Q

vi commands while running

undo

A

vi commands while running u

456
Q

vi commands while running

inserts a new line immediately below the current one and enters insert mode on that line

A

vi commands while running o

457
Q

vi commands while running

search forward for text

A

vi commands while running /

458
Q

vi commands while running

search backward for text

A

vi commands while running ?

459
Q

vi commands while running

clear from cursor to the end of the word and enter insert mode

A

vi commands while running cw

460
Q

vi commands while running

clear line and enter insert mode

A

vi commands while running cc

461
Q

vi commands while running

go to line #

A

vi commands while running #G

462
Q

vi commands while running

move cursor to top of screen

A

vi commands while running H

463
Q

vi commands while running

move cursor to bottom of screen

A

vi commands while running L

464
Q

vi commands while running

replace STRING1 with STRING2 globally

A

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
Q

vi commands while running

load file STRING for editing

A

vi commands while running :e STRING

closes the currently open file

466
Q

vi commands while running

load file STRING on the line after the cursor

A

vi commands while running :r STRING

467
Q

vi commands while running

run external command STRING

A

vi commands while running :!STRING

:!ls runs ls ; enabling you to see what files are present in the current directory