Linux Commands for DevOps Professionals
id - Find user and group names and numeric IDs (UID or group ID) of the current or any other user.
Example: id -u root
cd - Change Directory: Navigate to a different directory.
Example: cd /home/user/documents
pwd - Print Working Directory: Display the current directory's full path.
Example: pwd
mkdir - Make Directory: Create a new directory.
Example: mkdir new_folder
rm - Remove: Delete files or directories.
Example: rm file.txt
cp - Copy files or directories.
Example: cp file.txt /backup
mv - Move files or directories.
Example: mv file.txt /new_location
touch - Create an empty file.
Example: touch new_file.txt
cat - Concatenate and display file content.
Example: cat file.txt
nano - Text editor: Open a text file for editing.
Example: nano file.txt
grep - Search for text patterns in files.
Example: grep "pattern" file.txt
find - Search for files and directories.
Example: find /path/to/search -name "file_name"
chmod - Change file permissions.
Example: chmod 755 file.sh
chown - Change file or directory ownership.
Example: chown user:group file.txt
ps - Display running processes.
Example: ps aux
top - Monitor system processes in real-time.
Example: top
kill - Terminate processes by ID. Use
pkill
to terminate by name.
Example: kill PID
wget - Download files from the internet.
Example: wget https://example.com/file.zip
less - View file content one screen at a time.
Example: less test.log
tar - Archive and extract files.
Example: tar -czvf archive.tar.gz folder
ssh - Securely connect to a remote server.
Example: ssh user@remote_host
scp - Securely copy files between local and remote systems.
Example: scp file.txt user@remote_host:/path
rsync - Synchronize files and directories between systems.
Example: rsync -avz local_folder/ user@remote_host:remote_folder/
df - Display disk space usage.
Example: df -h
du - Show the size of files and directories.
Example: du -sh /path/to/directory
ifconfig - Network configuration (deprecated, use
ip
).
Example: ifconfig
ip - Manage IP addresses and network settings.
Example: ip addr show
netstat - Display network connections (deprecated, use
ss
).
Example: netstat -tuln
systemctl - Manage system services.
Example: systemctl start service_name
journalctl - View system logs.
Example: journalctl -u service_name
free - Display the total amount of free space.
Example: free -m
at - Run commands at a specified time.
Example: echo "command" | at 15:30
ping - Check network connectivity to a host.
Example: ping google.com
traceroute - Trace the route packets take to reach a host.
Example: traceroute google.com
curl - Check website connectivity.
Example: curl -Is https://example.com | head -n 1
dig - Retrieve DNS information for a domain.
Example: dig example.com
hostname - Display or set the system's hostname.
Example: hostname
who - Display currently logged-in users.
Example: who
useradd - Create a new user account.
Example: useradd newuser
usermod - Modify user account properties.
Example: usermod -aG groupname username
passwd - Change user password.
Example: passwd username
sudo - Execute commands as the superuser.
Example: sudo command
lsof - List open files and processes using them.
Example: lsof -i :port
nc - Networking utility to read and write data.
Example: echo "Hello" | nc host port
sed - Text manipulation using regex.
Example: sed 's/old/new/g' file.txt
awk - Pattern scanning and text processing.
Example: awk '{print $2}' file.txt
cut - Extract specific columns from text.
Example: cut -d"," -f2 file.csv
sort - Sort lines of text files.
Example: sort file.txt
diff - Compare files line by line.
Example: diff file1.txt file2.txt
Profile: https://linktr.ee/DevOps_Descent
Top comments (2)
Thank you
Happy to help 😊