Show Menu
Cheatography

Ubuntu commands Cheat Sheet (DRAFT) by

This is a draft cheat sheet. It is a work in progress and is not finished yet.

Storage management

df
shows the amount of disk space used and disk space available on every file system containing each filesy­stem’s name and its path
df -h
free
displays the amount of free and used memory in the complete system

Processes

ps
process status command is used to provide inform­ation about the processes currently running on the system, including their respective process identi­fic­ation numbers (PIDs).
uptime
inform­ation about how long the system has been running in one line. Result for this command includes the current time, the time duration system has been running for, the number of users who are currently logged on, and the system load averages for the past 1, 5, and 15 minutes respec­tively.

User management

w
displays the detailed inform­ation about the users who are logged in the system currently.
passwd name
change the password of the user
exit
logout from the current user

Power off

shutdown
 

File handling

mkdir dir
rmdir dir
rm file
mv file or folder
mv file1 file2
move content of file1 onto file2, deleting file1
mv file new_name
renaming file1
cp A B
copy all the data from file A to file B and user can still access both files (A and B).
cat file
show file content
cat file1 file2
show file content of both
cat file1 file2 > file_o­utput
the user can create a new file (File_­Output) and append data from both the files (File1 and File2) into this new file named as File_O­utput by using operand “>”.
head -number file.txt
The command “head” prints the top N rows of data of the given input or file. By default, it prints the first 10 lines of the specified files
tail
echo expression
used to display any expression that is passed as an argument.
grep "text_p­ortion" file_o­r_f­older
used to search for a text in the specified file/f­older.
zip zip_file.zip file1 file2 file3
unzip zip_files.zip
tar -xvf archiv­e.t­ar.gz -C /home/­lin­uxi­ze/­files
unzip .tar.gz file onto another directory
sudo -i

Basic commands

history
command history
history -c
clear previous history
help
man command
displays user manual of said command
dir
display list of all direct­ories in current directory
ls
displays the list of all direct­ories, folder, and files present in the current directory.
cd
pwd
displays the path of the current directory user is operating in via Termina
clear
clear terminal screen
whereis
displays the path where the package for specific built-in Linux command locates
whatis
 

Packages

apt list --inst­alled
List all installed packages
sudo apt-get purge --auto­-remove packag­ename
Remove packages with depend­encies