Learning the Bash Command Line on elementary OS
For many people who switch to elementary OS, the first thing they notice is how polished the Pantheon desktop looks. Files, photos, and music behave like apps you would expect on a phone, and that simplicity is part of the appeal. Underneath that clean interface sits a powerful Unix-style operating system, and getting comfortable with Bash gives you a second pair of hands that can speed up almost anything you do on the computer.
This guide is written for Australian readers who are new to elementary OS or new to Linux generally. It assumes no prior experience with the shell and walks through the basics step by step. You can read it in front of a flat white in a Melbourne cafe or at a quiet desk in Hobart, and you should finish with a working knowledge of the commands, file paths, and small scripts that show up in everyday tutorials. The goal is not to memorise every flag but to feel confident enough to read a help page, follow a tutorial, and recover when something goes wrong.
Opening a terminal on elementary OS
The quickest way to reach the shell is through the applications menu at the top of the Pantheon desktop. Click the applications grid icon in the dock, type "Terminal" into the search bar, and open the app called Terminal. You will see a small window with a blinking cursor and a prompt that ends with a dollar sign. That prompt means the system is ready for input, and any key you press will be sent to the shell rather than to a graphical app.
If you prefer keyboard shortcuts, hold the Super key and press T. Super is the Windows or Command key on most laptops sold through Australian retailers such as JB Hi-Fi and Harvey Norman, so the muscle memory you built on other platforms will work here. Once the Terminal is open, you can resize it, switch to a dark theme in Preferences, change the font, or pin it to the dock by right-clicking the icon and choosing "Keep in Dock". These small customisations make the terminal feel like part of the desktop rather than a separate tool.
A first useful command is uname -a, which prints the system name, kernel version, and architecture. A second is date, which shows the current time. Together, they confirm that the shell is talking to the operating system and not to a frozen window.
Navigating the file system
Every command you type runs from somewhere in the file system, and that somewhere is called the working directory. When you open the Terminal for the first time, you usually land inside your home folder. You can confirm this with the command pwd, which prints the full path. On a typical elementary OS install, the path looks like /home/yourusername, similar to how a Windows path starts with C:\Users.
To list the files and folders inside, type ls and press Enter. Add -l for a long listing that shows permissions, owners, sizes, and modification dates. Add -h to make sizes human-readable, so a folder of photos shows as 4.2M instead of 4,403,712 bytes. Add -a to reveal hidden files that begin with a dot. Configuration files for apps and shells often live in those hidden files, so learning to see them is a useful early habit.
Moving around uses cd, short for "change directory". Typing cd Documents moves you into a folder named Documents inside the current location. A single dot refers to the current directory, and two dots refer to the parent directory. So cd .. steps one level up, and cd alone returns you home no matter where you are. When you begin to feel lost, the command pwd is your compass, and the command ls is your map.
Working with files and directories
The shell treats almost everything as a file, including folders, so a small set of commands covers most day-to-day work. To copy a file, use cp followed by the source and the destination. To move or rename a file, use mv. To remove a file, use rm. Folders are created with mkdir and removed with rmdir when they are empty, or rm -r when they contain other items. The -r flag means recursive, and it tells the shell to repeat the action through every nested file.
Because Linux file names are case sensitive and spaces must be escaped, a file called Holiday Photos needs to be written as "Holiday Photos" with quotes or as Holiday\ Photos with a backslash. Autocomplete with the Tab key is your friend here. Type the first few letters of a name and press Tab, and the shell fills in the rest or lists the matching options. This habit alone, formed early, prevents a great deal of frustration later when you start typing longer paths.
A useful exercise is to create a small playground. From your home directory, run mkdir cli-practice to make a new folder. Move into it with cd cli-practice. Create a few empty files with touch one.txt two.txt three.txt. List them with ls, copy one with cp one.txt one-copy.txt, remove the copy with rm one-copy.txt, and clean up the rest when you are finished. Ten minutes of this kind of repetition builds more muscle memory than an hour of reading.
Reading and editing text from the shell
Many configuration files on elementary OS live in plain text, and getting comfortable with at least one terminal editor is part of learning Bash. The easiest starting point is nano, which opens a file in a small window with command hints at the bottom. To edit a file, type nano followed by its path. To save, press Ctrl and O, then confirm the filename. To exit, press Ctrl and X. Nano is ideal for quick changes and is forgiving for beginners who have never used a modal editor before.
For longer work, many people eventually move to a more capable editor such as Vim, Neovim, or VS Code running from the command line. You do not need to master any of them on day one. What matters at this stage is that you can open a file, make a small change, and save it without leaving the shell. That single skill unlocks a huge range of tutorials, from editing your fstab to tweaking the appearance of the Pantheon desktop to writing small utilities that automate repetitive chores.
The system also includes tools for looking at files without editing them. cat prints the whole file at once, less lets you scroll through it page by page with the spacebar, head and tail show the first or last ten lines, and grep searches for a pattern inside a file. Together, these commands turn the shell into a quick way to inspect logs, configuration files, and scripts without launching anything heavy.
Understanding users, permissions, and sudo
elementary OS follows the same security model as other Linux distributions. There is a regular user for everyday work, and there is a separate administrator account known as root that the system keeps away from casual commands. When an action needs to change something outside your home folder, install software, or modify system files, the shell will ask for your password through a tool called sudo, short for "superuser do". You will see a line like [sudo] password for yourname, and after you type your password the command runs with elevated privileges for a short window.
To check who you are, type whoami. To see which groups you belong to, type groups. File permissions appear as a string such as -rwxr-xr-x at the start of an ls -l listing. The first character indicates the file type. The next three characters describe what the owner can do, the following three describe what the group can do, and the last three describe what everyone else can do. The letters stand for read, write, and execute.
A practical rule of thumb is to stay as a regular user for as long as possible, and to reach for sudo only when a command clearly requires it. The prompt that asks for your password is a built-in pause that gives you a moment to think, and using it well is a habit that pays off the first time you share a screen with someone or write down commands in a notebook for later use.
Writing your first Bash script
Once you are comfortable running individual commands, the next step is to combine them in a script. A script is a text file the shell reads from top to bottom, executing each line in turn. Open a new file called hello.sh with nano hello.sh. On the first line, write a shebang, the characters #! followed by the path to Bash, typically /bin/bash. This tells the system to use Bash to interpret the file. Underneath, add a command such as echo "G'day from the terminal" and on a third line another like date.
Save the file, then make it executable with chmod +x hello.sh. You can now run it by typing ./hello.sh, and you should see the greeting followed by the current date. The pattern of writing a file, marking it executable, and running it applies to every Bash script you will ever create. Australian readers who help out at a local Linux User Group, such as those meeting monthly in Brisbane or Sydney, often share useful one-liners this way, and seeing how a tiny script grows into a real tool is part of the fun.
Variables, loops, and conditionals come next, and they follow the same simple pattern. A variable is set with name=value and read with $name. A loop such as for f in *.txt; do echo "$f"; done prints the name of every text file in the current folder. An if statement checks a condition with square brackets, for example if [ -f file.txt ]; then echo found; fi. Each of these pieces can be combined, and the result is a small program you fully control.
Building skills and finding help
Steady practice is the most reliable teacher, and a few small habits make the journey smoother. Read every command before you press Enter, especially if you copied it from a forum thread or chat. Break long commands into pieces and run each piece separately so you understand what it does. Use the built-in help with --help on most commands and man command for the full manual. Keep a plain text notebook of useful commands, and revisit it often.
Keeping your system current is part of the routine as well. With the National Broadband Network reaching most homes and businesses across Australian cities, downloading fresh elementary OS ISO files and updates is straightforward, even in regional areas. Run sudo apt update to refresh the package lists, then sudo apt upgrade to apply the available updates. These two commands are good candidates for your first real-world use of sudo, because the action and the result are both clear.
When something breaks, the error message is often the answer. Read it from the bottom up, search for the exact phrase online, and check the date of the result so you know whether it still applies. The elementary OS community, both local and global, is welcoming to newcomers who ask clear questions.
The path from opening a Terminal for the first time to feeling at home in Bash is shorter than it looks. The pieces fit together, and the same handful of commands shows up again and again in tutorials, forums, and documentation. What matters is regular practice, a willingness to read the manual, and the patience to break problems into small steps. Once those habits are in place, the rest of elementary OS, and the wider Linux world, opens up in a way the graphical desktop alone never quite could.