Back when I started managing servers, I remember staring at the terminal, completely lost. The blinking cursor felt like it was mocking me. Fast forward a few years, and now Linux Commands feel as natural as breathing. Whether you’re currently managing Linux servers or planning to, these twenty Linux Commands will prove essential time and time again.
1. ssh – Remote Server Access
Look, if you’re going to manage servers, ssh is where everything starts. It’s how you connect to that machine sitting in a data center thousands of miles away. Just type ssh username@server-ip and boom, you’re in. Sometimes you’ll need a different port – that’s when -p comes in handy. I can’t tell you how many times I’ve fixed critical issues at 2 AM from my couch thanks to ssh.
ssh admin@192.168.1.100 -p 2222
2. ls – Directory Listing
Sure, ls seems boring. But when you need to see what files are where, nothing beats it. I live by ls -la because it shows everything, including those sneaky hidden files that start with a dot. Add -h to the mix and suddenly file sizes make sense – no more counting zeros to figure out if that’s megabytes or gigabytes.
ls -lath /var/log/
3. cd – Directory Navigation
You’d be surprised how much time you waste clicking through folders in a GUI. With cd, you zip around the filesystem like it’s nothing. Here’s a trick: cd – jumps back to wherever you just were. Saved me countless keystrokes over the years.
cd /etc/nginx/sites-available
4. grep – Text Search and Filter
Ever tried finding one error in a log file with 50,000 lines? Without grep, you’d go insane. This thing searches through text faster than you can blink. I use grep -r when I need to search through a whole bunch of files at once. The -i flag is great when you can’t remember if that error message was uppercase or lowercase.
grep -i "error" /var/log/apache2/error.log
Read full article: https://link.srvr.so/552k3ksq