LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-22-2009, 07:00 AM   #1
casperdaghost
Member
 
Registered: Aug 2009
Posts: 349

Rep: Reputation: 16
grep regex number decimal capital letter


i had to do a disk usage test because a server was filing up - i grepped for "G" but got some unnecessary data

so then i tried a grep '/[0-9].[0-9];[0-9]"G"/' and some other derivates but they did not work.

any ideas on regex expressions?

/home/fak1300_h6
ooprod:cops11% du --si | grep G
3.6G ./users/prodcred/data/prop
2.3G ./users/prodcred/data/price_files
8.6G ./users/prodcred/data/varsrvr
2.3G ./users/prodcred/data/services
43M ./users/prodcred/data/ops/tk_taskbook/ARCHIVED_LOGS
29k ./users/prodcred/data/kops/tk_taskbook/beta/ARCHIVED_LOGS
19M ./users/prodcred/data/kops/TOPS_ARCHIVED_LOGFILES
4.1G ./users/prodcred/data/alsrvr/archive
4.4G ./users/prodcred/data/alsrvr
64k ./users/prodcred/data/Pricing/built/matplotlib-0.98.1-py2.5-linux-i686.egg/EGG-INFO
5.2G ./users/prodcred/data/tickstorage/conqtree
2.0G ./users/prodcred/data/tickstorage/conqtree.auto
9.9G ./users/prodcred/data/tickstorage
du: cannot read directory `./users/prodcred/data/thdat/global_thfrd/20090413.old': Permission denied
1.9G ./users/prodcred/data/thdat
1.3G ./users/prodcred/data/voltic_i0
115M ./users/prodcred/data/Shortstock/CFG
656k ./users/prodcred/data/Shortstock/LOGS
1.9G ./users/prodcred/data/volsurf1/model_ar
1.9G ./users/prodcred/data/volsurf1
1.1G ./users/prodcred/data/xprocmon
1.1G ./users/prodcred/data/ssfmon
2.2G ./users/prodcred/data/algorouter/archive/logs
2.2G ./users/prodcred/data/algorouter/archive
2.4G ./users/prodcred/data/algorouter
340M ./users/prodcred/data/thitrace/archive/20090817/prodcred.Greenwich.all
341M ./users/prodcred/data/thitrace/archive/20090818/prodcred.Greenwich.all
341M ./users/prodcred/data/thitrace/archive/20090819/prodcred.Greenwich.all
344M ./users/prodcred/data/thitrace/archive/20090820/prodcred.Greenwich.all
1.5G ./users/prodcred/data/thitrace/archive
1.8G ./users/prodcred/data/thitrace
1.7G ./users/prodcred/data/mdusage
74G ./users/prodcred/data
1.2G ./users/prodcred/exe/tops/ch/prod_fst/old
1.2G ./users/prodcred/exe/tops/ch/prod_fst
1.3G ./users/prodcred/exe/tops/ch
0 ./users/prodcred/exe/tops/mc/GlobexBust
du: cannot read directory `./users/prodcred/exe/tops/0755': Permission denied
1.6G ./users/prodcred/exe/kops
1.7G ./users/prodcred/exe
du: `./users/prodcred/cust_data/laura2': Permission denied
57k ./users/prodcred/corba/PUBLICGK/log
6.2k ./users/prodcred/corba/PUBLICGK/tmp
1.1M ./users/prodcred/corba/PUBLICGK/beartest
18k ./users/prodcred/corba/PUBLICGK/obsolete
650k ./users/prodcred/corba/PUBLICGK/testing
1.2M ./users/prodcred/corba/PUBLICGK/test
3.0M ./users/prodcred/corba/PUBLICGK
3.2M ./users/prodcred/krist/remy/projects/Globextranslator/20050711
6.8M ./users/prodcred/krist/remy/projects/Globextranslator/20041213
13k ./users/prodcred/krist/remy/projects/Globextranslator/jun22
4.6M ./users/prodcred/krist/remy/projects/Globextranslator/20060801
15M ./users/prodcred/kris/remy/projects/Globextranslator
du: `./users/prodcred/report/ibilling/200808/summary': Permission denied
1.7G ./users/prodcred/report
du: cannot read directory `./users/prodcred/core': Permission denied
79G ./users/prodcred
79G ./users
79G .
casper:kops11%
 
Old 08-22-2009, 07:17 AM   #2
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 15,991

Rep: Reputation: 2218Reputation: 2218Reputation: 2218Reputation: 2218Reputation: 2218Reputation: 2218Reputation: 2218Reputation: 2218Reputation: 2218Reputation: 2218Reputation: 2218
Don't bother trying to format in so-called "human readable" formats. I find it easiest to just let it default and (reverse) sort the result.
 
Old 08-22-2009, 07:27 AM   #3
casperdaghost
Member
 
Registered: Aug 2009
Posts: 349

Original Poster
Rep: Reputation: 16
this is the command that everybody uses ' du --si | grep G ' - is there a better way to get the size. if it was just a raw number, that would be fine. then maybe i could 'sed10q' it just to get the top ten largest files. i do not know what the 'si' flag is. 'si' is not in the man pages, unless --si = -s -i.
 
Old 08-22-2009, 07:29 AM   #4
casperdaghost
Member
 
Registered: Aug 2009
Posts: 349

Original Poster
Rep: Reputation: 16
i agree with you on the formats - i think the guys just need to send the higher ups a format that they can quickly understand. how would you get the disk usage for this drive and then reverse sort it?

Last edited by casperdaghost; 08-22-2009 at 07:30 AM.
 
Old 08-22-2009, 07:32 AM   #5
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 15,991

Rep: Reputation: 2218Reputation: 2218Reputation: 2218Reputation: 2218Reputation: 2218Reputation: 2218Reputation: 2218Reputation: 2218Reputation: 2218Reputation: 2218Reputation: 2218
Everybody ???. Not I.
--si should be in the manpage, right after "-h". Leave it out - try this (presuming reasonably current Linux and bash)
Code:
du | sort -nr | head -n 10
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
regex in ls vs. grep jhwilliams Linux - Software 2 08-10-2007 11:14 PM
convert input text to capital letter dwarf007 Linux - General 2 07-02-2007 03:28 AM
dealing with capital and lowercase letter under /win Bonobobo Linux - General 2 02-20-2006 02:53 PM
capital letter email id sachin_keluskar Linux - Software 3 09-02-2005 11:07 AM
Have problem converting a decimal number to octal Linh Programming 4 05-20-2004 04:21 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10:49 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration