DEV Community

Cover image for A Beginner's Guide to Linux Commands
jones268
jones268

Posted on

A Beginner's Guide to Linux Commands

The world is going Linux. At least that's what we tell ourselves every time we open a terminal window and type in a cryptic series of characters that do nothing but make us more frustrated than we were when we started. If you've ever considered using Linux, but aren't sure where to start, this guide is for you.

The command line might seem intimidating at first, but it's actually not so bad. You can use the GUI (Graphical User Interface) if you want, but the terminal has a lot of cool features that make using Linux much easier.

If you're on Ubuntu and want to see what commands you have available, just hit the CTRL+ALT+T key combination and a box will appear in the top left corner showing you all the different programs available.

command line ubuntu terminal

Commands

Linux commands are essentially small bundles of text designed to perform a specific task, such as move files from one location to another or run a program.

The Linux command line is not intimidating once you learn a few basic commands. The following are some of the most common commands and cover a wide range of tasks you might want to do.

The cd command stands for "change directory" and it changes the current working directory on your computer. It's very useful for navigating around your filesystem.

For example, if you're in your home directory and want to get to /etc/hosts, you could type:

cd /etc/hosts
Enter fullscreen mode Exit fullscreen mode

You could also do this if you're already in /etc/hosts but want to go back up one directory:

cd ..
Enter fullscreen mode Exit fullscreen mode

If you want to see what's in your current working directory, use the ls command like this: ls.

ls
Enter fullscreen mode Exit fullscreen mode

This will list all of the files and directories in the current working directory.

There are many other commands that accomplish the same tasks for some commands, such as cp (copy) and mv (move).

cp file /home/user/Desktop/
Enter fullscreen mode Exit fullscreen mode

There's a lot more to learn, but the commands in this article will serve you well no matter which Linux distro you're using. They even work on Mac OS X and on the BSD systems.

If you are new to the command line, I recommend this site

Top comments (0)