25 Basic Linux Commands You Must Learn
25 Basic Linux Commands You Must Learn
Hello friends! This time we will provide information about some basic linux commands, you will almost always need those commands, because Linux based Operating Systems are very powerful but the real power lies in the command line. There's a lot you can do with the help of commands but not the other way around (using the GUI).
So that's why you better remember Linux commands, because it can make it easier for you to use this Linux-based operating system. Actually there are so many Linux commands, but don't worry, we will share 25 basic Linux commands that you should learn. Okay, let's get straight to the discussion Cekidot!
25 Basic Linux Commands
1. pwd – View Active Directory
This command prints the location of your current working directory. It's important to know where you actually are before going to a parent or sub directory.
2. ls – View the List of Directory Lists
ls is one of the most used basic linux commands, it is used to print the contents of a directory, by default it lists the contents of the current working directory ( pwd ).
3. cd – Change Directory Location
The cd command is used to change directory locations. There are three shortcuts, if you need to move one directory up, use cd .. ,and go directly to your Home folder use the cd command, and use cd -to go back to your last working directory. Example assume you are in Home directory, you have to go to /usr/local/share/fonts directory, use command cd /usr/local/share/fonts
4. cat – View the contents of the file
This is used to print the contents of a file to the screen ( stdout to be precise), very useful when you want to quickly view the contents of a file. For example, use cat a_text_file to get the contents of that file on your screen.
5. cp – Copy Files
cp command, you can copy files and directories with this command. Typical usage is something like cp file_a file_a_copy or cp directory_a dir_a_copy Also don't forget to use the correct location when you copy files to a different location.
6. mv – Move Folder
The mv command is used to move or rename directories and files. Example to rename using mv file old_file new_file
7. rm – Delete Files/Directories
The rm command is used to remove directories or files. Like using rm -r /tmp/backup to delete all those folders. Make sure you guys have to be careful before deleting anything.
8. mkdir & rmdir – Create/Delete Folders
The mkdir command is used to create a new directory on Linux. For example, like mkdir new_directory to create a new directory called new_directory. While rmdir is used to delete a directory. Examples like rmdir directory_baru
10. touch – Create File
This is the mkdir equivalent command for files. you can create an empty file with the touch command. For example, touch ~/Public/index.html to create an empty index.html file under the Public directory.
11. sudo – Make Super User
sudo , it's an important but potentially dangerous command. Whenever you get Permission denied or Authorization failed you can use sudo to get you permission denied.
12. chmod – Change File/Directory Permissions
This is also a very important command, used to change file and directory permissions. Since the chmod command is a very long topic, I will explain it briefly here.
There are basically three types of permissions, read, write, and execute. Each is denoted by a number.
* 4 for read permission
* 2 for write permissions
*1 for execute permission
So, if you need to set universal read/write permissions to files, you can use chmod 666 my_file_name
chmod 666 file_name
Presuming you need to create an executable script, you can use
chmod + x script_name
13. locate – Find Files
Basic commands for finding files and directories in Linux. As this is a database driven command so for the first time you need to build the database, run sudo updatedb and wait a few minutes. Examples like locate -i * file_name * -i option to ignore case.
14. df – Check Disk Usage
The df command is used to display device name information, total blocks, total disk space, used disk space, available disk space, and mount points on the file system.
15. du – Displays File Size
The du command might help you to find out the size of files and directories in Linux and display their sizes recursively.
16. clear – Clears the Terminal
Clearing the terminal window. So the contents of the terminal window will be empty, this command makes it easier for you to delete commands that have been used previously in your Linux terminal.
17. ifconfig – View IP
If you on Windows use the ipconfig command to see the IP, even on Linux you can see the IP that is currently connected and what network devices are available using the ifconfig command.
18. poweroff – Turn off the Operating System
The poweroff command is the same as executing the shutdown command in Windows. But this command is specifically for turning off the Linux operating system.
19. reboot – Restart the Operating System
Almost the same as the poweroff command but the difference is that the reboot command is used to run the restart command
20. echo – Displays Posts
If you want to display text on the screen (terminal) or write a word or sentence into a file, you can use the echo command for this problem.
21. who – Displays Users
This basic Linux command is used to display the user you are currently using.
22. wc – To Display New Lines
The wc command is used to display newlines, words, and bytes in a file.
23. nano & vi – Text Editor
Nano & Vi are text editors that are installed in the basic Linux commands. nano is a text editor that can output various keywords and is recognized in various languages. Vi is arguably a simpler version of nano. With this command, you can create a new file or edit files using the editor.
24. top – View Processes in Order
The top command is used to view all running processes, sorted from the largest process. Its function is almost the same as the system monitor.
25. man & -help – Linux Help
Use these two basic Linux commands to see more about Linux commands and how to use them. Command man is the command manual page. For example, if you enter man rm they will give you the rm command manual page. Meanwhile, if you want to see how they are used, you can use the cd -help command
That's all for the article 25 Basic Linux Commands That Must Be Learned. Look forward to other interesting articles and don't forget to share this article with your friends. Thank you…
Just an ordinary person who wants to share a little knowledge, hopefully the knowledge I provide can be useful for all of us. Keep in mind! Useful knowledge is an investment in the afterlife.