Operators |
&& - and, || - or |
apropos |
Returns all documentation containing the defined command |
bzip/bunzip - bzip |
Compresses files |
cat |
Outputs the contents of a file |
cd |
Change directory |
chmod |
Change file mode |
chown |
Change ownership |
clear |
Clears the screen |
cp |
Copy
Options
-f Force; will overwrite any existing files with the same name
-i Interactive; will ask to overwrite
-p Preserves file ownership
-r Recursive; will copy files under directories
-a Archive; preserve symlinks
-u Copy only if original file is newer
|
cut |
Manipulate data by columns
Options
-c Range to cut [-c2-4]
-d Define a deliminator to use with fields
-f Return the numbered field
|
dig |
Look up IP addresses and DNS names |
env |
Show environmental variables for current user |
exit |
Terminates all current processes, including shell |
find |
Locate file in system |
finger |
Used to find out information regarding a user |
free |
Reports on system memory |
grep |
search for string
Options
-i Case insensitive
-n Include line number in output
|
groupadd |
Add group
Options
-g Group ID
-p Password
-r Create system group
|
groupmod |
Modify group
Options
-g GID
-p Password
|
head |
Output the first ten lines of a file |
halt |
Shuts down operating system |
id |
Outputs user and group IDs for a user
Options
-u Show only UID
-g Show only GID
-G Show all groups to which a user belongs
-Gn Group name
|
if |
Conditional statements in bash scripting
Options
-d See if directory exists
-e See if file exists
-f See if file exists and it is a regular file
-G See if file exists and it is owned by a defined group
-h See if file exists and it is symlinked
-L See if file exists and it is symlinked (same as -h)
-O See if file exists and it is owned by defined UID
-r See if file exists and has read permissions
-w See if file exists and had write permissions
-x See if file can be executed
|
ifconfig |
Shows NIC for network card; configures network settings |
info |
Improved manual pages |
init 0 |
Shuts down operating system |
init 6 |
Reboots the operating system |
ipaddr |
Replaces ifconfig on newer systems |
last |
hows last command used by defined user |
less |
Opens file in a vim-like environment for viewing |
ln |
link files Option -s Create symbolic link |
ls |
List contents of directory
Options
-a List all files, including hidden files
-l List files, including details such as owner and permissions
-p Adds a / to the end of directories
-R Enable recursion, including all sub-directories
|
man |
Manual pages
1 Executable programs and shell commands
2 System calls for the kernel
3 Library calls
4 Device files
5 File formats
6 Games
7 Misc.
8 Programs only run by the root user
9 Kernel routines
-k Returns all documentation containing search keyword (apropos)
|
mv/move |
Used to move or rename files
Options
-m Set permissions mode
-p Force recursion
|
netstat |
Shows network status
Options
-a All listening and non-listening sockets
-i Network interface statistics
-l Listening sockets
-s Summary of each protocol
|
passwd |
Change/set password
Options
-S View password settings
-l Locks account
-u Unlocks account
-d Remove password
-n Set days before password change
-x Set maximum days before password change
-w Days to warn prior to password reset
-i Days to wait after expired password to disable account
|
ping |
Test connectivity of remote network device |
ps |
Process status Options -u Define user |
pwck |
Verifies the integrity of the password files |
pwconv |
Syncs /etc/passwd and /etc/shadow |
pwd |
Print working directory |
reboot |
Shuts down, then restarts the system |
route |
View routing tables |
set - similar to env |
Works with environment variables |
sort |
Sorts text in file
Options
-r Sort in reverse order
-n Sort numerically
|
su |
Substitute user |
sudo |
Run command as root |
tail |
Outputs the last ten lines of a file |
rm |
Remove Option -r Enable recursion |
rmdir |
Remove directory |
shutdown |
Shuts down the system
Options
-H Halts the machine
-P Power off
-r Reboot
-h Equivalent to powering off, overridden by --halt
-k Send warning, but perform no actions
-c Cancel a shutdown
|
su |
Substitute user |
tar |
Archives files
Options
-cf Create file
-xf Extract file
-v Verbose
-zcf Archive with gzip
-jcf Archive with bzip2
|
top |
Shows list of current applications/processes, and system usage
Options
h Help
k Input process ID to kill
r Change process priorety
p Sort by CPU usage
m Sort by memory usage
|
touch |
Created empty file
Options
-c Will not create file if one exists; will update timestamp
-d Manually set timestamp; can be used with directories
|
traceroute |
Traces the route a packet takes |
uname |
Returns information related to the system
Options
-s Displays kernel name
-n Displays hostname
-r Kernel release number
-v Kernel version number
-m Hardware architecture
-p Processor architecture
-i Hardware platform
-o Operating system
-a All information
|
useradd |
Adds new user
Options
-D Outputs defaults
-c Comment
-e When to expire account
-f Number of days after password expiration to disable account
-g Default group
-G Additional groups
-M Do not create home directory
-m Set home directory
-p Define password
-r Create system user
-s Set default shell
-u Define UID
|
userdel |
Delete user Option -r Delete home folder |
usermod |
Modify user account
Options
-c Comment
-e Expire date
-f Days after password expiration to disable account
-G Add groups
-l Change username
-L Lock account
-m Move home directory
-p Change password
-u Set user ID
-U Unlock account
|
w |
Displays user system information |
wc |
Word count
Options
-w Count words
-c Count characters
|
whatis |
Returns available man pages for command |
which |
Shows location of application |
who |
Displays who is logged in
Options
-b Last boot time of machine
-m Hostname and associated user
-r Run level for current user
-q Number of logged-in users
-a All
|
whoami |
Outputs username of current user |
zip/unzip - zip; |
Compresses files |