Linux is a powerful and widely used operating system, especially among developers, system administrators, and tech enthusiasts. Whether you’re just starting with Linux or looking to refresh your skills, mastering basic commands is crucial. These commands help you navigate the system, manage files, and execute essential tasks efficiently.
In this guide, we’ll explore 25 fundamental Linux commands that every beginner should know in 2025.
1. pwd
– Print Working Directory
This command displays the current directory you’re working in.
$ pwd
/home/user
2. ls
– List Directory Contents
Use ls
to see files and directories in your current location.
$ ls
Documents Downloads Pictures Videos
3. cd
– Change Directory
Navigate between directories using cd
.
$ cd Documents
$ cd .. # Go back to the previous directory
4. mkdir
– Create a New Directory
Make a new folder using mkdir
.
$ mkdir my_folder
5. rmdir
– Remove Empty Directory
Delete an empty directory with this command.
$ rmdir my_folder
6. rm
– Remove Files or Directories
Delete files or folders using rm
. Be careful, as this action is permanent.
$ rm file.txt
$ rm -r folder_name
7. cp
– Copy Files and Directories
Duplicate files or directories using cp
.
$ cp file1.txt file2.txt
$ cp -r folder1/ folder2/
8. mv
– Move or Rename Files
Move or rename files using mv
.
$ mv oldname.txt newname.txt
$ mv file.txt /destination/folder/
9. touch
– Create an Empty File
Generate a new, empty file.
$ touch newfile.txt
10. cat
– View File Contents
Display the contents of a file.
$ cat file.txt
11. head
– View the First Few Lines of a File
By default, head
shows the first 10 lines.
$ head file.txt
12. tail
– View the Last Few Lines of a File
Similar to head
, but shows the last 10 lines.
$ tail file.txt
13. echo
– Display Text in the Terminal
Useful for scripting and outputting messages.
$ echo "Hello, Linux!"
14. man
– Get Help for Commands
Access the manual pages for Linux commands.
$ man ls
15. grep
– Search for Text in Files
Find specific words or patterns within files.
$ grep "keyword" file.txt
16. find
– Search for Files and Directories
Locate files by name or other attributes.
$ find /home/user -name "file.txt"
17. chmod
– Change File Permissions
Modify read, write, and execute permissions.
$ chmod 755 script.sh
18. chown
– Change File Ownership
Assign new ownership to a file or folder.
$ chown user:group file.txt
19. ps
– View Running Processes
See a list of active system processes.
$ ps aux
20. kill
– Terminate a Process
Stop a running process using its process ID (PID).
$ kill 1234
21. df
– Check Disk Space Usage
View available and used disk space.
$ df -h
22. du
– Check Directory Size
See how much space a directory consumes.
$ du -sh /home/user/Documents
23. top
– Monitor System Resources
Display real-time CPU and memory usage.
$ top
24. history
– View Command History
See a list of previously used commands.
$ history
25. exit
– Close the Terminal Session
Log out or close the terminal.
$ exit
Conclusion
These 25 Linux commands form the foundation for working efficiently in a Linux environment. By mastering them, you can navigate the system, manage files, monitor performance, and troubleshoot issues with ease. Keep practicing, and soon you’ll be comfortable using Linux like a pro!