This is a discussion on off-topic - list files on linux within the pgsql Admins forums, part of the PostgreSQL category; --> Hi people, just a rapid question related to linux How can I get the files in a directory, but ...
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| 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/ -- Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-admin |
| |||
| Óôéò 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 |
| |||
| Óôéò 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 -- Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-admin |
| |||
| 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 -- Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/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) -- Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-admin |
| ||||
| Óôéò 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 inthe original question. > -salman > -- 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 |
| Thread Tools | |
| Display Modes | |
|
|