Re: Bash globbing files only?

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

 



Yep, that would work, but I guess my question was a bit poorly
formulated. I am writing a bash script that has:

dirs=[^.]*/

and I'd like to have "files=..." without using find or other external
commands if at all possible.

Thanks.


Actually that last one wasn't ideal.  A better solution would be
ls -lAR / | grep "^-"
This would give you files, not symbolic links, not directories, not
block devices, not character devices.

I can't find any way to do it with ls alone.

Of course the best way is with the find command, being

find / -type f

which will not only give you the file names, but with their complete
path.  If you want the files listed in long format, then use

find / -type f -ls

By the way the syntax you have to list directories does not work for
me.  It yields the same results as if I did ls *, which lists all
files in the current directory, and files in directories contained in
the current directory (in lieu of listing the directory name).

Any reason why you'd rather use ls instead of find?

Thanks,

Jacques

[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