Modern desk with monitor showing Linux terminal

10 Basic Linux Commands Every Beginner Should Master

Staring at that blinking cursor and black screen can feel overwhelming if you’re new to Linux.. Fortunately, there are plenty of beginner tips available to help you make sense of this.

This guide breaks down the ten basic Linux commands that make the command line approachable. We’ll show you how to explore directories, file management, and system control. No jargon, just simple explanations.

Beginners have gone from learning the basics to confidently managing their own systems, and you can too.

Let’s start with the simplest command in Linux.

pwd – Know Where You Are

pwd stands for “print working directory,” and the pwd command does exactly what the name suggests. Type it in, and you’ll see your current directory path displayed on the screen.

User checking current directory in Linux terminal

For example, you might see /home/username/Documents appear, which shows where you’re standing in the file system right now. New users often lose track of their location after changing directories a few times, so the pwd command in Linux quickly solves this issue.

ls – List Everything in View

Now that you know where you are, let’s explore what’s around you. The ‘ls’ command lists all the files and directories in your current location, so you don’t need to open file browsers anymore.

Running ls organises the file names in a clean list. Now, if you need more information, like sizes or modification dates, try ls-l instead. You’ll find detailed information about each item this way. This ls command becomes second nature after a few uses, and you’ll reach for it constantly.

cd – Move Around Your System

Ready to move around? The ‘cd’ command stands for ‘change directory’ in Linux, and as the name suggests, it helps you easily move around your directory.

Here are three ways to get around:

  • cd foldername: Jump into any folder by typing cd followed by the folder name. If you’re in /home and want to visit Documents, just type cd Documents and you’re there.

  • cd ..: The two dots move you up one level to the parent directory. This helps when you’ve gone too deep and need to backtrack without retyping long path commands each time.

  • cd ~: This shortcut brings you straight home from anywhere. The tilde symbol (~) represents your home directory, so this cd command gets you back to your starting point fast.

These three commands cover most of your directory changes. Let’s go a bit deeper

cat – Display File Contents Fast

The cat command shows you what’s inside a file without launching any programs. This command in Linux prints the entire file content straight to your terminal screen. So just type cat followed by your filename.

Developer using cat command to view file

The cat command is great for handling small text files. It’s particularly recommended to display config files, scripts, and notes.

However, you’ll want to avoid using this command on large log files or binary files. Your terminal screen will be an unreadable mess if you do.

But for quick reads, cat command gets the job done.

mv – Move and Rename Files

Reading files is helpful, but you’ll also need to move them around. The mv command handles two jobs: moving files and renaming them. This command in Linux saves time, as you don’t need separate commands for each task.

Here’s the command to move a file: mv file.txt /documents/. However, to rename files, use mv oldname.txt newname.txt. The mv command will keep the file in place but change its name.

Here’s a tip: double-check your spelling before pressing enter.

sort – Arrange Data in Seconds

Alphabetising 500 names manually would take forever. Which is why, the sort command in Linux does it instantly. It arranges lines of text in order, so you can organise lists without thinking about it.

Type sort filename.txt, and you’ll see everything arranged alphabetically on your screen. Suppose you need the list reversed; just add -r to make the sort command work backwards, like this: sort -r filename.txt.

The command displays your organised data right there, and you can send it to a new file if you want to keep the results.

head – Preview Large Files

We all know that large files take forever to open. The head command fixes this by showing only the first 10 lines. Basically, you get a quick preview of any existing file without loading everything.

Running head filename.txt displays the beginning of your file right away. On top of that, if you need more lines, simply use head -n 20 filename.txt instead. This works especially well for CSV files where you want to see column headers first. You can also use it with log files, where recent entries sit at the top.

man – Your Personal Command Guide

Forgetting command syntax happens to everyone. The man command provides instant help without leaving your terminal, which makes it a go-to reference in Linux. It opens detailed manual pages that explain basic syntax, options, and examples for any command you may need.

Two simple tricks make man pages incredibly useful:

  1. man followed by any command name: Just type man ls to see everything about the ls command. The manual shows flags, basic syntax, and practical examples right there. This works for any command in Linux you want to understand better, so you don’t need to search online constantly when you’re offline or working on a server.

  2. Move with arrows, exit with q: Your arrow keys let you scroll through longer manual pages at your own pace. Press q when you’re done to return to the command line tools. The man command turns your Linux system into a self-teaching setup to help you become more independent as you learn each new command in Linux.

These built-in guides save you tons of time once you get used to them.

chown – Control File Ownership

Running into “permission denied” errors stops you cold in your tracks. The chown command in Linux solves this by changing who owns a file. It transfers file ownership from one user to another, so you can gain access to files that belong to the root user or other accounts.

Engineer using Linux terminal to fix permissions.

You could try this: type chown username filename.txt to change ownership. You’ll need to add sudo at the start most times because only the root user can reassign file permissions. The full command looks like sudo chown username filename.txt.

Remember, you need to know about file ownership to avoid access problems later. Besides, the chown command gives you control when permissions block your way.

systemctl – Take Charge of System Services

The name might sound intimidating, but handling it is easier than it looks. The systemctl command handles services that work behind the scenes on your Linux server. It allows you to start, stop, and check things like web servers or databases.

You type systemctl status apache2 to check if a service is running. You use systemctl start apache2 to fire one up instead. The systemctl command puts you in charge of what’s running on your system.

You’ll find this useful when you work with local servers or need to troubleshoot services that aren’t responding.

Start Building Your Confidence

These Ten Commandments might not sound like they can do much, but you’ve just learned the foundation. These basic commands give you access to everything else in Linux. The more you practice them, the more comfortable you’ll become with the command line.

These Linux commands work the same way on laptops, servers, and even Raspberry Pi setups. You can use them anywhere Linux runs.

If you’re exploring Linux for personal projects or building a professional website for your business, understanding these fundamentals helps. At BasicLinux, our Brisbane-based team brings over ten years of web development experience to help businesses grow online.

Ready to take your goals further? Contact us today for a free consultation.

Leave a Reply

Your email address will not be published. Required fields are marked *