Linux Commands Examples - Running the Linux ls Command - Type In & Run Linux Commands Examples

Running the Linux ls Command - The ls Command Description - Examples of Running the Linux ls Command

The Linux ls command shows (lists) the files and folders in a directory and there are lots of options of the ls command - and you're going to see some of these here.

The "ls" in the ls command stands for "list", as in "list files and folders".

Linux ls Command Examples with Linux Command Options

Type in the Linux commands at the right of the prompt (the $ symbol) shown below. Your system may show

a different prompt, such as a # (pound or number symbol).

Don't type in the $ (dollar sign) when you run the Linux command examples below.

Be sure to press the Enter key after typing in the Linux commands below. The Linux commands are shown at the right of the Linux command prompt - shown as the $ (dollar sign). Your system may show a # (pound or dollar sign) or another symbol as the Linux prompt.

Running the Linux ls Command - Linux ls Command Examples

The first example below simply shows typing in ls to run the ls (list) command. This runs the ls command without any options.

Remember: Don't type in the $ prompt shown below when you run the ls command below.

Also, Linux commands are "case sensitive". Always type lower case letters when they are shown and upper case letters when they are shown. In the command below, don't type LS (with upper case letters), type in ls (with lower case letters).

$ ls

Running the Linux ls command above shows the contents of the current directory. The output you see on the screen after typing in the command is a listing of the files and folders in the current directory, shown one after the other, without any detail. You can use options of the ls command to see more detail, such as using the -l (for long) option.

Now run the ls command with the "-l" option (without the quotation marks). This runs the ls command with the "dash el" option. (Be sure to use an "l" (el) and not the number 1 when you run the Linux command below).

The "l" (pronounced "el") option stands for "long", as in "list long".

$ ls -l

Notice the difference between the first command you ran and the Linux command above, with the -l option.

The -l option shows a long listing, which shows more detail than the previous command (the one without any options) for each file that appears.

In the "list" you see on the screen, the file and folder names are at the far right and lots of detail for each file and folder is shown at the left of each file and folder; such as the size, date and time of the file or folder.

The /home (slash home) shown in the next Linux command example causes the ls command to list the contents of the folder named "home".

$ ls -l /home

The output shows the files and folders that are in the directory named home, which is below the root directory, represented by the / (slash).

Linux Command Examples Training Tips: Learning Linux with the "Linux Admin & Commands Training Videos" CD is easy. You can watch every step of Linux command examples as they are carefully described in detail. And the Linux ls command is shown with lots more examples than shown here.

Click here to see Linux training video samples of the "Linux Admin & Commands Video Tutorials".

Click here to order the "Linux Admin & Commands Video Tutorials" CD - and you automatically get 30 days of "Online Viewing" of these Linux training videos until your CD arrives.

Learn how to use Linux in General - Featuring Ubuntu Linux - NOW - Click Here to Order Now

Click Here to Watch Free Sample General Linux Training Videos - Featuring Ubuntu Linux

Get Updates to this Linux Training Blog. FREE!

Privacy Notice: We will not distribute your email address to anyone. Period!

What do you need to find out about how to use Linux?

Do you need to know how to go to the command line prompt to run Linux Commands and use Linux commands to do Linux System Administration?

Or do you need to know how to use a Linux Desktop, Programs and work with Program Windows - or Use Linux Training Videos and Video Tutorials to Get Linux Training?

Find out more about working with Linux - and find out what YOU need to know. Just click on "Comment" below and ask your "most important Linux training question" - or you could give us make a suggestion - or just post a comment to let us know what you think!

Thanks for visiting this "Linux Commands Book Blog"!

Clyde Boom, http://www.iLearnLinux.com

The Easy Linux Training Guy ;)

Easy, Self-paced Linux Training - in Plain English!

Filed under Linux Commands Training Examples, Hands-On Exercises by

Permalink Print Comment

Leave a Comment

Lancom Technologies - Easy, self-paced Linux training - in Plain English!
Web Site: www.iLearnLinux.com | Email: ClydeBoom@iLearnLinux.com
150 South Eighth Street, P.O. Box 1438, Lewiston, NY 14092-1438 USA
5468 Dundas Street West, P.O. Box 807, Toronto, Ontario M9B 6E3 Canada
Toll Free: 1-800-718-7318 | Outside North America: +1-905-857-7177
Copyright © 2008 Lancom Technologies. All rights reserved.