Linux and the Command Line
Navigate files, manage processes, read logs and connect to servers over SSH from a Unix shell.
Beginner · about 10 hours · difficulty 2/5
Almost every server you deploy to runs Linux, and most backend tooling assumes a Unix shell. You do not need to be a sysadmin, but you should feel at home in a terminal.
Core skills
- Navigation and files:
cd,ls -la,cp,mv,rm,mkdir -p,find. - Reading and searching:
cat,less,head,tail -f(follow a log live),grep -r. - Pipes and redirection: chain small tools with
|, send output to files with>and>>. For examplegrep ERROR app.log | wc -l. - Permissions: users, groups and the
rwxbits;chmodandchown. Many "it works locally" bugs are permission bugs. - Processes:
ps,toporhtop,kill, and how services are run by systemd (systemctl status myapp,journalctl -u myapp). - Networking:
sshwith key pairs,scp,curl,ss -tlnpto see which ports are listening.
Why it matters
Production incidents are debugged in a shell: tailing logs, checking disk space with df -h, checking memory with free -m, finding which process holds a port. The faster you are here, the calmer you are under pressure.
Pitfalls
- Running everything as root. Create a normal user and use
sudowhen needed. - Using password SSH logins on a public server. Use keys and disable password auth.
You are ready to move on when you can SSH into a fresh server, create a user, install a package, run your app as a service and read its logs without searching for every command.
Key concepts
- Filesystem navigation
- Pipes, redirection and grep
- Permissions and users
- Processes and signals
- systemd and journalctl
- SSH keys and remote access
- Package managers (apt, dnf)
- Shell scripting basics
- Terminal editors (vim or nano)
Mini project
Write a bash script that checks disk usage, memory and whether your app's port is listening, and prints a one-line health summary. Schedule it with cron.
Check yourself
A process is holding port 3000 and your app will not start. Which commands do you use to find and stop it?
Free resources
- LinuxCommand.org (LinuxCommand.org)
- The Linux command line for beginners (Ubuntu)
- GNU Bash manual (GNU)