1. Know where you are

pwd
ls -lah
cd /var/log

pwd 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.html

Use 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/syslog

Use 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.sh

Use least privilege. Avoid applying recursive permission changes or broad 777 permissions as a quick fix.

Practice task

  1. Create a directory named devops-lab.
  2. Create notes.txt and add three lines.
  3. Search for one word using grep.
  4. 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 →