A Linux commands cheat sheet is a concise and quick reference guide that provides a list of commonly used commands in the Linux command-line interface (CLI). It typically includes commands for navigating the file system, managing files and directories, viewing and editing files, obtaining system information, managing processes, handling users and permissions, and more.
The cheat sheet is a handy resource for both beginners and experienced Linux users who want a quick reminder of command syntax and options. It usually organises commands by categories and includes brief descriptions of their functionalities.
Navigation and File Management:
ls
– List files and directories.pwd
– Print the current working directory.cd
– Change directory.cd directory_name
cp
– Copy files or directories.- cp source destination
mv
– Move or rename files or directories.mv source destination
rm
– Remove files or directories.rm file_name
rm -r directory_name
(recursive)
mkdir
– Create a new directory.mkdir directory_name
touch
– Create an empty file or update the access and modification times of a file.
File Viewing and Editing:
cat
– Concatenate and display the content of files.more
/less
– View the contents of a file one screen at a time.more file_name
less file_name
nano
/vim
– Text editors for creating or modifying files.nano file_name
vim file_name
System Information:
uname
– Display system information.uname -a
df
– Display disk space usage.free
– Display amount of free and used memory in the system.top
– Display and update information about the top processes.
Process Management:
ps
– Display information about processes.ps aux
kill
– Terminate a process.kill process_id
pkill
– Send a signal to a process based on its name.pkill process_name
Users and Permissions:
whoami
– Display the current username.who
– Display information about users who are currently logged in.chmod
– Change file permissions.chmod permissions file_name
chown
– Change file owner and group.chown owner:group file_name
Package Management:
apt
– Advanced Package Tool for managing packages.sudo apt update
sudo apt install package_name
This is just a basic list, and there are many more Linux commands and options available. You can use the man
command followed by the command name to access the manual pages and get more information about a specific command. For example, man ls
will provide details about the ls
command.