DevOps Rich DevOps content for Infrastructure Engineers

Linux - Ubuntu Server Essential Commands

Basic Git Operations

Git Commands

echo "This is testfile1" > testfile1.txt
echo "This is testfile2" > testfile2.txt
git add .
git status
echo "Line2" >> testfile1.txt
cat testfile1.txt
git diff testfile1.txt
git add testfile1.txt
git status
git commit -m "Initial commit"
git status

Note: You may sign off a git commit using git commit -m "Initial commit" -s.

git checkout -b main
git branch
git branch -d master
git branch
git checkout master
git branch -m master main
git push -u origin main
git symbolic-ref refs/remotes/origin/HEAD refs/remotes/origin/main
git branch -a

Note: You could simply create a new main branch and then ignore the master branch.

Create, configure, and troubleshoot services

Monitor and troubleshoot system performance and services

System Monitoring

CommandDescription
journalctl -u sshQuery the systemd journal for a service.
tail -f /var/log/syslogSome daemons may not have their own log file and may place logs in syslog.
dmesgUseful to see hardware issues logged at the kernel level.

Process Monitoring

CommandDescription
htopInteractive process viewer with mouse support.
pstreeDisplay a tree of processes and highlights targeted PID.
ps -elfReport a snapshot of the current processes.
uptimeTell how long the system has been running.

Memory Monitoring

CommandDescription
free -hDisplay amount of free and used memory in the system.
vmstatReport virtual memory statistics.

Determine application and service specific constraints

Troubleshoot diskspace issues

Work with SSL certificates