← Journal
Note

15 Essential Linux Terminal Commands for Everyday Productivity

15 Essential Linux Terminal Commands for Everyday Productivity

The Linux terminal can help you inspect files, find text, monitor your system, and automate repetitive tasks. You do not need to memorize hundreds of commands to get started. Learn a small set, understand their options, and practice on files that are safe to change.

Examples below are intended as starting points. Command options can vary, so use man command or command --help to check the behavior on your system.

Navigate and inspect files

1. pwd — print the current directory

Use pwd to see where your shell is working. This is especially helpful before running commands that modify files.

2. ls — list directory contents

ls -lah shows hidden entries, detailed information, and human-readable file sizes on many systems. Remember that hidden files often store application configuration.

3. cd — change directory

Use cd /path/to/folder to move to a directory. cd .. moves to its parent, and cd ~ returns to your home directory.

4. mkdir — create a directory

mkdir notes creates a directory named notes. Use mkdir -p path/to/folder when you intentionally want to create missing parent directories as well.

5. cp — copy files

cp source.txt backup.txt copies a file. Verify the destination before copying, and be careful with recursive or overwrite options.

6. mv — move or rename files

mv draft.txt final.txt renames a file. A move can overwrite a destination depending on the options and environment, so check the target first.

7. cat and less — read text

cat file.txt prints a file to standard output. less file.txt is usually more convenient for long files because you can scroll and search within the content.

Search and process text

8. grep — search for matching text

grep -n "ERROR" app.log searches for ERROR and shows line numbers. Add recursive options only when you understand which directories will be searched.

9. find — locate files

find . -name "*.log" searches below the current directory for names matching the pattern. Start in the narrowest relevant directory to avoid unnecessary output.

10. head and tail — inspect file beginnings and endings

head -n 20 file.txt shows the first 20 lines. tail -n 50 file.txt shows the last 50. tail -f app.log can follow a growing log until you stop it.

Monitor the system

11. ps — inspect processes

ps aux displays a process listing on many Linux systems. Use it to investigate resource usage, but do not terminate unfamiliar processes without understanding their purpose.

12. top — monitor live activity

top shows changing process and resource information. It can help identify CPU-heavy processes, but interpret readings in context and compare them with the system monitor.

13. free -h — inspect memory

free -h displays memory totals in human-readable units. Linux uses available memory for caching, so high “used” memory alone does not necessarily indicate a problem.

14. df -h — check filesystem space

df -h shows filesystem capacity and available space. If a filesystem is nearly full, investigate large files and logs before deleting anything.

Inspect network information

15. ip — view network interfaces and addresses

ip addr lists network interfaces and assigned addresses. For connectivity problems, combine it with your distribution's network tools and documentation.

Learn safely

Before running a command, ask three questions: which directory does it affect, does it modify or delete data, and does it need administrator privileges? Be especially careful with sudo, wildcards, recursive options, and commands copied from the internet. Practice in a temporary directory and keep backups of important data.

Build a repeatable workflow

A good terminal workflow combines commands with shell history, clear output, and small scripts for repeated tasks. For longer jobs, capture output in a log and check the exit status. For important operations, preview the files affected before applying changes.

Aospix is developing a terminal experience as part of its desktop project. The terminal should remain useful for standard shell commands whether or not optional AI assistance is available. Check the official project page for current implementation details.

Frequently asked questions

Do I need to learn every Linux command?

No. Start with commands relevant to your daily work and learn additional tools as needed.

Is the terminal dangerous?

It can make powerful changes quickly. Understanding paths, permissions, and command options helps you use it safely.

Where can I learn more about a command?

Use its manual page with man command, its help output, and documentation from your distribution or the project's official site.