EmbLogic's Blog

ls – list command

ls – list command
=================
- ls means list directory content
- Prototype :
ls [OPTION] … [FILE] …
- Exit status
It returns 0 ,on success
Returns 1 in case of minor problems (eg. cannot access subdirectory)
returns 2 in case of serious trouble (eg. Cannot access command line argument)
- For specific listing you can use *
eg.1) For listing all files starting with a use :
ls a*
2) for listing all .c files use :
ls *.c
3) for listing all .c files starting with a use :
ls a*.c
- Some common options are :
i) -a –all –> Do not ignore enteries starting with .
Use this to view swap or temporary files.
ii) -l –> long listing format
iii) -r –) Reverse order sort (by name) and list
iv) -s –size –> Print allocated size of each file in blocks
v) -S –> Sort by file size
vi) -t –> Sort by modification time, newest first
vii) -U –> Do not sort; list enteries in directory order
viii) -X –> Sort alphabetically by entry extension.
ix) -F –> to distinguish files from directories (Puts / in directory and * with executable files)
x) -R –> It shows files that are contained in directory. It continued to dirrectory in a directory and so on.

- In fedora for long lsting use command :

ll

 

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>