Command
Description
• apropos whatis
Show commands
pertinent to string.
See also threadsafe
• man -t man | ps2pdf - > man.pdf
make a pdf of a
manual page
which command
Show full path name
of command
time command
See how long a
command takes
• time cat
Start stopwatch.
Ctrl-d to stop. See
also sw
• nice info
Run a low priority
command (The
"info" reader in this
case)
• renice 19 -p $
Make shell (script)
low priority. Use for
non interactive tasks
dir navigation
• cd -
Go to previous
directory
• cd
Go to $HOME
directory
(cd dir && command)
Go to dir, execute
command and return
to current dir
• pushd .
Put current dir on
stack so you can
popd back to it
file searching
• alias l='ls -l --color=auto'
quick dir listing
• ls -lrt
List files by date.
See also newest
and find_mm_yyyy
• ls /usr/bin | pr -T9 -W$COLUMNS
Print in 9 columns to
width of terminal
find -name '*.[ch]' | xargs grep -E 'expr'
Search 'expr' in this
dir and below. See
also findrepo
find -type f -print0 | xargs -r0 grep -F 'example'
Search all regular
files for 'example' in
this dir and below
find -maxdepth 1 -type f | xargs grep -F 'example'
Search all regular
files for 'example' in
this dir
find -maxdepth 1 -type d | while read dir; do echo $dir;
echo cmd2; done
Process each item
with multiple
commands (in while
loop)
• find -type f ! -perm -444
Find files not
readable by all
(useful for web site)
• find -type d ! -perm -111
Find dirs not
accessible by all
(useful for web site)
• locate -r 'file[^/]*\.txt'
Search cached
index for names.
This re is like glob
*file*.txt
• look reference
Quickly search
(sorted) dictionary
for prefix
• grep --color reference /usr/share/dict/words
Highlight
occurances of
regular expression
in dictionary
archives and compression
gpg -c file
Encrypt file
gpg file.gpg
Decrypt file
tar -c dir/ | bzip2 > dir.tar.bz2
Make compressed
archive of dir/
bzip2 -dc dir.tar.bz2 | tar -x
Extract archive (use
gzi