
📎 This article includes 1 downloadable practice file ↓
Sooner or later a data job means logging in to a Linux server over SSH. These commands cover the first weeks.
In this article
| Task | Linux | Windows equivalent |
|---|---|---|
| Where am I? | pwd |
cd |
| List files (detailed) | ls -lh |
dir |
| Change folder | cd /var/log |
cd |
| Show a file | cat file.txt, less file.txt |
type |
| Last lines of a log, live | tail -f app.log |
— |
| Search inside files | grep -i "error" app.log |
findstr |
| Find files by name | find . -name "*.csv" |
dir /s |
| Copy / move / delete | cp / mv / rm |
copy / move / del |
| Make a folder | mkdir -p a/b |
mkdir |
| Disk space | df -h, du -sh * |
— |
| Running processes | top, ps aux |
Task Manager |
| Permissions | chmod 644 file |
— |
| Run as admin | sudo command |
Run as administrator |
| Download | curl -O URL |
curl |
| Zip / unzip | tar -czf a.tgz folder, unzip f.zip |
Compress |
Pipes: small tools, big results
grep "ERROR" app.log | cut -d' ' -f1 | sort | uniq -c | sort -rn | head
“Count errors per day, most first” — five tiny commands joined with |.
rm has no Recycle Bin. Double-check the path, and never run rm -rf on a line you copied without understanding it.A first session on a server, step by step
Here is what the first ten minutes on a new Linux server usually look like — and what each command tells you.
whoami # which user am I?
hostname # which machine is this?
df -h # is the disk nearly full?
free -m # how much memory is used?
uptime # how long running, and load average
ls -lh /var/log # where the logs live
sudo tail -n 50 /var/log/nginx/error.log # the last 50 web-server errors
Load average (the three numbers from uptime) is roughly “how many things are waiting for the CPU”. On a 2-CPU server, values around 2 are busy; much higher means something is struggling.
Permissions in one minute
ls -l shows something like -rw-r--r-- 1 www-data www-data. The first three letters after the dash are the owner’s rights (read, write), then the group’s, then everyone else’s. chmod 644 file means owner read/write, others read only — the normal setting for web files. chmod 600 is for secrets like private keys.
Editing a file safely
- Make a backup:
sudo cp site.conf site.conf.bak - Edit with
sudo nano site.conf(save: Ctrl+O, exit: Ctrl+X) - Test before restarting: for Nginx,
sudo nginx -t - Only then reload:
sudo systemctl reload nginx
📎 Practice files for this article
- 📄All code from this post2 examples in one file, ready to open in your editor.⬇ SH · 717 B
Free to use for learning. Files with macros (.bas) are plain text — import them with Alt+F11 → File → Import File, and always test on a copy.
Atul (AJ) builds office-automation and local-first AI tools as Atulya AI, and works with Excel, SAP and Oracle EPM every day. He writes about the shortcuts, macros and automations that actually save time — plus the occasional wacky fact. Videos on YouTube: Lazy Automator AI (@LazyAutomatorAI).
More posts by Atul →Stuck on a step? Ask a question and the AI answers using this article.