Skip to content

Both.org

News, Opinion, Tutorials, and Community for Linux Users and SysAdmins

Primary Menu
  • About Us
  • Computers 101
    • Hardware 101
    • Operating Systems 101
  • End of 10 Events
    • Wake Forest, NC, — 2025-09-20
  • Linux
    • Why I use Linux
    • The real reason we use Linux
  • My Linux Books
    • systemd for Linux SysAdmins
    • Using and Administering Linux – Zero to SysAdmin: 2nd Edition
    • The Linux Philosophy for SysAdmins
    • Linux for Small Business Owners
    • Errata
      • Errata for The Linux Philosophy for SysAdmins
      • Errata for Using and Administering Linux — 1st Edition
      • Errata for Using and Administering Linux — 2nd Edition
  • Open Source Resources
    • What is Open Source?
    • What is Linux?
    • What is Open Source Software?
    • The Open Source Way
  • Write for us
    • Submission and Style guide
    • Advertising statement
  • Downloads
  • Home
  • Conquering the Command Line for Linux Beginners
  • Command Line
  • Linux

Conquering the Command Line for Linux Beginners

12 Essential Linux Commands for Beginners
Don Watkins January 2, 2024 5 minutes read
programming_code_keyboard_orange_hands

Image by: Opensource.com CC-by-SA 4.0

12 Essential Linux Commands for Beginners

When operating on the Linux command line, it is easy to get disoriented, which can have disastrous consequences. I once issued a remove command before realizing that I’d moved the boot directory of my computer. I learned to use the pwd command to know exactly which part of the file system I was in (and these days, there are command projects, like trashy and trash-cli, that serve as intermediates when removing files).

When I was new to Linux, I had a cheat sheet that hung over my desk to help me remember those commands as I managed my Linux servers. It was called the 101 commands for Linux cheat sheet. As I became more familiar with these commands, I became more proficient with server administration.

Here are 12 Linux commands I find most useful.

1. Print working directory (pwd)

The pwd command prints your working directory. In other words, it outputs the path of the directory you are currently working in. There are two options: --logical to display your location with any symlinks and --physical to display your location after resolving any symlinks.

2. Make directory (mkdir)

Making directories is easy with the mkdir command. The following command creates a directory called example unless example already exists:

$ mkdir example

You can make directories within directories:

$ mkdir -p example/one/two

If directories example and one already exist, only directory two is created. If none of them exist, then three nested directories are created.

3. List (ls)

Coming from MS-DOS, I was used to listing files with the dir command. I don’t recall working on Linux at the time, although today, dir is in the GNU Core Utilities package. Most people use the ls command to display the files, along with all their properties, are in a directory. The ls command has many options, including -l to view a long listing of files, displaying the file owner and permissions.

4. Change directory (cd)

It is often necessary to change directories. That’s the cd command’s function. For instance, this example takes you from your home directory into the Documents directory:

$ cd Documents

You can quickly change to your home directory with cd ~ or just cd on most systems. You can use cd .. to move up a level.

5. Remove a file (rm)

Removing files is inherently dangerous. Traditionally, the Linux terminal has no Trash or Bin like the desktop does, so many terminal users have the bad habit of permanently removing data they believe they no longer need. There’s no “un-remove” command, though, so this habit can be problematic should you accidentally delete a directory containing important data.

A Linux system provides rm and shred for data removal. To delete file example.txt, type the following:

$ rm example.txt

However, it’s much safer to install a trash command, such as trashy or trash-cli. Then you can send files to a staging area before deleting them forever:

$ trash example.txt

6. Copy a file (cp)

Copy files with the cp command. The syntax is copy from-here to-there. Here’s an example:

$ cp file1.txt newfile1.txt

You can copy entire directories, too:

$ cp -r dir1 newdirectory

7. Move and rename a file (mv)

Renaming and moving a file is functionally the same process. When you move a file, you take a file from one directory and put it into a new one. When renaming a file, you take a file from one directory and put it back into the same directory or a different directory, but with a new name. Either way, you use the mv command:

$ mv file1.txt file_001.txt

8. Create an empty file (touch)

Easily create an empty file with the touch command:

$ touch one.txt

$ touch two.txt

$ touch three.md

9. Change permissions (chmod)

Change the permissions of a file with the chmod command. One of the most common uses of chmod is making a file executable:

$ chmod +x myfile

This example is how you give a file permission to be executed as a command. This is particularly handy for scripts. Try this simple exercise:

$ echo 'echo Hello $USER' > hello.sh

$ chmod +x hello.sh

$ ./hello.sh
Hello, Don

10. Escalate privileges (sudo)

While administering your system, it may be necessary to act as the super user (also called root). This is where the sudo (or super user do) command comes in. Assuming you’re trying to do something that your computer alerts you that only an administrator (or root) user can do, just preface it with the command sudo:

$ touch /etc/os-release && echo "Success"
touch: cannot touch '/etc/os-release': Permission denied

$ sudo touch /etc/os-release && echo "Success"
Success

11. Shut down (poweroff)

The poweroff command does exactly what it sounds like: it powers your computer down. It requires sudo to succeed.

There are actually many ways to shut down your computer and some variations on the process. For instance, the shutdown command allows you to power down your computer after an arbitrary amount of time, such as 60 seconds:

$ sudo shutdown -h 60

Or immediately:

$ sudo shutdown -h now

You can also restart your computer with sudo shutdown -r now or just reboot.

12. Read the manual (man)

The man command could be the most important command of all. It gets you to the documentation for each of the commands on your Linux system. For instance, to read more about mkdir:

$ man mkdir

A related command is info, which provides a different set of manuals (as long as they’re available) usually written more verbosely than the often terse man pages.

What’s your favorite Linux command?

There are many more commands on a Linux system—hundreds! What’s your favorite command, the one you find yourself using time and time again?

Tags: CLI command line Linux

Post navigation

Previous: How I migrated a WordPress website to a new host
Next: Working with data streams on the Linux command line

Related Stories

Puzzle pieces coming together to form a computer screen
  • Fortran 77
  • History
  • Linux

A look back: f2c

Jim Hall May 13, 2026
Ubuntu-Resolute-Raccoon
  • Getting Started
  • Linux
  • Ubuntu

Getting started with Linux: Ubuntu 26.04

Don Watkins May 12, 2026
Rows of old fashioned alarm clocks.
  • Linux
  • SysAdmin

Changing the timezone in Fedora

Jim Hall May 11, 2026

Random Quote

The value of a program is proportional to the weight of its output.

— Laws of Computer Programming

Why I’ve Never Used Windows

On February 12 I gave a presentation at the Triangle Linux Users Group (TriLUG) about why I use Linux and why I’ve never used Windows.

Here’s the link to the video: https://www.youtube.com/live/uCK_haOXPFM 

Why there’s no such thing as AI

Last October at All Things Open (ATO) I was interviewed by Jason Hibbits of We Love Open Source. It’s posted in the article “Why today’s AI isn’t intelligent (yet)“.

Technically We Write — Our Partner Site

Our partner site, Technically We Write, has published a number of articles from several contributors to Both.org. Check them out.

Technically We Write is a community of technical writers, technical editors, copyeditors, web content writers, and all other roles in technical communication.

Subscribe to Both.org

To comment on articles, you must have an account.

Send your desired user ID, first and last name, and an email address for login (this must be the same email address used to register) to subscribe@both.org with “Subscribe” as the subject line.

You’ll receive a confirmation of your subscription with your initial password as soon as we are able to process it.

Administration

  • Log in
  • Entries feed
  • Comments feed
  • WordPress.org

License and AI Statements

Both.org aims to publish everything under a Creative Commons Attribution ShareAlike license. Some items may be published under a different license. You are responsible to verify permissions before reusing content from this website.

The opinions expressed are those of the individual authors, not Both.org.

You may not use this content to train AI.

 

Advertising Statement

Both.org does not sell advertising on this website.


Advertising may keep most websites running—but at Both.org, we’re committed to keeping our corner of the web ad-free. Both.org does not sell advertising on the website. Nor do we offer sponsored articles at this time. We’ll update this page if our position on sponsorships changes.

We want to be open about how the website is funded. Both.org is supported entirely by David Both and a few other dedicated individuals.

 

 

Copyright © All rights reserved. | MoreNews by AF themes.