Command Cheat Sheet
File Administration
-
cd[options] directory : Used to change the current directory -
chgrp[options] group files : Change group ownership of one or more files & directories -
chmod[options] mode files : Change access permissions of one or more files & directories -
chown[options] newowner files : Change the ownership of one or more files & directories -
cp[options] source destination : Copy files and directories -
find[start-point] [search-criteria] [search-term] : find files -
gzip[options] filename : compress or expand files -
ln[options] originalfile linkfile : Create links between files or directories -
ln[options] originalfile : Create a link to the original file in the current directory -
ls[options] [arguments] : List the files in a particular directory -
mkdir[options] directory : Make a directory -
mv[options] source destination : Move and/or rename files and directories -
pwd[option] : prints the current working directory -
rm[options] file : Delete files or directories -
rmdir[options] directory : Remove empty directories -
tar[options] archivename [file(s)] : archive or extract files
Accessing File Contents
-
cat[options] [filenames] [-] [filenames] : Display, combine or create new files. -
cut[options] file : Cut out sections of each line of a file or files -
diff[options] from-file to-file : Display the differences between two files -
grep[options] pattern [file] : Search text and match patterns -
head[options] filename(s) : List the first part of a specified file -
less[options] filename : Display text files -
more[options] filename : Display a text file -
tail[options] filename(s) : List the last part of a specified file
File Systems
-
fdisk[options] [device] : manipulate partition tables. -
mkfs[options] device : format a partition with a file system -
mount[options] type device directory : Mount storage onto the file system -
umount[options] device and/or directory : Unmount storage from the file system
System Information
-
date[options] +format : display or set the date / time -
df[options] file : display the amount of free space on filesystems. -
du[options] file : display the amount space used in files and directories -
free[options] : displays information about free and used memory on the system
Processes
-
crontab[-u user] [-l | -r | -e] : Schedule a task to run at a particular time or interval -
kill[options] PID(s) : sends a signal to terminate a process or processes by PID -
killall[options] command name : sends a signal to terminate a processes by name -
ps[options] : displays a snapshot of the current processes -
top[options] : display system and process information in real time
Network
-
curl[options] [URL] : download or upload files to remote servers. -
host[options] server : checks a computers IP address from its host-name or the reverse -
ifconfig[arguments] interface [options] : Configure a network interface -
ifconfig[arguments] [interface] : View network interface details -
ip[options] object sub-command [parameters] : network configuration tool -
netstat[options] : network connection monitoring tool -
ping[options] remote server : checks the network connection to a remote server. -
scp[options] user1@sourcehost:directory/filename user2@destinationhost:directory/filename : securely copy files between computers -
sftp[options] [user@]host-name[:directory] : interactively copy files between computers securely -
ssh[options] [login name] server : securely access a remote computer. -
traceroute[options] host-name : trace the route packets take to network host -
wget[options] [URL] : download or upload files from the web non-interactivly.
Miscellaneous
-
apt-get install *package-name*: Install a package -
apt-get remove *package-name*: Un-install a package -
apt-get update: Update the database of available packages -
apt-get upgrade: Upgrade the packages on the system -
clear: clears the terminal screen. -
echo[options] [string(s)] : display text on the screen. -
man[options] command : display the reference manual for a command. -
modprobe[options] modulename : Load or remove a Linux kernel module -
passwd[options] username : change the user password -
shutdown[options] [time] [message] : shut down or restart a system. -
su[options] [username] : switch to another user. -
sudo[options] command : Execute a command as the superuser -
usermod[options] username : Modify a users account configuration -
who[options] : report the users logged onto the system. -
whoami[options] : report the current user.