Re: ls question

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

 



Michael Sullivan wrote:

I've only been using Linux for about a year now (actually it's a year
this month). My first computer was an IBM 8086 clone with MS-DOS 2.0. I liked MS-DOS a lot better than MSWindows because if something went
wrong, the problem was a lot easier to find: all the files needed for a
single application were all kept in the same directory, etc. Anyway, in
MS-DOS, when you ask for a directory listing, it listed the files in the
directory you were asking for (like ls), but it also gave a listing of
the total bytes contained in the files in the listing you asked for. I
was wondering if there was any way I could do that with ls. I know that
with nautilus you can do a Cntrl-A to select all the files in the
directory you're currently viewing and the total byte size will be shown
in the status bar, but is there a way to find out from a terminal
window?

"man du"

du will show file sizes; with the "-h" switch it will convert them into "human-friendly" format, and with the "-c" switch provide a sum of the sizes:

[john@starfleet tests]$ du -h -c *.in
1.0K	all.in
1.0K	am.in
1.0K	cubic.in
1.0K	derive.in
1.0K	ellipse.in
1.0K	finance.in
1.0K	heron.in
2.0K	limit.in
1.0K	pie.in
1.0K	points.in
1.0K	pyth3d.in
1.0K	test.in
1.0K	test3.in
1.0K	test4.in
1.0K	test6.in
16K	total




--

-John (john@xxxxxxxxxxx)



[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux