RE: dir/list of files

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

 



hi...

i was actually looking for something similar to the ms dir function, where i
can have the files listed, along with the size of the files, and the total
number of files at the end of the list..

thanks

-bruce


-----Original Message-----
From: fedora-list-bounces@xxxxxxxxxx
[mailto:fedora-list-bounces@xxxxxxxxxx]On Behalf Of Alexander Dalloz
Sent: Tuesday, August 01, 2006 3:56 PM
To: For users of Fedora Core releases
Subject: Re: dir/list of files


Laurence Orchard schrieb:

>On Tue, 2006-08-01 at 14:55 -0700, bruce wrote:
>
>simple question.. can't find the answer.. how do i do a list of files/dir,
>and get the number of files in the dir ....
>
>ls | wc -l
>
Not really, as that mixes dirs and files. So for a directory with files
and subdirs the result of

ls | wc -l    !=   find . -type f | wc -l

And hidden files and dirs are not counted as well.


for dir in $(find /home/image/ -type d)
    do echo ">> current dir: ${dir}"
        find ${dir} -type f
        echo -n "<< number of files: "
        find ${dir} -type f | wc -l
        echo
    done

Alexander

--
fedora-list mailing list
fedora-list@xxxxxxxxxx
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list

-- 
fedora-list mailing list
fedora-list@xxxxxxxxxx
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
[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