Ask Question Forum:
Model Library:2025-02-08:A.I. model is online auto reply
C
O
M
P
U
T
E
R
2
8
Show
#
ASK
RECENT
←
- Underline
- Bold
- Italic
- Indent
- Step
- Bullet
- Quote
- Cut
- Copy
- Paste
- Table
- Spelling
- Find & Replace
- Undo
- Redo
- Link
- Attach
- Clear
- Code
Below area will not be traslated by Google,you can input code or other languages
Hint:If find spelling error, You need to correct it,1 by 1 or ignore it (code area won't be checked).
X-position of the mouse cursor
Y-position of the mouse cursor
Y-position of the mouse cursor
Testcursor
caretPos
Attachment:===
Asked by rwniceing
at 2024-09-09 22:44:17
Point:500 Replies:7 POST_ID:829227USER_ID:12079
Topic:
Linux;;Apache Web Server
Since my disk-space is used more than 95%, Could you provide linux
command or script to find out the top 50 biggest files size in my hard-disk so that I can delete those
not-important files with bigger file size. I check du and df command not including that .
Please advise
command or script to find out the top 50 biggest files size in my hard-disk so that I can delete those
not-important files with bigger file size. I check du and df command not including that .
Please advise
Author: rwniceing replied at 2024-09-10 00:14:33
thanks for your rely ,now I know what you mean and following command works
ls -sR /home/myaccount | perl -lne 'm#^(/.*):# and $d=$1; m/^(d+)s+(.*)/ and print "$1 $d/$2"' | sort -n | tail -50
ls -sR /home/myaccount | perl -lne 'm#^(/.*):# and $d=$1; m/^(d+)s+(.*)/ and print "$1 $d/$2"' | sort -n | tail -50
Expert: ozo replied at 2024-09-10 00:10:26
ls -sR /home/myaccount
Author: rwniceing replied at 2024-09-09 23:59:27
it works but including all directory from root , how can I just do it for my account directory such as "/home/myaccount" ?
Accepted Solution
Expert: ozo replied at 2024-09-09 23:55:14
500 points EXCELLENT
You could install it, or use a slightly less efficient method:
ls -sR / | perl -lne 'm#^(/.*):# and $d=$1; m/^(d+)s+(.*)/ and print "$1 $d/$2"' | sort -n | tail -50
ls -sR / | perl -lne 'm#^(/.*):# and $d=$1; m/^(d+)s+(.*)/ and print "$1 $d/$2"' | sort -n | tail -50
Author: rwniceing replied at 2024-09-09 23:49:29
Or do I need to run it in script with including perl ?
Author: rwniceing replied at 2024-09-09 23:48:45
ozo, thanks for your reply. I get this error on linux Centos when run the command on linux shell
Can't locate Heap/Simple.pm in @INC (@INC contains: /usr/local/lib/perl5/site_perl/5.16.2/x86_64-linux /usr/local/lib/perl5/site_perl/5.16.2 /usr/local/lib/perl5/5.16.2/x86_64-linux /usr/local/lib/perl5/5.16.2 .).
BEGIN failed--compilation aborted.
Can't locate Heap/Simple.pm in @INC (@INC contains: /usr/local/lib/perl5/site_perl/5.16.2/x86_64-linux /usr/local/lib/perl5/site_perl/5.16.2 /usr/local/lib/perl5/5.16.2/x86_64-linux /usr/local/lib/perl5/5.16.2 .).
BEGIN failed--compilation aborted.
Expert: ozo replied at 2024-09-09 23:36:38
ls -sR / | perl -MHeap::Simple -lne 'BEGIN{ $heap = Heap::Simple->new(elements => "Array")}m#^(/.*):# and $d=$1; m/^(d+)s+(.*)/ and $heap->insert([$1,"$d/$2"]) and print "$1 $d/$2"; $heap->count>50 and $heap->extract_top;END{print "@$_" for $heap->extract_all;} '