filter out files when ls command is used
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Unix and Linux reviews > Free Unix support > Unix Shell > filter out files when ls command is used




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    filter out files when ls command is used  
Petterson Mikael


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
01-29-07 12:19 PM

Hi,

When I run the ls command I want to "filter" out files that is not to be
included in when making operations to the files. Any idea how I can to
that. These files shall not be included:

XTInput.java XPInput.java XRInput.jav XEInput.java

The ones to be filtered out are these for the moment but will change in
the future.

cheers,

//mikael





[ Post a follow-up to this message ]



    Re: filter out files when ls command is used  
Radoulov, Dimitre


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
01-29-07 12:19 PM


"Petterson Mikael"  wrote ...
[...]
> When I run the ls command I want to "filter" out files that is not to be
> included in when making operations to the files. Any idea how I can to
> that. These files shall not be included:
>
> XTInput.java XPInput.java XRInput.jav XEInput.java
[...]

ksh

ls  !(X[EPRT]Input.jav?(a))

bash

shopt -s extglob
ls  !(X[EPRT]Input.jav?(a))


Regards
Dimitre







[ Post a follow-up to this message ]



    Re: filter out files when ls command is used  
ramesh.lakshminarayana@gmail.com


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
01-29-07 06:17 PM


You can actually do this

ls -l |grep -v 'Input'

this might also stop all the files containing 'Input', if you have
other than the mentioned files.

ls -l |grep -v ' XTInput.java'|grep -v 'XPInput.java' |grep -v
'XRInput.jav' |grep -v 'XEInput.java'

This will certainly not include the below mentioned files.

Ramesh Lakshmi




On Jan 29, 4:18 am, Petterson Mikael
<mikael.petter...@era.ericsson.se> wrote:
> Hi,
>
> When I run the ls command I want to "filter" out files that is not to be
> included in when making operations to the files. Any idea how I can to
> that. These files shall not be included:
>
> XTInput.java XPInput.java XRInput.jav XEInput.java
>
> The ones to be filtered out are these for the moment but will change in
> the future.
>
> cheers,
>
> //mikael






[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 11:37 PM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register