Linux basicsWritten by GLWS8 min readUbuntu 24.04 LTS / AlmaLinux 9
Commands run on your server unless a section says otherwise. Replace example usernames, addresses and paths with your own values. Keep a working session open when changing remote access.

Find your starting point

These commands work on Ubuntu 24.04 LTS and AlmaLinux 9. Start in an SSH session as your normal login user; no administrative privileges are needed. A Linux path beginning with / is absolute: it starts at the filesystem root. A relative path is interpreted from your current working directory.

Run pwd to display that current location. Use cd with no argument to return to your home directory. The ~ symbol also represents your home directory, while .. refers to the directory above your current location.

Locate yourself and return home
pwd
cd
pwd

Read a directory listing

The basic ls command lists names. Adding -l provides details such as permissions, owner, size, and modification time. Adding -a includes hidden names beginning with a dot; -h displays readable sizes. Hidden files are a naming convention, not a security feature.

Directories usually have a leading d in the long listing. On a typical VPS, /etc holds system configuration, /var holds changing service data and logs, and /home contains ordinary user home directories. Inspect these locations without changing their contents.

Inspect your home and system configuration directory
ls -lah
ls /etc

Create an isolated practice folder

Create a new glws-files-lab folder in your home directory. If mkdir reports that it already exists, choose a different folder name before continuing so the exercise does not overwrite earlier work.

The quoted filename below contains a space, so quoting keeps it together as one argument. After writing the sample text, cat displays it. Expect a file named server notes.txt containing one line about your first Linux file.

Create a folder and sample file
mkdir "$HOME/glws-files-lab"
cd "$HOME/glws-files-lab"
printf 'My first Linux file\n' > 'server notes.txt'
cat 'server notes.txt'
The > operator replaces an existing file's contents. Use it here only after creating a new practice folder.

Copy and rename the sample

cp creates another copy; mv moves a file or changes its name. The -i option asks before replacing an existing destination. Run these commands inside the practice folder, then list the result. You should see the original notes and the renamed backup.

Practice copying and renaming
cp -i 'server notes.txt' notes-backup.txt
mv -i notes-backup.txt notes-archive.txt
ls -l

Use paths deliberately

Linux filenames are case-sensitive: Notes.txt and notes.txt are different names. Use Tab to complete a partially typed path and reduce spelling mistakes. If a command says No such file or directory, check pwd and the exact filename first. Leave the practice folder in place while learning; you can return to it from anywhere using its absolute home-based path.

Return home, then revisit your practice folder
cd
cd "$HOME/glws-files-lab"
pwd

Official documentation

These upstream references provide more detail on the commands and workflows in this guide.