Bash for Beginners Part 1: Anatomy of the command line (2024)

This article is part of a 37 articles-long series extracted from the course: Mastering the Unix Command-Line with Bash available on Skillshare.

Bash for Beginners Part 1: Anatomy of the command line (2)

The first thing you should see appearing when opening a new terminal window is a bunch of random characters, usually terminated by a percentage or a dollar sign.

Bash for Beginners Part 1: Anatomy of the command line (3)

This character sequence is called a command prompt, and it is here to indicate you that the shell is ready to accept commands as it literally prompts you to take action.

Beside being a shell readiness indicator, the prompt can also be customized to include colours, special characters and other elements to make it more informative or just visually pleasing.

We can for example change the prompt to include our username, the name of our computer or the current working directory.

Next comes the command itself.

In general, a command is composed of the three following elements separated by one or more space characters: a name, a list of options also called flags and a list of arguments.

Bash for Beginners Part 1: Anatomy of the command line (4)

The name, which always comes first, is indeed the name of the program we want to run.

The options, are parameters used to influence the program’s behaviour and are quite easy to recognize as they are always preceded by a dash or a double dash.

Finally, the arguments, are values the program will use as an input, like a number, a file name or text string for example.

Let’s illustrate this by running a basic command called: echo, which takes a list of strings as arguments and prints them back into the terminal window.

Running echo on its own for example, will simply print an empty newline as indeed we didn't specify any arguments to print.

Bash for Beginners Part 1: Anatomy of the command line (5)

Running echo with a few arguments this time, will result in displaying each argument separated by a space character followed by a newline.

Bash for Beginners Part 1: Anatomy of the command line (6)

And finally, running echo with the -n option and the same arguments, will also result in displaying each argument separated by a space character but this time without being followed by a new line — as you can see, the prompt appeared right after the output of the command.

Bash for Beginners Part 1: Anatomy of the command line (7)

One thing you should keep in mind as of now tho, is to always place the options before the arguments, as most commands won’t understand what you are trying to do if you were to switch them.

For example, placing the -n option after the arguments list when using echo will result in the -n being treated as string of characters and not an actual option.

Bash for Beginners Part 1: Anatomy of the command line (8)

👨‍🏫 Don’t want to wait for the next part? Get the FULL course now on Skillshare + 30 FREE days with this link: https://www.skillshare.com/r/profile/Razvan-Ludosanu/961339862?gr_tch_ref=on

Don’t forget to 👏🏻 if you enjoy reading my work and you can also buy me a cup of steaming hot ☕!

Bash for Beginners Part 1: Anatomy of the command line (2024)
Top Articles
10 Best Python IDEs and Code Editors in 2024 - GeeksforGeeks
Dividend Per Share (DPS)
English Bulldog Puppies For Sale Under 1000 In Florida
Katie Pavlich Bikini Photos
Gamevault Agent
Pieology Nutrition Calculator Mobile
Hocus Pocus Showtimes Near Harkins Theatres Yuma Palms 14
Hendersonville (Tennessee) – Travel guide at Wikivoyage
Compare the Samsung Galaxy S24 - 256GB - Cobalt Violet vs Apple iPhone 16 Pro - 128GB - Desert Titanium | AT&T
Vardis Olive Garden (Georgioupolis, Kreta) ✈️ inkl. Flug buchen
Craigslist Dog Kennels For Sale
Things To Do In Atlanta Tomorrow Night
Non Sequitur
Crossword Nexus Solver
How To Cut Eelgrass Grounded
Pac Man Deviantart
Alexander Funeral Home Gallatin Obituaries
Shasta County Most Wanted 2022
Energy Healing Conference Utah
Geometry Review Quiz 5 Answer Key
Hobby Stores Near Me Now
Icivics The Electoral Process Answer Key
Allybearloves
Bible Gateway passage: Revelation 3 - New Living Translation
Yisd Home Access Center
Home
Shadbase Get Out Of Jail
Gina Wilson Angle Addition Postulate
Celina Powell Lil Meech Video: A Controversial Encounter Shakes Social Media - Video Reddit Trend
Walmart Pharmacy Near Me Open
Marquette Gas Prices
A Christmas Horse - Alison Senxation
Ou Football Brainiacs
Access a Shared Resource | Computing for Arts + Sciences
Vera Bradley Factory Outlet Sunbury Products
Pixel Combat Unblocked
Movies - EPIC Theatres
Cvs Sport Physicals
Mercedes W204 Belt Diagram
Mia Malkova Bio, Net Worth, Age & More - Magzica
'Conan Exiles' 3.0 Guide: How To Unlock Spells And Sorcery
Teenbeautyfitness
Where Can I Cash A Huntington National Bank Check
Topos De Bolos Engraçados
Sand Castle Parents Guide
Gregory (Five Nights at Freddy's)
Grand Valley State University Library Hours
Holzer Athena Portal
Hello – Cornerstone Chapel
Stoughton Commuter Rail Schedule
Selly Medaline
Latest Posts
Article information

Author: Lakeisha Bayer VM

Last Updated:

Views: 5928

Rating: 4.9 / 5 (69 voted)

Reviews: 84% of readers found this page helpful

Author information

Name: Lakeisha Bayer VM

Birthday: 1997-10-17

Address: Suite 835 34136 Adrian Mountains, Floydton, UT 81036

Phone: +3571527672278

Job: Manufacturing Agent

Hobby: Skimboarding, Photography, Roller skating, Knife making, Paintball, Embroidery, Gunsmithing

Introduction: My name is Lakeisha Bayer VM, I am a brainy, kind, enchanting, healthy, lovely, clean, witty person who loves writing and wants to share my knowledge and understanding with you.