1. Know where you are
pwd
ls -lah
cd /var/logpwd prints the current working directory. ls -lah lists files, including hidden files, with human-readable sizes. cd changes directories.
2. Create and manage files
mkdir app
touch app/index.html
cp app/index.html app/index.backup.html
mv app/index.backup.html app/backup.htmlUse mkdir for directories, touch to create an empty file, cp to copy and mv to move or rename.
3. Search and inspect
grep -i "error" /var/log/syslog
find /var/log -name "*.log"
tail -f /var/log/syslogUse grep to search text, find to locate files and tail -f to follow a log as it changes.
4. Check processes and services
ps aux
systemctl status nginx
journalctl -u nginx --since "1 hour ago"These commands help inspect running processes, service state and service logs. Your distribution may use different service names.
5. Understand permissions
ls -l
chmod 644 index.html
chmod 755 deploy.sh
sudo chown appuser:appuser deploy.shUse least privilege. Avoid applying recursive permission changes or broad 777 permissions as a quick fix.
Practice task
- Create a directory named
devops-lab. - Create
notes.txtand add three lines. - Search for one word using
grep. - Display the last two lines with
tail.
Continue learning
Explore more practical DevOps and cloud tutorials in the Devops Init learning hub.
Back to learning hub →