Introduction
Welcome to Cheat – The Ultimate Linux Commands Cheat Sheet for Beginners and Administrators! This cheat sheet is designed to help you quickly and easily find the Linux commands you need to know. Whether you are a beginner or an experienced Linux administrator, this cheat sheet will provide you with the essential commands and syntax you need to get the job done. With this cheat sheet, you can quickly look up the syntax for a command, find out what it does, and learn how to use it. So let’s get started!
Cheat – The Ultimate Linux Commands Cheat Sheet for Beginners and Administrators
1. ls: List directory contents
2. cd: Change directory
3. mkdir: Create a new directory
4. cp: Copy files and directories
5. mv: Move or rename files and directories
6. rm: Remove files and directories
7. chmod: Change file permissions
8. chown: Change file ownership
9. grep: Search for patterns in files
10. find: Find files and directories
11. tar: Create and extract archives
12. gzip: Compress and decompress files
13. man: Display manual pages
14. top: Display system processes
15. ps: Display process information
16. kill: Terminate a process
17. df: Display disk usage
18. du: Display disk usage by directory
19. ping: Test network connectivity
20. ssh: Secure shell access
21. scp: Securely copy files over a network
22. wget: Download files from the web
23. curl: Transfer data over the web
24. rsync: Synchronize files and directories
25. apt-get: Install and manage software packages
26. yum: Install and manage software packages
27. service: Manage system services
28. reboot: Reboot the system
29. shutdown: Shutdown the system
30. ifconfig: Configure network interfaces
31. route: Configure network routing tables
32. iptables: Configure firewall rules
33. crontab: Schedule tasks to run periodically
What you do when you are not sure of the command you are running especially in case of complex Linux commands which use a lot of options. We use man pages to get some help in such situations. Some of the other options may include commands like ‘help‘, ‘whereis‘, and ‘whatis‘, but all have their pros and cons.
While going through man pages for options and help, the description in man pages are too lengthy to understand especially in a short span of time.
whereis Command – Find the Location of a Command
The whereis command hardly tells anything other than the location of installed binaries (commands), source code, and the manual page of the command.
$ whereis ls
whatis Command – Show Description of a Command
The whatis command gives a strict and one-liner answer which is not much helpful other than acknowledging the purpose of the command, Moreover, it never says a single word about the available options.
We have used all these options to date to solve our issue in the dilemma but here comes an interactive cheat-sheet application ‘Cheat‘ which is going to lead all the rest.
What is Linux Cheat Command?
Cheat is an interactive command-line cheatsheet application that allows you to create, view, and manage interactive cheat sheets for various commands and topics directly from the command line.
It allows you to store and organize helpful commands, tips, and examples in plain text files, referred to as cheat sheets. These cheat sheets can then be easily accessed and displayed in the terminal whenever needed.
How to Install Cheat Linux
To use the “cheat” utility, you need to have it installed on your system by simply running the following commands into your terminal:
$ cd /tmp $ wget https://github.com/cheat/cheat/releases/download/4.4.0/cheat-linux-amd64.gz $ gunzip cheat-linux-amd64.gz $ chmod +x cheat-linux-amd64 $ sudo mv cheat-linux-amd64 /usr/local/bin/cheat
You may need to change the version number (4.4.0) and the archive (cheat-linux-amd64.gz) while downloading from the releases page.
Next, add the cheat autocompletion feature to enable command-line autocompletion for different shells. To enable autocompletion, simply clone the ‘cheat.bash‘ script and copy the script to the appropriate path in your system.
$ wget https://github.com/cheat/cheat/blob/master/scripts/cheat.bash $ sudo mv cheat.bash /etc/bash_completion.d/
Optionally, you can also enable syntax highlighting, if desired. To activate the syntax highlighting feature, add a CHEATCOLORS environment variable in your ‘.bashrc‘ file.
export CHEATCOLORS=true
The Cheat application default program only serves the basic and most used commands. The content of the cheat sheet resides at location ~/.cheat/ directory.
Manual Cheatsheets can be added to this location to make the application rich.
# cheat -e xyz
This will open xyz cheat sheet if available. If not it will create one and open in the default editor of your system.
How to Use Cheat Command in Linux
A tarball file may be *.gz
*.bz2
or *.zip
or *.xz
. So, what option is to be used to create a tar file in Linux?
$ cheat tar
I never run the dd command, no matter how much sure I am about the command before consulting and cross-checking it at more than one location.
The dd command is a versatile tool used to create byte-level copies of files, disks, partitions, or even entire storage devices. So, it is important to the use command, before running it. Incorrect usage or wrong target devices can lead to data loss or system corruption.
$ cheat dd
To get the command usage and help of uname, ip, ps, and top commands, use:
$ cheat uname $ cheat ip $ cheat top # cheat ps
The cheat -l
command is used to list all available cheat sheets that are accessible through the “cheat” command-line utility. It provides a convenient way to see the cheat sheets that have been installed and are ready to be accessed.
The cheat -s
command is used to list the location of built-in cheat sheets for all the commands.
$ cheat -s cat community: /home/tecmint/.config/cheat/cheatsheets/community personal: /home/tecmint/.config/cheat/cheatsheets/personal
Conclusion
This wonderful project is a life Saviour in many-a-situation, which gives you information that is required, nothing extra, nothing vague, and to the point. This is a must tool for everyone. Easy to build, easy to install, easy to run, and easy to understand, this project seems promising.
This Git project has added a wonderful gag which I am not going to explain but leave to you to interpret.
That’s all for now. I’ll be here again with another interesting article you people will love to read. Till then stay tuned and connected to Tecmint. Don’t forget to provide us with your valuable feedback in the comment section below.
Cheat – The Ultimate Linux Commands Cheat Sheet for Beginners and Administrators
Linux is a powerful and versatile operating system, and it’s the core of many web servers and other computing systems. It’s important for both beginners and experienced administrators to have a good understanding of the Linux command line. To help you out, we’ve put together this cheat sheet of essential Linux commands.
Navigation
- pwd – Print working directory
- cd – Change directory
- ls – List directory contents
- mkdir – Create a new directory
- rmdir – Remove an empty directory
File Management
- cp – Copy files and directories
- mv – Move or rename files and directories
- rm – Remove files and directories
- touch – Create an empty file
- cat – View the contents of a file
System Information
- uname – Print system information
- df – Show disk usage
- free – Show memory usage
- top – Show running processes
- uptime – Show system uptime
User Management
- useradd – Create a new user
- usermod – Modify an existing user
- userdel – Delete a user
- passwd – Change a user’s password
- su – Switch to another user
These are just a few of the most commonly used Linux commands. For a more comprehensive list, check out our Linux Commands Cheat Sheet.