Tag: linux for Beginners, Episode 1

  • Linux for Beginners, Episode 1: Your First Steps in the Terminal

    Linux for Beginners, Episode 1: Your First Steps in the Terminal

    This guide covers linux for Beginners, Episode 1.

    Linux for Beginners, Episode 1: Your First Steps in the Terminal
    Photo: David Revoy, CC BY 4.0, via Wikimedia Commons

    Linux runs most of the world’s servers, cloud instances and security tools, and it intimidates beginners for exactly one reason: the terminal. The honest secret is that the terminal is not a test — it is a conversation. You type a short command, the machine answers, and five commands cover most of your first week. This is episode one of our Linux foundations run: the first steps, in the order a beginner should actually take them.

    Step 1: Open a terminal and learn where you are

    On Ubuntu and most desktop distributions, the terminal opens with Ctrl+Alt+T. The first three commands form a loop you will use forever:

    • pwd — print working directory. It answers “where am I?” Linux organises everything as one tree starting at the root, /. Your personal files live under /home/yourname, and that is where a new terminal normally starts.
    • ls — list what is here. ls -l shows details (permissions, owner, size, date); ls -a also shows hidden files, whose names start with a dot.
    • cd — change directory. cd Documents moves down, cd .. moves up one level, and bare cd takes you home from anywhere.

    That loop — where am I, what is here, move — is navigation. Everything else is a variation on it. The layout itself is not arbitrary: the Filesystem Hierarchy Standard, maintained by the Linux Foundation, defines what belongs in /etc (configuration), /var (logs and changing data), /usr (most programs) and the rest, so a map learned on one distribution works on nearly all of them. Running man hier on your own machine prints that map.

    Step 2: Touch files — carefully

    Four commands create and move things:

    • mkdir practice makes a folder; touch notes.txt creates an empty file.
    • cp copies, mv moves or renames.
    • cat file prints a file’s contents; less file pages through a long one (press q to leave).

    And one command deserves respect from day one: rm deletes permanently. There is no recycle bin in the terminal. Beginners should practise in a scratch folder, read every rm command twice before pressing Enter, and treat rm -rf — recursive, forced deletion — as a loaded tool, never a habit. William Shotts makes the same point throughout The Linux Command Line, the standard free beginner text: the shell gives you exactly the power you ask for, including the power to delete the wrong thing.

    Step 3: Ask the machine for help before asking the internet

    Linux carries its own manual. man ls opens the full manual page for any command — what it does, every flag, and examples. command --help prints a shorter summary. When a tutorial uses a flag you do not recognise, man is the primary source that settles what it actually does. Learning to read man pages early is the single habit that separates people who copy commands from people who understand them — and it matters for security, because a pasted command you cannot read is a command you should not run.

    Step 4: Understand sudo before you lean on it

    Your normal account is deliberately not all-powerful. sudo runs one command with administrator (root) privileges, after your password, and the system logs it. The discipline is simple: use sudo only when a task genuinely needs it — installing software, changing system configuration — and never as a prefix to “make an error go away.” Running everything as root removes the guardrail that stops a typo, or a malicious script, from reaching the whole system.

    Linux for Beginners, Episode 1: Your First Steps in the Terminal
    Photo: David Revoy, CC BY 4.0, via Wikimedia Commons

    Step 5: Install software the distribution’s way, and update first

    On Debian and Ubuntu, software comes through the package manager: sudo apt update refreshes the catalogue of available packages, and sudo apt install <name> installs from it, with dependencies handled for you. Fedora uses dnf, Arch uses pacman — the pattern is identical. Installing from the distribution’s repositories gets you signed packages and automatic security updates; downloading random binaries from forums gets you neither. Run sudo apt upgrade regularly: on a beginner’s machine, an unpatched package is a bigger risk than any command in this article.

    Your first session, start to finish

    Open the terminal. pwd, ls, mkdir linux-practice, cd linux-practice, touch day-one.txt, man ls and read for two minutes, then sudo apt update. You have navigated, created, consulted the manual and maintained the system — the complete beginner loop in about five minutes. Episode two maps the file system itself; the commands from today are the feet it stands on.

    By Karl Amber

    Sources

    • William E. Shotts Jr., The Linux Command Line (linuxcommand.org) — the beginner command sequence, shell navigation, file manipulation and the standing caution on rm and root privileges.
    • Filesystem Hierarchy Standard, version 3.0 (Linux Foundation, refspecs.linuxfoundation.org) and the hier(7) man page — the standard directory layout (/home, /etc, /var, /usr) referenced above.
    • The man-pages project (man7.org) and distribution documentation (Ubuntu / Debian apt manuals) — man, --help, sudo and package-management behaviour as described.

    Editor’s note: this article is part of ScanderLoud’s Cybersecurity & Networking series, Linux foundations run. It was researched from The Linux Command Line, the Filesystem Hierarchy Standard and the man-pages project — our coverage is original and educational throughout.

    That is the complete picture on linux for Beginners, Episode 1.

    Featured image: Breno Martins de Oliveira Vasconcelos, CC0, via Wikimedia Commons