Visually Display a File s Type


Visually Display a File's Type

ls -F

The ls command doesn't tell you much about an item in a directory besides its name. By itself, it's hard to tell if an item is a file, a directory, or something else. An easy way to solve this problem and make ls really informative is to use the -F option (or --classify).

$ ls -F ~/bin adblock_filters.txt    fixm3u*  pix2tn.pl* addext*                flash.xml*     pop_login* address_book.csv       getip*         procmail/ address_book.sxc       homesize* programs_kill_artsd* address_book.xls       html2text.py* programs_usual* 


This tells you quite a bit. An * or asterisk after a file means that it is executable, while a / or forward slash indicates a directory. If the filename lacks any sort of appendage at all, it's just a regular ol' file. Other possible endings are shown in Table 2.1.

Table 2.1. Symbols and File Types

Character

Meaning

*

Executable

/

Directory

@

Symbolic link

|

FIFO

=

Socket




Linux Phrasebook
Linux Phrasebook
ISBN: 0672328380
EAN: 2147483647
Year: 2007
Pages: 288

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net