top of page

Basic Linux Commands I Actually Use (and What They Mean)

Updated: Jan 30

A woman looking confidently at her computer because she knows how to use Linux commands.

If you’ve ever watched someone work in a Linux terminal and thought, “I have no idea what’s happening, but I feel like I should,” you’re in very good company. We have all been there.


Linux commands don’t have to feel intimidating or exclusive. Most of us aren’t memorizing manuals. We’re learning a small set of essential Linux commands, using them regularly, and building confidence over time. This post covers the basic Linux commands I actually use (quite often) in real projects, explained in plain language with practical examples. I have placed a ⚠️ symbol after the commands that you need to be a bit cautious about when using.


Environment variables (the ones you’ll see everywhere)

Before jumping into commands, it helps to understand environment variables, because you’ll see them constantly in Linux. Environment variables are bits of information your shell keeps about you and your system. You reference them with a '$' in front of the name.


$PATH is the most important one to understand early. It’s a list of directories your system checks, in order, when you type a command. When you run something like ls or python, Linux searches each directory in $PATH until it finds an executable. When you see “command not found,” it usually means the command isn’t in your $PATH.


Other environment variables you’ll see often include $HOME (your home directory), $USER (your username), $SHELL (the shell you’re using), and $PWD (your current directory). You can print any of these using echo, which is why I will start there.


echo

'echo' prints text to the terminal. I use it constantly to sanity-check things, like printing messages, testing scripts, or inspecting environment variables.


Syntax

echo [text]

Examples

echo "Hello, Linux"
echo $PATH

clear

'clear' wipes the terminal screen so you’re not staring at old output. It doesn’t delete anything, but it just gives you a visual reset. I like to use this when the terminal is just too messy. Don't worry, you can still cursor up for previous commands you've used in the session. It doesn't delete any history.


Syntax

clear

pwd

'pwd' stands for “print working directory.” When you’re not sure where you are in the file system (which happens more than people admit), this command tells you. Again, I like to use this as a sanity-check of sorts.


Syntax

pwd

Example Output

/home/username/projects

ls

'ls' means “list,” and it shows files and folders in your current directory.


Syntax

ls [options]

Examples

ls

Add these options to show a long description of each file and all hidden files in the current directory

ls -la

cd

'cd' stands for “change directory.” It lets you move around the file system without changing anything. This is the equivalent of clicking on a folder in a directory.


Syntax

cd [directory]

Examples

cd projects

This command takes you up a folder. More about this next.

cd ..

~ , . , and ..

These show up everywhere once you start paying attention. '~' is your home directory, '.' is the current directory, and '..' is the parent directory (like going back a directory).


Examples

cd ~
ls .
cd ..

mkdir

'mkdir' means “make directory.” This is how you create folders, and it’s usually where new projects start. Sometimes I use 'ls' after this to ensure that the new folder is there.


Syntax

mkdir [directory_name]

Example

mkdir projects

touch

'touch' creates an empty file or updates a file’s timestamp. It’s perfect for scaffolding files quickly.


Syntax

touch [filename]

Example

touch app.py

cp

'cp' copies files or directories. I use it constantly for backups or safe experimentation. You can copy into a new folder or copy from one file to another.


Syntax

cp [source] [destination]

Examples

cp file.txt backup.txt

mv

'mv' moves or renames files. This command works fast, so it’s worth slowing down and double-checking paths.


Syntax

mv [source] [destination]

Examples

mv old.txt new.txt
mv app.py src/app.py

rm ⚠️

'rm' permanently deletes files. There is no recycle bin. With that being said, be careful. This is one of the commands to treat with real respect. Once you use it, you can't get the files back.


Syntax

rm [file]

Examples

rm file.txt

Add the -r option to recursively remove all subdirectories and files in a folder. Be extremely careful with this one.

rm -r old_folder

cat

'cat' displays the contents of a file. It’s read-only and safe, but large files can flood your terminal. It's like 'echo', but for a file instead of text.


Syntax

cat [file]

Example


head

'head' shows the beginning of a file. Great for previews and quick checks. I use this if I want to make sure the contents of a file are what I'm really looking for. I also use this when I want to see the shape of data in a file that I need to analyze.


Syntax

head -n 10 [file]

Example

head -n 10 app.log

tail

'tail' shows the end of a file. This command is especially useful for logs. I mostly use this if I have appended something to a file or if I am checking error logs.


Syntax

tail [file]

Examples

tail app.log

nano

'nano' is a beginner-friendly terminal text editor with visible shortcuts at the bottom. This is my preferred editor. Once you get in the file, you will see all of the options for navigating the editor.


Syntax

nano [file]

Example

nano config.yaml

vi / vim

'vi' (or 'vim') is a powerful editor that exists on almost every server. Many developers use this editor, but it is kind of old school. It's slightly more to navigate than 'nano', but I still use this from time to time.


Syntax

vi [file]

Example

vi app.py

grep

'grep' searches for text inside files and logs. It’s powerful and read-only. Think of this as an in-line search tool. There are tons of options to make your search more narrow as well. This is a great for finding words in files or for finding files when you don't remember the exact name.


Syntax

grep [pattern] [file]

Examples

grep "ERROR" app.log

Use -i to find any case of the pattern and -n to show line numbers where the pattern was found.

grep -i -n todo .

find

'find' helps you locate files when you know they exist but not where they live. This is different from 'grep' because you have to have some knowledge of the file name.


Syntax

find [path] [conditions]

Example

find . -name "*.py"

which

'which' shows the full path of the command your system is actually using. This does not necessarily show you the version of the package. It shows you the location of where the command executes.


Syntax

which [command]

Example

which python

curl ⚠️

'curl' transfers data from a URL and is commonly used for API testing. Be cautious when piping its output into other commands. Make sure you trust the source.


Syntax

curl [url]

Example


ps

'ps' shows running processes. This can be helpful when processes start to hang up or take longer than expected.


Syntax

ps

jobs

'jobs' lists background processes started in the current terminal session.


Syntax

jobs

kill ⚠️

'kill' stops a running process. Stopping the wrong one can crash applications. Normally, you would run the 'ps' command to get the pid of a particular process that you want to 'kill'. That's most often how I use it. It's the equivalent of clicking on 'force stop' on a particular program.


Syntax

kill [pid]

Example

kill 12345

sudo ⚠️

'sudo' runs commands with elevated permissions. Powerful, necessary, and dangerous if misused. You may not even have sudo permissions on your machine if you're in an environment that is managed by other administrators.


Syntax

sudo [command]

Example

sudo apt update

q

'q' exits paged views like less or man. If you ever feel stuck, try pressing it. Very often 'ctrl+c' will do the same thing.


Example

q

Final thoughts

You don’t need to memorize this list. Familiarity comes from use, not perfection. Linux rewards curiosity and caution, especially with powerful commands. Also, remember that Google is still your friend until you get the hang of these. You may want to bookmark this blog, but know that there are way more options than I have listed here for these commands that you can normally see by using the option '--help' with any of these commands.


Once these start to feel natural, the terminal stops being intimidating and starts feeling like a workspace that you navigate naturally. Trust me, with practice, these will actually start to feel natural. You will probably even prefer to use the terminal when you get the hang of things. If there are any terminal commands that you find useful, then please comment them below and add to this list.

 
 
 

Comments


The Southern Tech Lady

  • Dribbble
  • Behance
  • Instagram
  • Facebook
  • Twitter
  • LinkedIn

©2025 by The Southern Tech Lady

bottom of page