Tips & Hints

The shortcuts every Linux beginner wishes someone had told them on day one. Some of these will feel life-changing.

⌨️ Keyboard shortcuts that save you hours

Tab completion is your best friend

Start typing a command or filename, press Tab, and the shell will finish it for you. Press Tab twice if there are multiple options and it'll show you all of them. Always use tab completion. It's not just faster — it prevents typos.

cd /etc/ap<Tab>    # completes to /etc/apt/
cat wel<Tab>       # completes to welcome.txt

Up arrow recalls your history

Hit the up arrow to bring back the command you just ran. Keep pressing to go further back. Down arrow goes forward. Essential for fixing typos in long commands — hit up, edit, re-run.

Ctrl+R searches history

The power user version of up-arrow. Press Ctrl+R and start typing part of an old command. The shell will find the most recent match. Press Ctrl+R again to cycle through older matches. Enter runs it.

Ctrl+C cancels the current command

If a command is running and you want to stop it, Ctrl+C sends an interrupt signal. Works in almost every Linux program. If it's stuck, Ctrl+\ sends a stronger signal.

Ctrl+L clears the screen

Same as typing clear, but faster. Your terminal will feel a lot tidier if you clear between tasks.

Ctrl+A and Ctrl+E jump to the start/end of the line

Typing a long command and need to fix the beginning? Ctrl+A jumps to the start. Ctrl+E jumps to the end. Ctrl+U deletes everything before the cursor. Ctrl+W deletes the previous word.

🔄 Piping and redirection

The pipe: | sends output from one command into another

The single most powerful concept in the Linux shell. Instead of writing a huge program, you chain small tools together. Count how many files are in a directory? ls | wc -l. Find all Python files modified today? find . -name "*.py" | xargs grep "TODO".

ls -la | grep "Apr"       # only April files
ps aux | grep firefox     # find firefox processes
history | tail -20        # last 20 commands

Redirect output to a file with >

Save a command's output to a file instead of printing it. > overwrites the file, >> appends.

ls -la > files.txt         # save listing
echo "new line" >> log.txt # append

Read input from a file with <

The opposite of > — feed a file as input to a command.

sort < unsorted.txt

💡 Things that feel like cheating when you learn them

The dot-dot pattern

.. means "the directory above this one." So cd .. goes up. cd ../../other goes up two levels and then into "other". Makes sense once you see it.

The tilde (~) is your home directory

~ expands to /home/<your-username>. So cd ~ takes you home, cat ~/.bashrc shows your shell config, ls ~/Documents lists your documents folder.

Wildcards: * matches anything

* is the wildcard. ls *.txt shows every text file in the current directory. rm *.tmp deletes every tmp file. cp src/* backup/ copies everything out of src.

The semicolon chains commands

cmd1 ; cmd2 runs cmd1 then cmd2 regardless of whether cmd1 succeeded. cmd1 && cmd2 only runs cmd2 if cmd1 succeeded. cmd1 || cmd2 only runs cmd2 if cmd1 failed. These three let you script without writing scripts.

cd project && make && ./test    # only run tests if make succeeds

man is the manual

Every command has a manual. When you don't know what a command does, man <command> is almost always the fastest path to an answer. Faster than Google for most cases.

Which version is which: `type` vs `which`

which ls tells you the path to the ls binary. type ls tells you whether ls is a shell builtin, an alias, or a real program. Useful when you're debugging why a command is behaving oddly.

🎯 Habits of Linux power users

Read the error message

Linux errors are usually accurate and specific. If it says "Permission denied", you need different permissions. If it says "No such file or directory", the path is wrong. Don't panic — read the message out loud.

Always run dangerous commands on a copy first

Never run rm -rf or sed -i or anything destructive on a real file until you've tested it on a copy. cp important.conf important.conf.bak takes 2 seconds and has saved a million careers.

Your home directory is yours — everything else needs sudo

If a command says "Permission denied" outside /home/<you>, you probably need sudo. If it says "Permission denied" inside your home, something's wrong with the file's owner or permissions.

When in doubt, check the logs

Linux writes everything to /var/log. If a service isn't working, tail -f /var/log/syslog (or the service's specific log) will tell you why. Logs are the ground truth.

Script anything you do twice

If you've typed the same sequence of commands twice, make it a script. A 5-line bash script you save in ~/bin/ is worth more than remembering the commands perfectly.


Ready to practice?

LinuxSim is a free browser-based Linux sandbox. Everything on this page works there. Nothing to install, nothing to break, nothing to risk.

🐧 Try LinuxSim now