25 Essential Linux Commands for Beginner Cloud and DevOps Engineers
Table of contents
- 1. pwd - Print Working Directory
- 2. ls - List Directory Contents
- 3. cd - Change Directory
- 4. cp - Copy Files and Directories
- 5. mv - Move or Rename Files and Directories
- 6. rm - Remove Files and Directories
- 7. mkdir - Make Directories
- 8. rmdir - Remove Empty Directories
- 9. touch - Create Empty Files
- 10. cat - Concatenate and Display File Content
- 11. less - View File Content Page-by-Page
- 12. head - View the Beginning of a File
- 13. tail - View the End of a File
- 14. grep - Search Inside Files
- 15. find - Search for Files and Directories
- 16. chmod - Change File Permissions
- 17. chown - Change File Ownership
- 18. df - Disk Space Usage
- 19. du - Disk Usage of Files and Directories
- 20. top - Monitor System Performance
- 21. htop - Enhanced System Monitor
- 22. ps - Display Process Information
- 23. kill - Terminate Processes
- 24. systemctl - Manage System Services
- 25. curl - Transfer Data from or to a Server
- Conclusion
Saturday, 7th September 2024
For cloud and DevOps engineers, or Linux administrators, mastering essential Linux commands is crucial for managing systems efficiently. While the basics are important, understanding intermediate-level commands can significantly enhance your productivity and effectiveness. This blog covers 25 key Linux commands that are particularly useful for beginner-level cloud and DevOps engineers, or Linux administrators.
1. pwd
- Print Working Directory
Displays the path of your current directory.
Example:
pwd
2. ls
- List Directory Contents
Lists files and directories. Use -l
for detailed information and -a
for hidden files.
Examples:
ls -l
ls -la
3. cd
- Change Directory
Navigates to different directories.
Example:
cd /path/to/directory
4. cp
- Copy Files and Directories
Copies files or directories.
Example:
cp file1.txt /path/to/destination/
5. mv
- Move or Rename Files and Directories
Moves or renames files and directories.
Examples:
mv file1.txt /path/to/destination/
mv oldname.txt newname.txt
6. rm
- Remove Files and Directories
Deletes files and directories. Use -r
for recursive deletion.
Examples:
rm file1.txt
rm -r directory/
7. mkdir
- Make Directories
Creates new directories.
Example:
mkdir newdirectory
8. rmdir
- Remove Empty Directories
Deletes empty directories.
Example:
rmdir emptydirectory
9. touch
- Create Empty Files
Creates empty files or updates timestamps.
Example:
touch newfile.txt
10. cat
- Concatenate and Display File Content
Displays the content of files.
Example:
cat file1.txt
11. less
- View File Content Page-by-Page
Views file content one page at a time, allowing for easier navigation.
Example:
less file1.txt
12. head
- View the Beginning of a File
Displays the first few lines of a file.
Example:
head file1.txt
13. tail
- View the End of a File
Displays the last few lines of a file.
Example:
tail file1.txt
14. grep
- Search Inside Files
Searches for specific text within files.
Example:
grep "search_term" file1.txt
15. find
- Search for Files and Directories
Finds files and directories based on criteria.
Example:
find /path/to/search -name "filename.txt"
16. chmod
- Change File Permissions
Modifies file and directory permissions.
Example:
chmod 755 script.sh
17. chown
- Change File Ownership
Changes the owner and group of files and directories.
Example:
chown user:group file1.txt
18. df
- Disk Space Usage
Shows disk space usage of file systems.
Example:
df -h
19. du
- Disk Usage of Files and Directories
Displays disk usage of files and directories.
Example:
du -sh /path/to/directory
20. top
- Monitor System Performance
Displays real-time system performance, including CPU and memory usage.
Example:
top
21. htop
- Enhanced System Monitor
An enhanced version of top
with a more user-friendly interface.
Example:
htop
22. ps
- Display Process Information
Shows information about running processes.
Example:
ps aux
23. kill
- Terminate Processes
Kills processes by their process ID (PID).
Example:
kill 1234
24. systemctl
- Manage System Services
Controls systemd services.
Examples:
ystemctl status nginx
systemctl start nginx
systemctl stop nginx
25. curl
- Transfer Data from or to a Server
Transfers data to or from a server, useful for interacting with APIs.
Example:
curl -I http://example.com
Conclusion
Mastering these essential Linux commands is a foundational skill for beginner cloud and DevOps engineers and Linux administrators. These commands help you manage systems, troubleshoot issues, and automate tasks effectively. As you become more comfortable with these commands, you'll find your ability to handle complex environments and scenarios improving significantly.
Happy exploring and coding!
Subscribe to my newsletter
Read articles from Prabhat Chouhan directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by
Prabhat Chouhan
Prabhat Chouhan
I’m a Cloud/DevOps enthusiast currently learning how to build and manage reliable, scalable solutions. I’m excited about exploring modern technologies and best practices to streamline development and deployment processes. My aim is to gain hands-on experience and contribute to creating robust systems that support growth and success in the tech world.