|
google site
|
|||||||
| Forums | Register | Blog | Man Pages | Forum Rules | Links | Albums | FAQ | Users | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
![]() |
|
|
Search this Thread |
|
#8
|
|||
|
|||
|
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 Code:
find: //proc/3354/task/3354/fd: Permission denied 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 : Code:
/path/to/the/file/filename.ext 1000 /path/to/the/file/filename.ext 900 /path/to/the/file/filename.ext 800 /path/to/the/file/filename.ext 700 /path/to/the/file/filename.ext 600 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 ..
|
| Sponsored Links | ||
|
|
|
#9
|
|||
|
|||
|
It is not possible to find the largest files on the system unless you have root access. User "oracle" is no more special than any other normal user.
|
|
#10
|
|||
|
|||
|
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, Code:
find / -type f -exec ls -s {} \; 2>>/dev/null | sort -n -r | head -5Also 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. ) Hope this helped ! |
|
#11
|
|||
|
|||
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 ? |
|
#12
|
|||
|
|||
|
Yes, definitely i can explain. Code:
find / -type f -exec ls -s {} \; 2>>/dev/null | sort -n -r | head -5
It is actually from my write up here, i hope you will definitely be interested in reading this: Mommy, I found it! — 15 Practical Linux Find Command Examples |
|
#13
|
|||
|
|||
|
well, thanks a bunch !
And that link you provided with your write up is very interesting ! thanks! |
| Sponsored Links | ||
|
|
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| To find largest and shortest word in eld | Markwaugh | Shell Programming and Scripting | 2 | 04-16-2009 11:39 PM |
| Find and display largest file on system | raidkridley | Shell Programming and Scripting | 4 | 10-20-2008 12:54 AM |
| find the largest file in whole system | megh | HP-UX | 7 | 08-05-2008 12:17 PM |
| find largest file | mohan705 | Shell Programming and Scripting | 15 | 07-04-2007 02:34 AM |
| find the 5o largest files in a directory | igidttam | Filesystems, Disks and Memory | 8 | 05-16-2007 01:20 PM |