![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| HP-UX HP-UX (Hewlett Packard UniX) is Hewlett-Packard's proprietary implementation of the Unix operating system, based on System V. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Sorting problem | cool4naren | UNIX for Dummies Questions & Answers | 4 | 07-31-2007 05:28 AM |
| sorting/arrangement problem | Abhishek Ghose | Shell Programming and Scripting | 7 | 05-25-2007 06:19 AM |
| Sorting/Filed Defining/Output problem | TiredOrangeCat | Shell Programming and Scripting | 1 | 02-11-2007 09:41 PM |
| Sorting problem "sort -k 16,29 sample.txt > output.txt" | ganapati | Shell Programming and Scripting | 3 | 08-01-2006 02:55 AM |
| Problem in sorting the file | vishnu_vaka | Shell Programming and Scripting | 1 | 12-04-2005 08:47 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Sorting problem....
hey mate. ive got a sorting problem that i would like to share...
i made a script that sorts the bdf command and redirected the output to a file. the output of the file is: 691416 34% / 851552 7% /stand 7203048 31% /var 23637584 26% /var/adm/crash 2968864 37% /usr 1744096 16% /tmp 2381048 54% /opt 514848 51% /home 17% /home/com 986359 81% /home/appl 36% /backup_master 91% /backup 8227336 17% /home/com 2593361 36% /backup_master 5903593 91% /backup please tell me how to sort out the file so that i can remove the ones in bold (blue) because they are just copies of the file systems in bold (black). please help me... |
| Forum Sponsor | ||
|
|
|
#2
|
||||
|
||||
|
i don't think you really need to sort
Code:
cat file.txt |sed -n '/[0-9]* [0-9]*%/p' |
|
#3
|
|||
|
|||
|
thanks mate. it works.... do you know how to further sort the output so that only the ones with 80% up are shown
Last edited by jarod004; 06-24-2007 at 03:37 PM. |
|
#4
|
|||
|
|||
|
Quote:
Code:
$ cat file 691416 34% / 851552 7% /stand 7203048 31% /var 23637584 26% /var/adm/crash 2968864 37% /usr 1744096 16% /tmp 2381048 54% /opt 514848 51% /home 17% /home/com 986359 81% /home/appl 36% /backup_master 91% /backup 8227336 17% /home/com 2593361 36% /backup_master 5903593 91% /backup $ awk -F"[ %]" ' $2 > 80 ' file 986359 81% /home/appl 5903593 91% /backup |
|
#5
|
|||
|
|||
|
thanks mate. i also found a nifty syntax that does the same... still, thanks...
cat file|grep [8-9][0-9]% |
|||
| Google The UNIX and Linux Forums |