![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | 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. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| bash ps; remove the header, sort and reinsert | gekeha | Shell Programming and Scripting | 3 | 07-21-2009 02:01 PM |
| bash while read how to remove \n character | papasj | Shell Programming and Scripting | 3 | 05-25-2009 09:24 PM |
| [BASH] Remove Link from Filename | Syekiya | Shell Programming and Scripting | 6 | 04-20-2009 11:12 AM |
| Remove html tags with bash | dejavu88 | Shell Programming and Scripting | 4 | 05-22-2008 01:58 PM |
| bash find and remove text | Movomito | Shell Programming and Scripting | 5 | 04-05-2008 01:48 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Selective remove awk-bash
Hi
I have a folder that contain up to 1000 subfolder. Genereally i need just 2 or 3 of them and i can know apriori the name of the subfolder i want to keep. I'd like to erase all the unnecessary subfolders. I've tried with: Code:
ls -l | awk '$8 !~ /name_fold/{print "rm -r " $8}'| sh
Code:
ls -l | awk '$8 !~ /name_fold1 || name_fold2 /{print "rm -r " $8}'| sh
Any idea? thanks D |
![]() |
| Bookmarks |
| Tags |
| awk, bash |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|