[ale] ls

Claypool, Joe JClaypool at tandbergtv.com
Sat Feb 3 09:15:39 EST 2007


The -F flag for ls appends special characters for certain file types

       -F, --classify, --indicator-style=classify
              Append a character to each filename indicating the file type.  For regular files that are executable, append a `*'.  The file type
              indicators are `/' for directories, `@' for symbolic links, `|' for FIFOs, `=' for sockets, and nothing for regular files.

So to filter the the directories (/) you could do something like this (the "\" is an escape character)...

       ls -F | grep -v \/

..and to show only regular files that are not executable you could do the following...

       ls -F | egrep -v '\/|\*|\|\@|\||\='

-----Original Message-----
From: ale-bounces at ale.org on behalf of Allan Neal
To: ale at ale.org
Sent: Fri 2/2/2007 4:18 PM
To: ale at ale.org
Subject: Re: [ale] ls
 
Do you mean so that only regular files are listed or the contents of
directories are not listed, only the directory name?

in the case of the later: ls -d
 
for the first, I don't think so.  You would have to write a script to filter
out the directories.

Allan

On Fri, Feb 02, 2007 at 03:45:14PM -0500, Terry Bailey wrote:
> Hi,
> 
> Is there a switch for the ls command so that directories are not listed?
> 
> Thanks,
> 
> Terry Bailey
> 
> _______________________________________________
> Ale mailing list
> Ale at ale.org
> http://www.ale.org/mailman/listinfo/ale

-- 
 / ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ \
|  /~~\                                 /~~\  |
|\ \   |   I would rather be exposed   |   / /|
| \   /|     to the inconveniences     |\   / |
|  ~~  |  attending too much liberty   |  ~~  |
|      |  than to those attending too  |      |
|      |     small a degree of it.     |      |
|      |      - Thomas Jefferson       |      |
|      |                               |      |
 \     |~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|     /
  \   /                                 \   /
   ~~~                                   ~~~

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/ms-tnef
Size: 3233 bytes
Desc: not available




More information about the Ale mailing list