A beginner’s introduction to the GNU/Linux command line
An introduction to the command line for novices that teaches some simple commands such as ls , cd and pwd and explains how to learn more
Download the whole article as PDF
Short URL: http://fsmsh.com/1252
- 2006-06-21
- User space | Easy
-
Write a full post in response to this!
This content was sponsored by:
So you have decided to try a free software operating system such as GNU/Linux, congratulations. GNU/Linux is not that different from other operating systems on the surface. You point and click using the mouse and call down menus to get programs to work.
However, these icons and windows are just the sweet candy coating on top of a much older system, a system of programs designed to be accessed by the command line.
If you know the correct commands, then you can start any program, check your computer’s status, and see what files you have stored without having to find the listing in your menu
The command line is an interface that allows you to talk directly to your computer using words called commands. If you know the correct commands, then you can start any program, check your computer’s status, and see what files you have stored without having to find the listing in your menu. Also, some functions can only be accessed through the command line, so if you want to truly understand your new system it is worth learning.
Finding a terminal program
To access the command line you will need to open a terminal which will allow you to talk directly to the computer. Look for a program called Xterm, terminal, Konsole, console or something similar. Since different versions of GNU/Linux have different menus, this may take a bit of searching.
The icon for a terminal is usually a computer screen, and different windowing systems will have their preferred terminals. Gnome has a gnome-terminal and KDE has Konsole. On my Debian Linux system, I found a terminal called Xterm under Debian —>Xshells.
First, open a terminal on your computer screen. It will usually list the computer name, or yourname @ yourcomputer and there will be some kind of punctuation mark like a $ or a # followed by a blinking box or line-shaped cursor. That blinking thing is called a prompt because it is prompting you to give it a command. Think of it as a genie coming out of a lamp asking you. “What is your command my master?”
If you are at your computer now, you may want to follow along. Open a terminal and then type whoami. (Remember to run all of the words together with no spaces, and press enter.) Here’s what you get:
$ whoami rosalyn $
This may seem to be a bit of a philosophical question to be asking your computer, but don’t worry. Your computer has a very concrete world-view.
It should return your login name. The word that you just typed is a command. The computer executed the command and returned a result, your username.
Using commands
Commands are written in a particular way. The command is typed first with no spaces in the name. Then after a space, you can sometimes modify the command by adding what are called options. Options change or limit the way the command is executed. Options are usually preceeded by a dash. A command may also include the name of a file or directory that you want the command to work on. The finished command will look something like this.
command -option file
The best way to understand the command line is to use it. Try typing ls.
Remember that GNU/Linux is case sensitive so you must use lower case. When you press enter, the computer will return to you a list of file names in the directory that you are in. The command ls stands for list.
When I type this command, I get the following response:
$ ls captions.txt photo1.png $
Files are documents, images or programs on your computer. Directories are like boxes that hold the files. You are always considered to be within some directory. Most of the time, commands only act on the files within the directory in which you are located. So, when you list using ls, you get a list of all of the files in the directory that you are in, not all of the files in the computer.
When you use the command line, you are learning to talk “face to face” with your system. You can tell it precisely and concisely what you want it to do. There is something truly freeing about this power
Command names are usually shorthand ways of representing a word, such as ls for list, or mv for move. Sometimes, however, they are oddly abbreviated. Using the command line requires you to learn the names of the commands. The advantage is that by learning the language you can talk directly to the computer without needing a point and click interpreter program explaining what you mean.
When you type ls the names of all of the files in your current directory are written on the terminal screen, and the prompt returns waiting. It is asking, “What next my master?”
Write a full post in response to this!
Similar articles
Do you like this post?
Vote for it!
Copyright information
This article is made available under the "Attribution-Sharealike" Creative Commons License 3.0 available from http://creativecommons.org/licenses/by-sa/3.0/.
Biography
Rosalyn Hunter: Rosalyn Hunter has been on the internet since before the web was created. Born into a family of instructors, she has made it her life's goal to teach others about the important things in life, such as how to type
- Login or register to post comments
- 157778 reads
- Printer friendly version (unavailable!)




Best voted contents
-
Special 301: FOSS users. Now we're all Communists and Criminals
Gary Richmond, 2010-03-05 -
Microsoft's Internet Driving Licence: stupid, unworkable and unenforceable
Gary Richmond, 2010-03-10 -
The Bizarre Cathedral - 69
Ryan Cartwright, 2010-03-12 -
Making a videoloop with Kino and Audacity
Terry Hancock, 2010-02-18
Buzz authors
Free Software news
- AdvanceTo: #Softwaretool #USAcentric #Management #MyReaction #TammyFennel #Bestpractices #Freesoftware #Twitter http://tinyurl.com/o23vxr
- When are YOU get your copy of this AWSOME FREEsoftware? Check it out at http://bit.ly/5NJCME
- Day 5 of the SCO v. Novell Trial and Some Help for Journalists Covering the Trial - Updated
- fanalytics: #Socialmedia #Darkside #Socialmedia #Socialinformationprocessing #Marketing #Twitter #Freesoftware http://tinyurl.com/qf79zc
- Blake Stowell Email to Maureen O'Gara: "I Need You to Send a Jab PJ's Way"
Similar entries
Other sites
- The Top 10 Everything (Dave). The good, the bad and the ugly.
- Free Software news (Dave & Bridget). All about free software -- free as in freedom!
- Book Reviews: Illiterarty (Bridget). Book reviews, blogs, and short stories.
Hot topics - last 60 days
-
Linux performance: is Linux becoming just too slow and bloated?
Mitch Meyran, 2010-01-26 -
Web code is already open - why not make it free as well
Ryan Cartwright, 2010-01-20 -
Save "Sita Sings the Blues" from the Flash format: can you convert FLA?
Terry Hancock, 2010-01-29 -
Question Copyright's "Minute Memes" challenge copyright rhetoric
Terry Hancock, 2010-01-15 -
Special 301: FOSS users. Now we're all Communists and Criminals
Gary Richmond, 2010-03-05
Hot topics - last 21 days
Odiogo
Free Software Magazine uses Apollo, project management and CRM for its everyday activities!


thanks
Submitted by depi on Mon, 2006-06-26 12:04.
Vote!I must to say that this is really useful tutorial for the beginners or for the average linuxers too because it shows some commands or commands atributes which not everybody must know. So good point!
P.S. I like the root tree image too :)
Changing directories
Submitted by Anonymous visitor on Thu, 2006-08-24 09:10.
Vote!I know it is the simplest of commands but I still haven't found commands for
changing directories(outside of /path/to/another/device)like the CD ROM sitting there so close but so far...
Everyone wants to show how to move within Mr. Torvalds structure but HOWTO Change into that GUI icon that won't let you drag and drop without a password, won't let you cd, what, no drive letter. (drive letter_:where are you?). I see ///, not close. OH WHERE in the world is that tutorial. Oh, yes, revised Tutorial.
toehold
Submitted by Big Yellow Tuxi on Mon, 2006-08-21 08:50.
Vote!Clear and well written, this is just what I needed! Moving from DOS to linux is a humbling experience and mastery of a few simple commands (and understanding of similarities and differences between DOS and linux) feels like a first toe on the ladder. Thanks - looking forward to reading more sometime.
Thanks for the intro to Linux shell
Submitted by Anonymous visitor on Mon, 2006-10-16 22:42.
Vote!Dear Rosalyn,
Thanks for giving me my first Linux shell command. It gave me great satisfaction and a sense of freedom and relief. If you would like teach me some more feel free to contact me.
Hope all is well
Kindest Regards
Robert
Robert Davidson
robert@datamatrix.co.nz
Director
Datamatrix New Zealand ltd www.datamatrix.co.nz
Genatron ltd www.genatron.com
Futher learning linux command
Submitted by mysurface (not verified) on Thu, 2007-05-17 13:47.
Vote!Once you get into it, you will definitely love the command line. You may even start GUI apps in terminal with help of nohup and & so GUI won't terminate even you close the terminal. You can record what have you type in terminal with script and replay back with scriptreplay. vim will be the next thing you wanna try after I start to dip your toe into CLI.
A lots of fun stuff, you can get it cover at http://linux.byexamples.com
Great tutorial article for
Submitted by Anonymous visitor (not verified) on Sun, 2007-07-29 11:13.
Vote!Great tutorial article for me to enter commandline shell. Thank you very much.
GUI help
Submitted by sanjayss (not verified) on Thu, 2007-08-16 05:22.
Vote!What is Gnome, KDE. Please explain !!!!!!
Wikipedia is where you should look
Submitted by Dave Guard on Sat, 2007-09-08 19:16.
Vote!Here is KDE and here is GNOME.
A good tutorial to start on
Submitted by harsh patel (not verified) on Fri, 2007-10-05 12:46.
Vote!A good tutorial to start on with ....thanks a lot!! .