Solved

Display Size of Files From Multiple Directories

Posted on 2000-03-01
1
209 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 21

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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Hello fellow BSD lovers, I've created a patch process for patching openjdk6 for BSD (FreeBSD specifically), although I tried to keep all BSD versions in mind when creating my patch. Welcome to OpenJDK6 on BSD First let me start with a little …
Let's say you need to move the data of a file system from one partition to another. This generally involves dismounting the file system, backing it up to tapes, and restoring it to a new partition. You may also copy the file system from one place to…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
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.
Suggested Courses

617 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