A to Z
Glossary
Every concept in this sheet, plus the smaller terms it uses. Select a concept to open its card.
A
- Absolute and relative paths
- An absolute path starts at
/, such as/var/log/syslog. - awk
awksplits each line into fields ($1,$2,$NFfor the last) and runs a small program per line, with patterns, variables and sums.
C
- Creating, copying, moving and deleting
mkdir -pcreates directories including parents,touchcreates an empty file,cp -rcopies,mvmoves or renames, andrmdeletes (-rfor directories).
D
- diff and comparing files
diff -ushows line differences between two files in unified format.
F
- Filesystem layout
- Everything hangs off
/. - find
findwalks a directory tree and matches files by name, type, size, age or owner, then prints them or runs an action on each.
G
- Getting help
man cmdopens the manual page,cmd --helpprints a short usage summary, andtype cmdtells you whether a name is a program, a shell builtin or an alias.- Globs and hidden files
- The shell expands globs before running a command:
*matches any characters,?one character,[abc]a set, and{a,b}expands to both words. - grep
grepprints lines matching a pattern.
H
- Hard and symbolic links
- A symbolic link is a small file pointing to a path.
M
- Moving around and listing
pwdprints where you are,cdchanges directory (cd -goes back,cdalone goes home), andlslists contents with options for details, hidden files and sorting.
S
- sed
sededits text as it streams past, most often substituting withs/old/new/g.- sort, uniq, cut and wc
sortorders lines (-nnumeric,-rreverse,-kby column),uniqcollapses adjacent duplicates (-ccounts them),cutextracts fields by delimiter, andwc -lcounts lines.
V
- Viewing files
catprints a file,lesspages through it (search with/, quit withq),headandtailshow the first or last lines, andtail -ffollows a file as it grows.
X
- xargs
xargsreads items from standard input and passes them as arguments to a command, in batches.