Solved

Display Size of Files From Multiple Directories

Posted on 2000-03-01
1
203 Views
Last Modified: 2013-12-27
I have hundreds of user directories all with one common file, namely their Mailbox.  I am trying to get a listing of the size sorted for each user's Mailbox.  I am running Solaris 2.6.

I have tried:    find . -name Mailbox -print | ls -al | sort -nr +4
but it only searches the current directory the command is run under.
0
Comment
Question by:DrRichard
1 Comment
 
LVL 20

Accepted Solution

by:
tfewster earned 50 total points
ID: 2574081
Do find . -name Mailbox -print -exec ls -l {} \; |sort -nr +4

The {} is the "found filename"

You can't pipe the output of "find" to ls like that; ls is ignoring it, so whats it's doing is just the "ls -al |sort" bit
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

A metadevice consists of one or more devices (slices). It can be expanded by adding slices. Then, it can be grown to fill a larger space while the file system is in use. However, not all UNIX file systems (UFS) can be expanded this way. The conca…
Why Shell Scripting? Shell scripting is a powerful method of accessing UNIX systems and it is very flexible. Shell scripts are required when we want to execute a sequence of commands in Unix flavored operating systems. “Shell” is the command line i…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now