30 Essential Linux Commands with Output and Detailed Explanation for Beginners
Learning Linux can be a game-changer for your tech journey. At DataxSchool Learning, we’ve simplified 30 of the most essential Linux commands, complete with sample outputs and beginner-friendly explanations — all without code blocks, making this guide easy to read and understand.
1. pwd – Shows your current directory
Example Output:
/home/student
Explanation:
Prints the absolute path of the current working directory.
2. ls – Lists files and folders
Example Output:
Documents Downloads Music Pictures
Explanation:
Displays contents of the directory you’re in.
3. cd – Changes the current directory
Usage Example:
cd Downloads
Explanation:
Moves into the Downloads directory.
4. mkdir – Creates a new folder
Usage Example:
mkdir new_folder
Explanation:
Creates a directory named "new_folder".
5. rmdir – Removes an empty folder
Usage Example:
rmdir old_folder
Explanation:
Deletes the folder only if it’s empty.
6. touch – Creates a new file
Usage Example:
touch notes.txt
Explanation:
Creates a blank text file named notes.txt.
7. cp – Copies files or folders
Usage Example:
cp notes.txt copy.txt
Explanation:
Copies a file from one name/location to another.
8. mv – Moves or renames files/folders
Usage Example:
mv file.txt folder/
Explanation:
Moves the file to the folder or renames it.
9. rm – Removes files or folders
Usage Example:
rm old.txt
Explanation:
Deletes the specified file permanently.
10. cat – Views file content
Example Output:
This is a test file.
Explanation:
Displays file contents directly in the terminal.
11. nano – Opens text editor
Usage Example:
nano notes.txt
Explanation:
Opens the file in a simple text editor inside the terminal.
12. vim – Opens advanced text editor
Usage Example:
vim notes.txt
Explanation:
A more powerful editor for advanced users.
13. echo – Prints text
Example Output:
Hello DataxSchool
Explanation:
Useful for printing strings or variables.
14. clear – Clears the terminal screen
Explanation:
Wipes the terminal display for a clean workspace.
15. man – Shows manual/help for commands
Usage Example:
man ls
Explanation:
Opens help documentation for any command.
16. df – Shows disk usage
Example Output:
/dev/sda1 50G 20G 30G 40% /
Explanation:
Displays disk space usage of file systems.
17. du – Shows size of directory
Example Output:
4.0M Documents/
Explanation:
Reports file and directory size.
18. top – Real-time process monitor
Explanation:
Live view of processes, CPU, and memory usage.
19. ps – Shows running processes
Usage Example:
ps aux
Explanation:
Lists all active processes with details.
20. kill – Ends a process
Usage Example:
kill 1234
Explanation:
Terminates the process with ID 1234.
21. uname – Displays system info
Example Output:
Linux dataxschool-PC 5.4.0-80-generic ...
Explanation:
Shows kernel name, version, and system info.
22. history – Lists command history
Usage Example:
history
Explanation:
Displays all previously entered commands.
23. chmod – Changes file permissions
Usage Example:
chmod 755 script.sh
Explanation:
Grants permissions to users and groups.
24. chown – Changes file ownership
Usage Example:
chown user:user file.txt
Explanation:
Changes file's owner and group.
25. ping – Tests network connectivity
Example Output:
64 bytes from google.com: time=10 ms
Explanation:
Sends packets to a server and measures response time.
26. wget – Downloads files from the internet
Usage Example:
wget http://example.com/file.zip
Explanation:
Retrieves files from a URL.
27. curl – Transfers data from URLs
Usage Example:
curl http://example.com
Explanation:
Displays the raw HTML or data from a web server.
28. tar – Archives/compresses files
Usage Example:
tar -cvf backup.tar folder/
Explanation:
Bundles files into an archive.
29. locate – Quickly finds files
Example Output:
/home/user/file.txt
Explanation:
Instantly searches the file index for matches.
30. grep – Searches within files
Example Output:
[ERROR] Database connection failed
Explanation:
Finds lines containing specific keywords.
Final Words from DataxSchool Learning
These 30 commands are foundational tools for any Linux user, especially beginners. Mastering them will give you a strong start in navigating the Linux environment with confidence and efficiency.
Want more in-depth Linux tutorials and real-world projects? Follow DataxSchool Learning for weekly updates.