Electric Type

Multimedia

About Us

News

Help

ls

If no filenames are given, ls will list files in the current directory. If one or more files are given, ls will display the files contained within "name" or list all the files with the same name as "name." The files can be displayed in a variety of formats.

Structure: ls [options] [names]

ls is a command you'll end up using all the time. It simply stands for list. If you are in a directory and you want to know what files and directories are inside that directory, type ls. Sometimes the list of files is very long and it flies past your screen so quickly you miss the file you want. A handy trick to combat this problem (besides enlarging your screen) is to type | more after the ls command, like so:

ls | more

The character | (called pipe) is typed by using shift and the \ key. | more will show as many files as will fit on your screen, and then display a highlighted "more" at the bottom. If you want to see the next screen, hit enter (for moving one line at a time) or the spacebar (to move a screen at a time). | more can be used anytime you wish to view the output of a command in this way.

A useful option to use with ls command is -l. This will list the files and directories in long format. This means it will display the permissions (see chmod), owners, group, size, date and time the file was last modified, and the filename.

webmonkey.com:[/eighties]% ls -l

drwxrwxr-x  meghan   staff  512  Oct 5 09:34 john_hughes
 -rwx-rw-r-- meghan   staff  4233 Oct 1 10:20 boy_george.html 
-rwx-r--r-- meghan   staff  4122 Oct 1 12:01 legwarmers.html 

There are several other options that can be used to modify the ls command, and many of these options can be combined. -a will list all files in a directory, including those files normally hidden. -F will flag filenames by putting / on directories, @ on symbolic links, and * on executable files.

Back to the index.


Tutorials  

User Blogs  

Teaching Tools  

Authoring  

Design  

Programming help  

Advanced Flash  

Javascript  

Glossary  

PHP Coding  

User Blogs

Screen Shots

Latest Updates

Contact Us

Valid HTML 4.01!
Valid CSS!

Breadcrumb

© ElectricType
Maintained by My-Hosts.com
Site map | Copyright | Disclaimer
Privacy policy | Acceptable Use Policy
Legal information.