Linux Basic Commands: A Beginner’s Guide for New Support Engineers

·

·

Reading time:

8 minutes

New to Linux, or about to start your first support role? These are the commands you’ll use in your first week, grouped by task. Each table shows what the command does and a real example. Once you’re comfortable, move on to the production support cheat sheet.

Originally published January 2021, rewritten November 2026.

Jump to

Three things to know first

  • Everything is case-sensitive. Logs, logs and LOGS are three different directories.
  • Paths are absolute or relative. An absolute path starts at the root, / (for example /var/log/app.log). A relative path starts from where you are (for example logs/app.log). . means “here”, .. means “one level up” and ~ means your home directory.
  • There is no recycle bin. Deleted files are gone, so read commands twice before pressing Enter.
CommandWhat it doesExample
pwdPrint the directory you’re inpwd → /home/rakesh
lsList what’s in a directoryls /var/log
ls -lLong listing: permissions, owner, size, datels -lh (human-readable sizes)
ls -aInclude hidden files (names starting with .)ls -la ~
ls -ltSort by modification time, newest firstls -lt /app/logs | head
cd dirChange directorycd /app/logs
cd ..Go up one levelcd ../config
cd or cd ~Go to your home directorycd
cd -Go back to the previous directorycd -

2. Viewing files

CommandWhat it doesExample
catPrint a whole file (best for short files)cat app.conf
lessScroll through a file. /word searches, n finds next, G jumps to the end, q quitsless app.log
headFirst 10 lines (or -n N)head -n 20 trades.csv
tailLast 10 lines (or -n N)tail -n 50 app.log
tail -fFollow a file as new lines are written; Ctrl+C to stoptail -f app.log
wc -lCount lineswc -l trades.csv
diffShow the lines that differ between two filesdiff app.conf app.conf.bak

Avoid cat on large log files: it can flood your terminal with millions of lines. Use less or tail instead.

3. Creating, copying, moving and deleting

CommandWhat it doesExample
touchCreate an empty file (or update its timestamp)touch notes.txt
mkdirCreate a directorymkdir reports
mkdir -pCreate nested directories in one gomkdir -p reports/2026/11
cpCopy a filecp app.conf app.conf.bak
cp -rCopy a directory and everything in itcp -r config config_backup
mvMove or renamemv report.csv archive/
mv old.txt new.txt
rmDelete a filerm notes.txt
rm -iDelete, but ask first (safer)rm -i *.tmp
rm -rDelete a directory and its contentsrm -r old_reports
rmdirDelete an empty directory onlyrmdir empty_dir
ln -sCreate a shortcut (symbolic link)ln -s /app/releases/2.4 current

Golden rule: before any rm -r, run pwd and ls to check exactly where you are and what you’re about to delete. Before editing a config file, copy it first with a date: cp app.conf app.conf.$(date +%Y%m%d).

4. Finding files and text

CommandWhat it doesExample
grepFind lines containing textgrep ERROR app.log
grep -iIgnore upper/lower casegrep -i timeout app.log
grep -rSearch every file under a directorygrep -r "db.host" /app/config
grep -cCount matching linesgrep -c ERROR app.log
find by nameFind files by name under a directoryfind /app -name "*.conf"
find by typeDirectories only (-type d) or files only (-type f)find /app -type d -name logs
find by ageFiles modified in the last N daysfind /app/logs -mtime -1
locateFast search of a pre-built index of file nameslocate -i settlement
whichShow where a command liveswhich python3

locate is fast but uses an index that’s usually updated once a day, so it may miss new files. find is slower but always up to date.

5. Disk and system information

CommandWhat it doesExample
df -hFree and used space on each filesystemdf -h /app
du -shTotal size of a directorydu -sh /app/logs
free -hMemory and swap usagefree -h
uptimeHow long the server has been up, and its loaduptime
hostnameThe server’s name (always check before changing anything)hostname
hostname -IThe server’s IP addresseshostname -I
uname -aKernel and OS detailsuname -r
whoamiWhich user you’re logged in aswhoami
dateCurrent date, time and time zonedate

6. Processes and jobs

CommandWhat it doesExample
topLive view of running processes and CPU/memory use; q quitstop
ps -efList every process on the systemps -ef | grep java
pgrep -aFind a process by name and show its PIDpgrep -a pricing
kill PIDAsk a process to stop cleanly (SIGTERM, signal 15)kill 4321
kill -9 PIDForce a process to stop immediately (SIGKILL). Last resort: no cleanup happenskill -9 4321
command &Run a command in the background./report.sh &
jobsList background jobs started from this shelljobs
fg / bgBring a job to the foreground / resume it in the backgroundfg %1
historyCommands you’ve run beforehistory | grep ssh

7. Permissions, ownership and users

Every file has an owner, a group, and read (r), write (w) and execute (x) permissions for the owner, the group and everyone else. In ls -l output, -rwxr-x--- means the owner can do everything, the group can read and run it, and others have no access.

CommandWhat it doesExample
chmod +xMake a script executablechmod +x deploy.sh
chmod 644Set permissions with numbers (r=4, w=2, x=1 for owner, group, others)chmod 640 app.conf
chownChange a file’s owner and groupsudo chown appuser:appgroup app.conf
sudoRun one command with admin rightssudo systemctl status pricing
idYour user ID and groupsid
useradd / passwdCreate a user, then set their password (admins only)sudo useradd -m john
sudo passwd john
userdelRemove a user (admins only)sudo userdel john

Use sudo only when you need it. In a bank, admin actions are logged and audited, and most support engineers only have sudo rights for specific commands. sudo -l shows yours.

8. Archives and downloads

CommandWhat it doesExample
tar czfCreate a compressed archivetar czf logs.tar.gz /app/logs
tar tzfList what’s inside without extractingtar tzf logs.tar.gz
tar xzfExtract an archivetar xzf logs.tar.gz -C /tmp
gzip / gunzipCompress or decompress a single filegzip app.log.1
zip / unzipWork with .zip files (handy for sharing with Windows users)unzip release.zip
wget / curl -ODownload a file from a URLcurl -O https://repo.internal/tool.tar.gz

An easy way to remember the tar letters: create, extract, list; z for gzip; f for “file name follows”.

9. Combining commands

Linux gets powerful when you connect small commands together.

SymbolMeaningExample
|Pipe: send one command’s output into the nextgrep ERROR app.log | wc -l
>Write output to a file (overwrites it)grep ERROR app.log > errors.txt
>>Append output to a fileecho "checked $(date)" >> notes.txt
;Run commands one after another, regardless of successdate; uptime
&&Run the next command only if the previous one succeededcd /app/logs && ls -lt
||Run the next command only if the previous one failedping -c1 dbhost || echo "unreachable"

A real example: the 10 most common errors in a log.

grep ERROR app.log | sort | uniq -c | sort -rn | head

Use && rather than ; when it matters: cd /wrong/path; rm -r * would delete files in whatever directory you happened to be in, while cd /wrong/path && rm -r * stops safely when the cd fails.

10. Keyboard shortcuts

KeysWhat they do
TabAuto-complete a command, file or directory name (press twice to see options)
↑ / ↓Scroll through previous commands
Ctrl+RSearch your command history as you type
Ctrl+CStop the running command
Ctrl+ZPause the running command (resume with fg)
Ctrl+DLog out of the current shell
Ctrl+LClear the screen (same as clear)
Ctrl+A / Ctrl+EJump to the start / end of the line
Ctrl+S / Ctrl+QFreeze / unfreeze the terminal (if it “hangs” after Ctrl+S, press Ctrl+Q)

11. Getting help

CommandWhat it doesExample
manFull manual page; / to search, q to quitman tail
--helpQuick summary of a command’s optionsgrep --help
whatisOne-line description of a commandwhatis df
aproposFind commands related to a keywordapropos compress

Practice lab: 10 steps

Try this on any Linux machine, WSL on Windows, or the Mac Terminal (most commands are the same). It’s completely safe: everything happens in a practice folder.

  1. Go to your home directory and confirm where you are.
  2. Create a folder called lab/logs in one command.
  3. Inside it, create a file app.log containing three lines: two with INFO and one with ERROR.
  4. Show only the ERROR line.
  5. Count how many lines contain INFO.
  6. Make a dated backup copy of app.log.
  7. List the folder, newest file first, with human-readable sizes.
  8. Archive the lab folder into lab.tar.gz and list its contents.
  9. Check how much space the lab folder uses.
  10. Delete the lab folder safely, then confirm it’s gone.
Show answers
cd ~ && pwd                                          # 1
mkdir -p lab/logs                                    # 2
cd lab/logs
echo "08:00 INFO  service started" > app.log         # 3
echo "08:01 INFO  connected to db" >> app.log
echo "08:02 ERROR order rejected" >> app.log
grep ERROR app.log                                   # 4
grep -c INFO app.log                                 # 5  -> 2
cp app.log app.log.$(date +%Y%m%d)                   # 6
ls -lth                                              # 7
cd ~ && tar czf lab.tar.gz lab && tar tzf lab.tar.gz # 8
du -sh lab                                           # 9
ls lab && rm -r lab lab.tar.gz && ls                 # 10

Next steps

Rakesh Kadukutty

Senior Production Support Engineer in London with 10+ years supporting Fixed Income and FX trading systems at BNP Paribas and Tradeweb.

About LinkedIn

Get the daily brief

One fintech story every morning, with the interview angle. Free, straight to your inbox.