|
|||||||
| Forums | Search Forums | Register | Forum Rules | Man Pages | Albums | FAQ | Members | Calendar | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
|
|
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
List biggest files (Not Directories)
Hello, can you please help me writing a command that would output the biggest files on my system from biggest to smallest? I want this to print only the files, not the directories. I have tried Code:
du -a ~ | sort -nr | head -10 However, this also prints out all the directories - which I do not want. Thank you so much, you would do me a big favor! |
| Sponsored Links | ||
|
|
#2
|
|||
|
|||
|
Code:
du -a |
while read SIZE LINE
do
[ -d "$LINE" ] || echo $SIZE "$LINE"
done | sort -rn | head |
| Sponsored Links | ||
|
|
#3
|
|||
|
|||
|
Quote:
Any ideas? |
|
#4
|
|||
|
|||
|
Try it in a POSIX shell, your system certainly has one. Perhaps /bin/sh or /usr/bin/sh. tcsh is missing several of the constructs I'm using here, among many other problems.
CSH programming considered harmful |
| Sponsored Links | |
|
|
#5
|
|||
|
|||
|
I cant, I only have access to a tcsh/csh
![]() |
| Sponsored Links | |
|
|
#6
|
|||
|
|||
|
Any UNIX system has a Bourne shell somewhere, it's a non-optional feature, and not something they can easily deny people access to. What system are you using?
|
| Sponsored Links | |
|
|
#7
|
|||
|
|||
|
Quote:
I am not even sure, I am really new to unix. Can you provide any other alternatives? ls? find? |
| Sponsored Links | ||
|
![]() |
| Tags |
| du, file, size, unix, unix file du size |
| Thread Tools | Search this Thread |
| Display Modes | |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| list directories with more than X files | vanessafan99 | UNIX for Dummies Questions & Answers | 5 | 11-02-2011 05:50 PM |
| List directories and sub directories recursively excluding files | pointers | UNIX for Dummies Questions & Answers | 3 | 02-23-2011 08:39 PM |
| How to get a list of files in a dir w/o sub-directories? | aoussenko | Shell Programming and Scripting | 4 | 07-23-2010 09:19 AM |
| List directories and files | psalas | UNIX for Dummies Questions & Answers | 2 | 07-07-2008 12:28 PM |
| List specific files from directories | Filippo | Shell Programming and Scripting | 4 | 02-17-2005 02:56 AM |
|
|