0% found this document useful (0 votes)
21 views2 pages

DevOps Linux Commands CheatSheet

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
21 views2 pages

DevOps Linux Commands CheatSheet

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Essential Linux Commands for DevOps

File & Directory Management

ls - List directory contents


cd <dir> - Change directory
mkdir <dir> - Create directory
rm <file> - Delete file
rm -r <dir> - Delete directory recursively
cp <src> <dest> - Copy file or directory
mv <src> <dest> - Move or rename file
touch <file> - Create empty file
cat <file> - View file content
tail -f <file> - View real-time logs
nano / vim - Edit files in terminal

User & Group Management

sudo useradd <user> - Add new user


sudo passwd <user> - Set/change password
sudo groupadd <group> - Add new group
sudo usermod -aG <group> <user> - Add user to group
groups <user> - View user's groups
id <user> - View user and group IDs
sudo chown <user>:<group> <file> - Change file owner/group
sudo chgrp <group> <file> - Change group ownership
sudo deluser <user> - Delete user
sudo delgroup <group> - Delete group

Package & Service Management

sudo apt update - Update package list (Debian)


sudo yum update - Update package list (RHEL)
sudo apt install <pkg> - Install package
sudo systemctl start <service> - Start service
sudo systemctl stop <service> - Stop service
sudo systemctl status <service> - Check service status
sudo systemctl enable <service> - Enable service at boot

Permissions & Security


Essential Linux Commands for DevOps

chmod <perm> <file> - Change file permissions


chown <user>:<group> <file> - Change owner/group
chgrp <group> <file> - Change group only
sudo - Run command as superuser

Networking

ip a / ifconfig - Show IP configuration


ping <host> - Test network connectivity
netstat -tuln - Show listening ports
ss -tuln - Check sockets
curl <url> - Make HTTP request
wget <url> - Download file from web
scp <src> <user>@<host>:<dest> - Secure copy over SSH
ssh <user>@<host> - Connect to remote server

System Monitoring & Process Control

top / htop - Monitor system resources


ps aux - Show running processes
kill <PID> - Kill process
kill -9 <PID> - Force kill process
df -h - Show disk usage
du -sh <dir> - Size of directory
uptime - Show system uptime
free -h - Show memory usage

DevOps-Specific Tools

docker ps - List running containers


docker images - List docker images
kubectl get pods - List Kubernetes pods
ansible-playbook <file.yml> - Run Ansible playbook
terraform apply - Apply Terraform changes
jenkins-cli - Interact with Jenkins from CLI
git - Version control tool
git clone - Clone repository
git push - Push code to repo

You might also like