Common Commands and Utilities
Common Commands and Utilities
Common Commands and Utilities
UTILITIES
COMMANDS YOU SHOULD KNOW
• chown/chmod/mkdir/cd/grep
• cd /rm/echo/cat/ls/ln/man
•| > >> < <<
• grep/more/less
MAN
MAN(1) Manual pager utils MAN(1)
NAME
man - an interface to the on-line reference manuals
SYNOPSIS
man [-C file] [-d] [-D] [--warnings[=warnings]] [-R encoding] [-L
locale] [-m system[,...]] [-M path] [-S list] [-e extension] [-i|-I]
[--regex|--wildcard] [--names-only] [-a] [-u] [--no-subpages] [-P
pager] [-r prompt] [-7] [-E encoding] [--no-hyphenation] [-p string]
[-t] [-T[device]] [-H[browser]] [-X[dpi]] [-Z] [[section] page ...] ...
man -k [apropos options] regexp ...
man -K [-w|-W] [-S list] [-i|-I] [--regex] [section] term ...
man -f [whatis options] page ...
man -l [-C file] [-d] [-D] [--warnings[=warnings]] [-R encoding] [-L
locale] [-P pager] [-r prompt] [-7] [-E encoding] [-p string] [-t]
[-T[device]] [-H[browser]] [-X[dpi]] [-Z] file ...
man -w|-W [-C file] [-d] [-D] page ...
man -c [-C file] [-d] [-D] page ...
man [-hV]
PROCESS CONTROL AND MONITORING
• ps – list processes
• pstree -Au
• List out processes and relationships
• kill/killall
• top – used to monitor processes and system usage
NICE AND RENICE
• Great for find info about the system and how its currently configured.
FILE SYSTEMS
• ext2
• ext3 – ext2 w/ Journaling
• ext4
• resierfs
• FAT/FAT32/NTFS
• ISO 9660
• Windows:
\Device\Harddisk0\ (physical hard disk)
• mkfs.ext3 /dev/sda2
• What does this do: mkfs.ext3 /dev/sda
• Is it valid?
• Windows corollary: format c:
• FORMAT volume /FS:filesystem …
FILE SYSTEM NAVIGATION
/bin – system binary executables /opt – optional install dir
/boot – kernel and boot files /proc
/dev – system devices /root – home dir for root (optional)
/etc – startup and config files /sbin – binaries for su
/home – home dir for users /selinux
/lib – shared libraries (think dll) /sys
/media – mount for removable media /tmp – temporary files (wiped on restart)
/mnt - mount /usr – typical installed programs, man
pages, local files, etc.
/var – logging, pids, mail
/usr /var
--/bin – binary executables --/log
--/include --/mail
--/lib --/opt
--/local – local version of /usr --/run – pids
--/sbin – binary executables for su --/spool – spools printers, mail, etc.
--/share --/tmp – non volatile temp
--/src – shared source code (kernel, etc.)
FILE TYPES
• Regular Files
• Directory
• Character device file
• Block device file
• Local domain socket
• Named pipe
• Symbolic Link
MOUNT
• mount /media/cdrom