Thanks to all for their answers for this one.
It seems this could be very interesting thread.
Unfortunately, all ways metioned here to get the n largest files on the server , are not still how i imagined that this could be done.
Firstly , i am always getting the complete list of files that are searched on the screen, along with the messages like
I am executing all those commands you suggested as oracle, not root.
And secondly , i still didn't recived result similiar to the following , something like
this, ONLY the first 5 biggest files(at least from the ones that i have permission to read) let's say in descending order; this should look like this i suppose :
Where those number would be bytes/megabytes of that file....
Is there something that could give this kind of result ? Without printing on the screen of the whole search/find/permissions issue process ?
...or even this output without those file size numbers...
sorry if I missunderstood/misstyped commads you provided , maybe they do exactly this ..
1. Firstly, you should have permission to all the files if you'd want to find out biggest file in the whole file system.
So better try to run the find command with the super user privilege, else you would be getting those kind of errors.
2. Secondly, if you don't want to see the errors then you can redirect it to /dev/null as,
Also this find command would show the file names and sizes in descending order as you expected. ( but size first, and then the file name next. )
thanks thegeek , you are really a geek. This is doing exactly what i wanted.
Could you please explain and point in the code you wrote how the redirect of the erorr is done,what is the purpose od dev/null and how is descending sort done ?
Hi Experts,
1. In unix how to list the largest file in given directory.
The answer will in single line statement.
2. I have Sun solaris live CD .I try to compile sample c program using "CC compiler".But its shows "cc command not found".
Please help on this.
Thanks in advance.... (4 Replies)
What is the best way to find the largest files in a directory? I used du -k|sort -rn |less.
I got a results for this. But if I used the following command , I got another result...a different order in the same directory. Why is that?
ls -la |awk '{print $5," ",$9}' sort -rn|less. I saw that... (6 Replies)
I got a file called Album in that there is list of songs i want to find the Longest and shortest song name in field 2 ie ($2)....
Please help me with "awk" (2 Replies)
Hello,
How to find the list of 5 largest(size wise) file in current directory?i tried using
ls -l | sort -t " " -r +5 -6 -n | head -5
but this is not giving correct output as ls -l command gives 1 extra line of output that is how many total files are there!so by running the above... (4 Replies)
What is the correct command for finding and displaying the largest file on the system?
I don't know how to specify "largest" with "find", and pipe that to something that will display the file contents. Or should I be using cat, more, less, ls, or something else? (4 Replies)
Hi,
1)I have XX directory and have lot of files ,I want to find largest file in that
directory
2)how calculate the size of file in MB.
Thanks,
Mohan (15 Replies)
I'm trying to find the 50 largest file in a directory named /sasdb and its' subdirectories. I'm using the find command and a pipe to awk
Not sure if I'm actually getting the largest files from this directory and its subdirectories. Here is the code I used...
find /sasdb -ls | awk '{print... (8 Replies)