How to move around the filesystem

Basic commands necessary for utilizing a linux terminal

The filesystem is the configuration of your system, in linux everything is a file, this makes it easier to interact with all resources on your system, everything will have permissions, and be able to be interacted with in the same basic ways. In order to successfully utilize the terminal you'll need to understand how to traverse the filesystem.

Begin by opening a terminal. The application should already be installed on your machine. The first thing you'll see is the following:

$ # The dollar sign indicates that you are a regular user

Normally you'll be a regular user this is indicated by the $ occasionally you'll need to become a super user (called root) - you can think of this as the system's admin account. This user has no limits so you must be careful when you become root.

The # sign in front of text such as this indicates a comment.

Who are you?

whoami
# Now that we know we're a regular user wwe should find out who that is
# In order to understand who you are simply type: `whoami`
# The output should be the user you're logged in as in my case its:
theo

How to see where you are:

pwd
# this shows you your current location 
# `pwd` stands for "print working directory"
# The output should be your home directory and should look like:
/home/theo/

What is in here?

ls
# ls stands for list and shows you everything in the current directory
# the output will look something like this:
Desktop Documents Downloads Music Pictures Public Templates Videos
# By default ls sorts things in alphabetical order

How to change locations

How to create a file:

How to remove a file:

How to go back a directory:

rm may or may not prompt you for comfirmation to ensure you want to permananently delete the file, this is a nice feature but isn't the default eveyrwhere, so ensure you're in the right directory with pwd and use ls to ensure it's the proper file.

Last updated

Was this helpful?