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 filesystem’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 information about the processes currently running on the system, including their respective process identification numbers (PIDs). |
uptime |
information 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 respectively. |
User management
w |
displays the detailed information about the users who are logged in the system currently. |
passwd name |
change the password of the user |
exit |
logout from the current user |
|
|
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_output |
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_Output 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_portion" file_or_folder |
used to search for a text in the specified file/folder. |
zip zip_file.zip file1 file2 file3 |
unzip zip_files.zip |
tar -xvf archive.tar.gz -C /home/linuxize/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 directories in current directory |
ls |
displays the list of all directories, 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 --installed |
List all installed packages |
sudo apt-get purge --auto-remove packagename |
Remove packages with dependencies |
|