Voiced by Amazon Polly |
Linux is a powerful and versatile operating system that powers everything from servers to smartphones. If you’re a student new to Linux, understanding basic commands is the first step toward becoming proficient in using this OS. In this blog, we’ll explore 50 essential Linux commands with simple explanations and examples to help you get started.
1. pwd
Print Working Directory: Displays the current directory.
1 2 3 |
$ pwd /home/student |
2. ls
List Directory Contents: Shows files and folders in a directory.
1 |
$ ls |
Documents Downloads Pictures
3. cd
Change Directory: Navigate between directories.
1 |
$ cd Downloads |
4. mkdir
Make Directory: Creates a new folder.
1 |
$ mkdir projects |
5. rmdir
Remove Directory: Deletes an empty folder.
1 |
$ rmdir projects |
6. touch
Create File: Creates an empty file.
1 |
$ touch file.txt |
7. rm
Remove File/Folder: Deletes files or directories.
1 2 3 |
$ rm file.txt $ rm -r folder_name |
8. cp
Copy Files/Directories: Copies files or directories.
1 2 3 |
$ cp file1.txt file2.txt $ cp -r dir1 dir2 |
9. mv
Move/Rename: Moves or renames files and folders.
1 2 3 |
$ mv file.txt new_name.txt $ mv file.txt /home/student/Documents |
10. cat
Concatenate and View Files: Displays file content.
1 |
$ cat file.txt Hello, Linux! |
11. nano
Edit Files: Opens a text file in the nano editor.
1 |
$ nano file.txt |
12. vi
Edit Files: Opens a text file in the vi editor.
1 |
$ vi file.txt |
13. echo
Display Text: Prints text or writes to a file.
1 2 3 |
$ echo "Hello, World!" $ echo "This is a test" > test.txt |
14. clear
Clear Terminal: Clears the terminal screen.
1 |
$ clear |
15. history
Command History: Shows a list of recently executed commands.
1 |
$ history |
16. find
Search for Files: Locates files in the system.
1 |
$ find /home -name file.txt |
17. grep
Search in Files: Searches for patterns in files.
1 |
$ grep "Linux" file.txt |
18. chmod
Change Permissions: Modifies file permissions.
1 |
$ chmod 755 file.txt |
19. chown
Change Ownership: Changes file ownership.
1 |
$ chown user:group file.txt |
20. man
Manual Pages: Displays command documentation.
1 |
$ man ls |
21. uname
System Information: Displays system details.
1 |
$ uname -a |
22. df
Disk Usage: Shows available and used disk space.
1 |
$ df -h |
23. du
Directory Usage: Displays the size of a directory.
1 |
$ du -sh folder_name |
24. top
Process Monitoring: Displays running processes.
1 |
$ top |
25. ps
Process Status: Lists active processes.
1 |
$ ps |
26. kill
Terminate Process: Stops a running process.
1 |
$ kill 1234 |
27. ping
Network Test: Checks connectivity to a host.
1 |
$ ping google.com |
28. curl
HTTP Requests: Fetches data from URLs.
1 |
$ curl https://example.com |
29. wget
Download Files: Downloads files from the internet.
1 |
$ wget https://example.com/file.zip |
30. zip
Compress Files: Creates a ZIP archive.
1 |
$ zip archive.zip file1.txt file2.txt |
31. unzip
Extract Files: Extracts a ZIP archive.
1 |
$ unzip archive.zip |
32. tar
Archive Files: Archives and extracts files.
1 2 3 |
$ tar -cvf archive.tar folder $ tar -xvf archive.tar |
33. df
Check Disk Space: Displays disk usage information.
1 |
$ df -h |
34. free
Check Memory: Shows RAM and swap usage.
1 |
$ free -h |
35. hostname
Display Hostname: Shows the system’s hostname.
1 |
$ hostname |
36. ifconfig
Network Configuration: Displays network settings.
1 |
$ ifconfig |
37. ssh
Secure Shell: Connects to a remote machine.
1 |
$ ssh <a href="mailto:user@192.168.1.1">user@192.168.1.1</a> |
38. scp
Secure Copy: Transfers files between machines.
1 |
$ scp file.txt user@192.168.1.1:/home/user |
39. passwd
Change Password: Updates the user password.
1 |
$ passwd |
40. whoami
Current User: Displays the current username.
1 |
$ whoami |
41. uptime
System Uptime: Shows how long the system has been running.
1 |
$ uptime |
42. shutdown
Power Off: Schedules a system shutdown.
1 |
$ shutdown -h now |
43. reboot
Restart System: Reboots the system.
1 |
$ reboot |
44. alias
Shortcut Commands: Creates a custom command alias.
1 |
$ alias ll='ls -la' |
45. unalias
Remove Alias: Deletes a custom alias.
1 |
$ unalias ll |
46. wc
Word Count: Counts words, lines, and characters in a file.
1 |
$ wc file.txt |
47. head
View File Start: Displays the first lines of a file.
1 |
$ head file.txt |
48. tail
View File End: Displays the last lines of a file.
1 |
$ tail file.txt |
49. sort
Sort Lines: Arranges lines in a file.
1 |
$ sort file.txt |
50. uniq
Remove Duplicates: Filters unique lines in a file.
1 |
$ uniq file.txt |
Customized Cloud Solutions to Drive your Business Success
- Cloud Migration
- Devops
- AIML & IoT
Conclusion
By mastering these 50 Linux commands, can gain a strong foundation in Linux administration and usage. Practice regularly, Linux is a vast and powerful tool, and this list is just the beginning of your journey!
Get your new hires billable within 1-60 days. Experience our Capability Development Framework today.
- Cloud Training
- Customized Training
- Experiential Learning
About CloudThat
CloudThat is a leading provider of Cloud Training and Consulting services with a global presence in India, the USA, Asia, Europe, and Africa. Specializing in AWS, Microsoft Azure, GCP, VMware, Databricks, and more, the company serves mid-market and enterprise clients, offering comprehensive expertise in Cloud Migration, Data Platforms, DevOps, IoT, AI/ML, and more.
CloudThat is the first Indian Company to win the prestigious Microsoft Partner 2024 Award and is recognized as a top-tier partner with AWS and Microsoft, including the prestigious ‘Think Big’ partner award from AWS and the Microsoft Superstars FY 2023 award in Asia & India. Having trained 650k+ professionals in 500+ cloud certifications and completed 300+ consulting projects globally, CloudThat is an official AWS Advanced Consulting Partner, Microsoft Gold Partner, AWS Training Partner, AWS Migration Partner, AWS Data and Analytics Partner, AWS DevOps Competency Partner, AWS GenAI Competency Partner, Amazon QuickSight Service Delivery Partner, Amazon EKS Service Delivery Partner, AWS Microsoft Workload Partners, Amazon EC2 Service Delivery Partner, Amazon ECS Service Delivery Partner, AWS Glue Service Delivery Partner, Amazon Redshift Service Delivery Partner, AWS Control Tower Service Delivery Partner, AWS WAF Service Delivery Partner and many more.
To get started, go through our Consultancy page and Managed Services Package, CloudThat’s offerings.
WRITTEN BY Martuj Nadaf
Click to Comment