MC, 2025
Ilustracja do artykułu: Top 20 Must-Know Linux Commands for Absolute Beginners

Top 20 Must-Know Linux Commands for Absolute Beginners

Linux is a powerful operating system, widely used by professionals and enthusiasts alike. Whether you are a beginner or just looking to polish your skills, understanding some essential Linux commands is key to navigating the terminal effectively. In this article, we will explore the top 20 must-know Linux commands for absolute beginners. These commands will help you get started with Linux and give you the confidence to use the terminal for everyday tasks!

1. pwd - Print Working Directory

The pwd command stands for "Print Working Directory." It is used to display the current directory you are working in. When you open the terminal, you are in a directory, and sometimes, it's helpful to confirm where you are.

pwd

Example output:

/home/user

This tells you that you are in the "/home/user" directory. It's a simple but crucial command when navigating through Linux directories!

2. ls - List Directory Contents

The ls command is one of the most used commands in Linux. It lists all the files and directories in your current directory. It’s a quick way to check what’s inside a folder.

ls

Example output:

Documents  Pictures  Music  Videos

To list all files, including hidden ones, you can use the -a flag with the ls command:

ls -a

3. cd - Change Directory

The cd command is used to change the current directory. If you want to navigate from one folder to another, this is the command to use.

cd Documents

This will take you to the "Documents" folder. You can use cd .. to move up one directory level.

4. mkdir - Make Directory

If you want to create a new directory, the mkdir command comes in handy. For example, if you want to create a folder called "NewFolder" in the current directory, you would type:

mkdir NewFolder

5. rmdir - Remove Directory

The rmdir command is used to delete empty directories. If the directory is not empty, you will need to use rm -r (explained later).

rmdir OldFolder

6. rm - Remove Files or Directories

Use the rm command to remove files. Be careful when using this command because it permanently deletes the files without moving them to a trash bin.

rm file.txt

To remove directories and their contents, use the -r flag:

rm -r folder_name

7. cp - Copy Files and Directories

The cp command is used to copy files and directories. For example, to copy a file from one location to another:

cp file.txt /home/user/Documents/

If you want to copy an entire directory, use the -r flag:

cp -r folder1 /home/user/Documents/

8. mv - Move or Rename Files and Directories

The mv command allows you to move files and directories from one place to another. It is also used for renaming files.

mv file.txt /home/user/Downloads/

To rename a file, you can use:

mv old_name.txt new_name.txt

9. cat - Concatenate and Display File Content

The cat command is used to display the contents of a file. It’s useful for quickly viewing smaller files directly in the terminal.

cat file.txt

10. nano - Text Editor

nano is a simple command-line text editor. It allows you to create and edit text files directly in the terminal.

nano myfile.txt

Once inside the editor, you can type and edit text. To save your work, press CTRL + O, and to exit, press CTRL + X.

11. grep - Search for Text in Files

The grep command is powerful for searching for specific text patterns in files. For example, to find all lines in a file containing the word "hello":

grep "hello" myfile.txt

12. find - Search for Files and Directories

Use the find command to search for files and directories based on name, size, type, and other criteria.

find /home/user -name "file.txt"

This will search for "file.txt" in the "/home/user" directory.

13. chmod - Change File Permissions

The chmod command is used to change the permissions of a file or directory. For example, to make a file executable, you can use:

chmod +x script.sh

14. chown - Change File Ownership

Use chown to change the ownership of a file or directory. This is useful when managing permissions for users and groups.

chown user:group file.txt

15. ps - View Running Processes

The ps command shows the currently running processes on your system. You can use it with the -aux option to view detailed information about all processes:

ps aux

16. top - System Resource Usage

The top command shows a dynamic real-time view of the system’s processes and resource usage, including CPU and memory utilization.

top

17. df - Disk Space Usage

The df command displays the disk space usage of the mounted filesystems. It’s helpful to check how much space is available on your system.

df -h

18. du - Disk Usage of Files and Directories

Use the du command to check the disk usage of files and directories. For example:

du -sh Documents

This will display the total size of the "Documents" directory.

19. wget - Download Files from the Internet

The wget command is used to download files from the internet. For example, to download a file:

wget https://example.com/file.zip

20. man - Access Manual Pages

The man command is used to access the manual pages for other commands. It’s a great resource for finding detailed information about any command.

man ls

This will open the manual for the ls command, where you can find detailed options and examples.

Conclusion

These top 20 Linux commands for absolute beginners will help you become more comfortable and efficient in navigating the Linux command line. As you continue to explore Linux, you will come across even more advanced commands, but mastering these basics is the first step toward becoming a Linux pro!

Remember, the key to becoming proficient with Linux is practice. Don’t hesitate to experiment with these commands in your terminal, and you’ll soon find that using Linux is both fun and rewarding!

Komentarze (0) - Nikt jeszcze nie komentował - bądź pierwszy!

Imię:
Treść: