This is a discussion on Grep and remove files within the Linux software forums, part of the Linux Getting Started category; I'm new and not understanding how to grep and remove files. For example I have two different situations A) Remove ...
|
|||||||
| Register | FAQ | Members List | Calendar | Forgotten your password? | Mark Forums Read |
|
|||
|
I'm new and not understanding how to grep and remove files. For example I have two different situations
A) Remove all files matching criteria, file name start with digits only B) Second is I have name of all files in file called track.log. how to grep and remove Sample track.log file /home/app/trackv2/0104zle.log /home/app/trackv2/idem44.log /home/app/trackv2/idem224.log /home/app/trackv2/0104zyt.log /home/app/trackv2/0104gbw.log So on? Sorry for my poor english.. plz some1 helpme |
| Sponsored Links | ||
|
|
|
||||
|
Quote:
Code:
ls | grep -E "^[0-9]" | xargs rm Code:
grep -E "/[0-9]" track.log | xargs rm
__________________
Rocky Jr. You may have my body & soul, but you will never touch my pride! If you have knowledge, let others light their candles at it. Certified to work on HP-UX / Sun Solaris / RedHat |
![]() |
| Bookmarks |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) |
|
| Thread Tools | |
| Display Modes | |
|
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Uninstall remove yum packages | zafar466 | Linux software | 5 | 01-19-2008 10:38 PM |
| How to remove grub vista? | raj | Windows Xp/2000/2003 server administration | 1 | 10-08-2007 02:02 AM |
| Grep ip address in Linux or UNIX | sweta | Getting started tutorials | 0 | 07-27-2007 07:47 AM |
| linux password remove | Linux software | 1 | 01-18-2006 08:43 PM | |
| Script to remove executable files | sweta | Shell scripting | 4 | 03-12-2005 02:21 PM |