5 Sept 2025

By
Alex Rich
Nanohost Team

Learning how to move around and manage files and folders in the Linux filesystem is one of the most important skills for working with any computer. On cloud servers, these tasks are usually done through the terminal using well-known Linux shells and standard commands. This guide will walk you through some of the essential skills needed to work with files and directories from the terminal.
To follow along with this tutorial, you’ll need access to a Linux server. If you’re not sure how to connect for the first time, check out our guide on connecting to a Linux server with SSH.
You should also be familiar with what the terminal is and what Linux commands look like. This guide assumes you’re using a normal, non-root user account (not an administrator).
When you’re ready, log into your server using SSH to continue.
The first set of skills you need to practice is learning how to move around the filesystem and inspect what’s available in different locations.
pwdWhen you log into your server, you are usually placed inside your user’s home directory. This directory is reserved for your files and subdirectories, and you have full control over it.
To see your exact location in the filesystem, use the pwd command:
pwdOutput:
/home/sammyHere, the home directory belongs to the user sammy. It lives inside the /home directory, which is itself located at the root /.
lsOnce you know where you are, you can view the contents of a directory with the ls command.
First, move into a populated directory:
cd /usr/share
pwdOutput:
/usr/shareNow, list its contents:
lsOutput (partial):
adduser grub perl5
apport icons polkit-1
apt i18n pkgconfig
To display extra details, such as permissions, ownership, size, and modification time, use the -l flag:
ls -lOutput (partial):
drwxr-xr-x 2 root root 4096 Apr 17 2022 adduser
drwxr-xr-x 6 root root 4096 Oct 9 18:16 apport
To include hidden files (those starting with .), use -a. Try this in your home directory:
cd
ls -aOutput:
. .. .bashrc .profileHere, . means the current directory and .. means the parent directory.
cdYou can switch directories by using either absolute paths (starting with /) or relative paths (based on your current location).
Example of absolute path:
cd /usr/shareExample of relative path:
cd locale
cd en/LC_MESSAGESTo move back up one level:
cd ..To quickly return to your home directory:
cd ~Linux relies heavily on plain text files for system configuration. One of the best tools to view files is less, which allows scrolling and searching.
less /etc/servicesUse /word to search, n to jump to the next match, N for the previous match, and q to quit.
Other useful commands:
cat file → print entire filehead file → show first 10 linestail file → show last 10 linestouchcd
touch file1
lsYou can also create multiple files at once:
touch /home/sammy/file2 /home/sammy/file3mkdirmkdir test
mkdir test/example
mkdir -p some/other/directoriesThe -p option creates all necessary parent directories.
mvMove a file:
mv file1 testRename a directory:
mv test testing⚠️ Be careful — if the destination already exists, it will be overwritten.
cpCopy a file:
cp file3 file4Copy directories recursively:
cp -r some againrm and rmdirDelete a file:
rm file4Delete an empty directory:
rmdir testing/exampleDelete a non-empty directory:
rm -r again⚠️ Use caution — deletions are permanent.
The simplest text editor for beginners is nano.
nano file1
Inside nano:
Ctrl+O → saveCtrl+X → exitCtrl+G → helpAfter saving, you can view your file:
less file1To exit less output, use q

Other editors like vim or vi are more advanced but harder for beginners. If a guide suggests vim, you can safely use nano instead.
You’ve now learned how to:
pwd, ls, and cdless, cat, head, and tailnanoWith these essential skills, you’re ready to explore your Linux system further. In the next guide, we’ll cover Linux file permissions and how to manage them.

Whether you’re applying kernel updates, clearing a stuck device, or finishing a configuration change, a reboot is sometimes the cleanest fix. This guide shows beginner-friendly and safe ways to restart Linux immediately (“reboot now Linux”), plus how to force reboot if the system is unresponsive. We’ll cover desktops, servers, and remote machines over SSH.

Learning how to move around and manage files and folders in the Linux filesystem is one of the most important skills for working with any computer. On cloud servers, these tasks are usually done through the terminal using well-known Linux shells and standard commands. This guide will walk you through some of the essential skills needed to work with files and directories from the terminal.

Learn the basics of the Linux terminal — what it is, how the shell and command prompt work, and how to run your first commands.