Re: list files but not directory

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, 2009-08-22 at 03:59 -0400, William Case wrote:
> Hi Tim;
> On Sat, 2009-08-22 at 16:58 +0930, Tim wrote:
> > On Fri, 2009-08-21 at 10:35 -0400, William Case wrote:
> > > It seems illogical, that 'ls' wouldn't have a flag that just shows
> > > files when it has a flag for directories.
> > 
> > Though that flag "ls -d" has a completely different purpose (show
> > directory names, rather than go into them and list their contents).
> > 
> True.  But whatever its purpose, it does give me a list of directory
> names.

In fact it lists *all* its arguments as usual (the default being ".", as
always), except that those which are directories are not listed
recursively. It doesn't "give a list of directory names", unless that's
what the arguments happen to be.

There are no flags to ls which mean "ignore any arguments which belong
to this class of object".

> All that I am saying is that it would be handy to have a simple util
> that listed file names.

If you want to filter out directories, use grep, as several people have
pointed out. That's the Unix Way (tm).

>  I suggest 'ls' because it is probably the most
> used and first learned listing utility and therefore would be the place
> to have it.  It would be useful to beginners (particularly those who do
> not yet have any idea what a regexp is) and for script writing or piping
> to sed, awk, grep or a new file (or for appending).

Said beginners need to learn that *directories are files* (and devices
are files, named pipes are files, etc.). This is an important concept
which should not be hidden.

poc

-- 
fedora-list mailing list
fedora-list@xxxxxxxxxx
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
Guidelines: http://fedoraproject.org/wiki/Communicate/MailingListGuidelines
[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [Fedora Magazine]     [Fedora News]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Maintainers]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Legacy]     [Fedora Desktop]     [Fedora Fonts]     [ATA RAID]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [SSH]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Centos]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Tux]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Asterisk PBX]     [Fedora Sparc]     [Fedora Universal Network Connector]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux