Linker IT Software
Google
Web www.oraxcel.com
menubar-top-links menubar-top-rechts
Home Help Search Login
Welcome, Guest. Please Login.
SQL*XL: Database to Excel bridge litLIB: Excel power functions pack ExcelLock: Locking and securing your valuable Excel spreadsheets encOffice: Protect your Excel file easy and safe encOffice: Protect your Excel file easy and safe
Pages: 1
Showing UNIX directory listings (Read 3246 times)
Gerrit-Jan Linker
YaBB Administrator
*****




Posts: 75
Showing UNIX directory listings
26.11.06 at 21:49:10
 
Showing UNIX directory listings
 
To show a directory listing in UNIX you use the ls command. I believe it means list, at least this is the way I remember the command.
 
The ls command has various options. Always a good reference are the manual pages. If you type man ls you will probably get more information than you really want to read.  
 
I would like to explain the few ls commands I frequently use:
 
ls
ls shows the directory listing in wide format. I never use it this way because it is difficult to find the file you are looking for.
 
I rather like to use the command ls -l
When you use ls -l the directory is shown as a detailed list with file modification date and group info and file permissions.
 
When I worked at theTheoretical Chemistry group at Groningen University (http://theochem.chem.rug.nl/) our system admin Johan defined an alias (was that in the .pofile or the c-shell init file) so we coul duse ll. A small tweak but that was very handy!
 
The drawback of ls -l is that the list is usually too long. I frequently pipe the information to the more command to display it page by page:
ls -l | more
 
To display hidden files you can use the ls -a command. Hidden UNIX files start with a full stop. For example .profile.
 
Another little gem is this one: ts[tt] [tt]-lrt
This command shows the detailed listing sorted by modification date, the last modified file shown last in the list.
Back to top
 
« Last Edit: 26.11.06 at 22:15:14 by Gerrit-Jan Linker »  

Gerrit-Jan Linker
Linker IT Software
Email WWW Gerrit-Jan Linker   IP Logged
Gerrit-Jan Linker
YaBB Administrator
*****




Posts: 75
UNIX: listing directories only
Reply #1 - 05.11.10 at 12:19:36
 
UNIX: listing directories only
 
To list directories only you can use the -d switch.
 
Example: list all directories stating with a p:
ls -d p*
Back to top
 
 

Gerrit-Jan Linker
Linker IT Software
Email WWW Gerrit-Jan Linker   IP Logged
Pages: 1