On Tue, Apr 23, 2002 at 05:23:38PM +0530, Karra, Sriram wrote:
> 
> "Balaji N" <[EMAIL PROTECTED]> writes:
> 
> > On Wed, 2002-04-24 at 03:01, krishna wrote:
> > > how can list only the files in a directory and not the directory,i.e., 
> > > the opposite ls -d */(LOST #23)
> > > TIA,
> > > krishna
> > dont know if a some option in ls exists, but easiest would be to do 
> > 
> > ls -l | grep -v ^d
> 
> A subtle variation on this one:
> 
> \ls  -F | grep -v /$
> 
> The good thing this can be used easiliy to get multi-column output as
> well as with/without details like:
> 
> ls `\ls -F | grep -v /$` # for multi-column without details
> ls -l `\ls -F | grep -v /$` # for with details
> 
> -- 
> Life sans X sounds just as bad as life sans SeX.
> 
---end quoted text---

Sorry to join the thread so late, was out of town, the better
part of the week. This is what I use for a files-only listing

ls -F --color="yes" | grep -v "\/"

This also forces the colours. For  detailed ls,  use -lF as 
suggested by Sri. A bit too long, but an alias will make it
quite convenient:

alias lsf='ls -F --color="yes" | grep -v "\/"'

Thereafter lsf will give you the output. In case the file-
list is long, you can pass it through less -r (to have the
colors on different file types).

alias lsf='ls -F --color="yes" | grep -v "\/" | less -r'

HTH

Bish


--
:
####[ Linux One Stanza Tip (LOST) ]###########################

Sub : Finding a file                                 LOST #079

The fastest way is to use "locate" command (e.g. $locate ping)
This accesses a front-compressed filename database, created as
root using the command "updatedb".  /usr/bin/frcode is used to
do the compression. See man updatedb & locatedb for details ..
 
####<[EMAIL PROTECTED]>####################################
:

_______________________________________________
linux-india-help mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/linux-india-help

Reply via email to