pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
off-topic - list files on linux
6+ messages / 4 participants
[nested] [flat]

* off-topic - list files on linux
@ 2008-03-28 12:39  A.Burbello <burbello3000@yahoo.com.br>
  0 siblings, 3 replies; 6+ messages in thread

From: A.Burbello @ 2008-03-28 12:39 UTC (permalink / raw)
  To: pgsql-admin

Hi people,

just a rapid question related to linux
How can I get the files in a directory, but not the
last file updated/created?

I could get the last file updated with:
ls -t1p  | grep -v / | grep -v backup | head -1

How can I get the inverse list, other files without
the last??

Thank you in advance.


      Abra sua conta no Yahoo! Mail, o único sem limite de espaço para armazenamento!
http://br.mail.yahoo.com/




^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: off-topic - list files on linux
@ 2008-03-28 13:01  Achilleas Mantzios <achill@matrix.gatewaynet.com>
  parent: A.Burbello <burbello3000@yahoo.com.br>
  2 siblings, 0 replies; 6+ messages in thread

From: Achilleas Mantzios @ 2008-03-28 13:01 UTC (permalink / raw)
  To: pgsql-admin; +Cc: A.Burbello <burbello3000@yahoo.com.br>

Óôéò Friday 28 March 2008 14:39:53 ï/ç A.Burbello Ýãñáøå:
> ls -t1p  | grep -v / | grep -v backup | head -1

maybe:
ls -t1p | grep -v / | grep -v backup | grep -v `ls -t1p | grep -v / | grep -v backup | head -1`

-- 
Achilleas Mantzios



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: off-topic - list files on linux
@ 2008-03-28 13:01  Achilleas Mantzios <achill@matrix.gatewaynet.com>
  parent: A.Burbello <burbello3000@yahoo.com.br>
  2 siblings, 1 reply; 6+ messages in thread

From: Achilleas Mantzios @ 2008-03-28 13:01 UTC (permalink / raw)
  To: pgsql-admin; +Cc: A.Burbello <burbello3000@yahoo.com.br>

Óôéò Friday 28 March 2008 14:39:53 ï/ç A.Burbello Ýãñáøå:
> ls -t1p  | grep -v / | grep -v backup | head -1

maybe:
ls -t1p | grep -v / | grep -v backup | grep -v `ls -t1p | grep -v / | grep -v backup | head -1`

-- 
Achilleas Mantzios

-- 
Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: off-topic - list files on linux
@ 2008-03-28 17:38  salman <salmanb@quietcaresystems.com>
  parent: Achilleas Mantzios <achill@matrix.gatewaynet.com>
  0 siblings, 1 reply; 6+ messages in thread

From: salman @ 2008-03-28 17:38 UTC (permalink / raw)
  To: Achilleas Mantzios <achill@matrix.gatewaynet.com>; +Cc: pgsql-admin@postgresql.org, "A.Burbello" <burbello3000@yahoo.com.br>



Achilleas Mantzios wrote:
> Óôéò Friday 28 March 2008 14:39:53 ï/ç A.Burbello Ýãñáøå:
>> ls -t1p  | grep -v / | grep -v backup | head -1
> 
> maybe:
> ls -t1p | grep -v / | grep -v backup | grep -v `ls -t1p | grep -v / | grep -v backup | head -1`
> 

1) the -e flag for grep can be used to group strings so you don't have 
to pipe multiple times (eg: grep -i -e bleh -e bleh2 -e bleh3 -ve backup)

2) wouldn't find be easier to use? find . -maxdepth 1 -type -f -print

-salman



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: off-topic - list files on linux
@ 2008-03-29 14:04  hubert depesz lubaczewski <depesz@depesz.com>
  parent: A.Burbello <burbello3000@yahoo.com.br>
  2 siblings, 0 replies; 6+ messages in thread

From: hubert depesz lubaczewski @ 2008-03-29 14:04 UTC (permalink / raw)
  To: A.Burbello <burbello3000@yahoo.com.br>; +Cc: pgsql-admin

On Fri, Mar 28, 2008 at 09:39:53AM -0300, A.Burbello wrote:
> How can I get the files in a directory, but not the
> last file updated/created?
> I could get the last file updated with:
> ls -t1p  | grep -v / | grep -v backup | head -1
> How can I get the inverse list, other files without
> the last??

ls -t1p | grep -v / | grep -v backup | tac | tail -n +2

depesz

-- 
quicksil1er: "postgres is excellent, but like any DB it requires a
highly paid DBA.  here's my CV!" :)
http://www.depesz.com/ - blog dla ciebie (i moje CV)



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: off-topic - list files on linux
@ 2008-03-31 06:49  Achilleas Mantzios <achill@matrix.gatewaynet.com>
  parent: salman <salmanb@quietcaresystems.com>
  0 siblings, 0 replies; 6+ messages in thread

From: Achilleas Mantzios @ 2008-03-31 06:49 UTC (permalink / raw)
  To: pgsql-admin; +Cc: salman <salmanb@quietcaresystems.com>; A.Burbello <burbello3000@yahoo.com.br>

Óôéò Friday 28 March 2008 19:38:02 ï/ç salman Ýãñáøå:
> 
> Achilleas Mantzios wrote:
> > Óôéò Friday 28 March 2008 14:39:53 ï/ç A.Burbello Ýãñáøå:
> >> ls -t1p  | grep -v / | grep -v backup | head -1
> > 
> > maybe:
> > ls -t1p | grep -v / | grep -v backup | grep -v `ls -t1p | grep -v / | grep -v backup | head -1`
> > 
> 
> 1) the -e flag for grep can be used to group strings so you don't have 
> to pipe multiple times (eg: grep -i -e bleh -e bleh2 -e bleh3 -ve backup)
> 
> 2) wouldn't find be easier to use? find . -maxdepth 1 -type -f -print
> 
I tried to give an example, using *only* primitives that already existed in the original question.
> -salman
> 



-- 
Achilleas Mantzios



^ permalink  raw  reply  [nested|flat] 6+ messages in thread


end of thread, other threads:[~2008-03-31 06:49 UTC | newest]

Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2008-03-28 12:39 off-topic - list files on linux A.Burbello <burbello3000@yahoo.com.br>
2008-03-28 13:01 ` Achilleas Mantzios <achill@matrix.gatewaynet.com>
2008-03-28 13:01 ` Achilleas Mantzios <achill@matrix.gatewaynet.com>
2008-03-28 17:38   ` salman <salmanb@quietcaresystems.com>
2008-03-31 06:49     ` Achilleas Mantzios <achill@matrix.gatewaynet.com>
2008-03-29 14:04 ` hubert depesz lubaczewski <depesz@depesz.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox