file datum
Sziasztok! Egy alkonyvtarban levo osszes file (esetleg alkonyvtar) kozul a legfiatalabb (legutoljara modositott/letrehozott) modositasanak datumat szeretnem megtudni. Most valahogy igy csinalom: MDT=`find . -printf '%AY-%Am-%Ad %AH:%AM:%AS\n' | sort -r | head -1` Van ettol egyszerubb modszer? A lenyeg, hogy ezzel muveletet is kell vegrehajtani (osszehasonlitas), igy machine-readable kimenetet kellene generalni. Nem fontos a formatum, igazabol az epoch lenne a tokeletes... -Sygma _ linux lista - linux@mlf.linux.rulez.org http://mlf2.linux.rulez.org/mailman/listinfo/linux
Re: file datum
Egy alkonyvtarban levo osszes file (esetleg alkonyvtar) kozul a legfiatalabb (legutoljara modositott/letrehozott) modositasanak datumat szeretnem megtudni. man {ls,tail,cat} :-D gondolom 'ls -t' jo lesz neked. Hogy epoch legyen: for file in `ls -t | tail -1`; do stat -c %Y $file ; done Igy sem egyszeru a parancssor, de legalabb time-since-epoch. Gondolom muszaly lesz for-al csinalni, mert a stat nem fogad el file-nevet stdin-rol, tehat pipe-olni nem lehet, de ha ez igy ebben a formaban nem igaz, majd valaki remelem kijavit :-) bye Zsolt. -- English Version: This message has been scanned for viruses and dangerous content, and is believed to be clean. Versiunea Romana: Mesajul a fost scanat si este considerat a fi neinfectat. _ linux lista - linux@mlf.linux.rulez.org http://mlf2.linux.rulez.org/mailman/listinfo/linux
Re: file datum
ls -lart --time-style=long-iso | tail -1 aztan ebbol meg ki kell banyaszni az akarhanyadik mezoket, ami az ido, hazi feladat a 'cut' nevu segedprogrammal. cut-al bajos lesz, mert nem tudod hany karakter a file-size es gondolom hogy delimiter-t csak szokozt lehetne itt alkalmazni. bye Zsolt. -- English Version: This message has been scanned for viruses and dangerous content, and is believed to be clean. Versiunea Romana: Mesajul a fost scanat si este considerat a fi neinfectat. _ linux lista - linux@mlf.linux.rulez.org http://mlf2.linux.rulez.org/mailman/listinfo/linux
Re: file datum
Hello, Ez nem jo? ls -at --time-style=+%s | head -n 1 Nem ellenoriztem annyira azert :) -- - Gábor _ linux lista - linux@mlf.linux.rulez.org http://mlf2.linux.rulez.org/mailman/listinfo/linux
Re: file datum
On Mon, Jun 19, 2006 at 02:31:01PM +0200, Gábor Lénárt wrote: ls -at --time-style=+%s | head -n 1 Nem ellenoriztem annyira azert :) El is rontottam persze :) ls -lat --time-style=+%s | head -n 2 | tail -n 1 vagy inkabb: ls -lrat --time-style=+%s | tail -n 1 Na a kerdes hogy akkor ebbol most a timestamp kell-e csak, vagy a nev, vagy mindketto, stb ... Nyilvan ha csak a file neve kell, akkor egyszerubb: ls -at | head -n 1 Aztan arra egy stat, ls vagy ami jolesik ha kell maga a timestamp is utana. -- - Gábor _ linux lista - linux@mlf.linux.rulez.org http://mlf2.linux.rulez.org/mailman/listinfo/linux
Re: file datum
ls -lart --time-style=long-iso | tail -1 aztan ebbol meg ki kell banyaszni az akarhanyadik mezoket, ami az ido, hazi feladat a 'cut' nevu segedprogrammal. cut-al bajos lesz, mert nem tudod hany karakter a file-size es gondolom hogy delimiter-t csak szokozt lehetne itt alkalmazni. awk: ls -lR | awk '{print $6,$7}' | sort -r | head -1 de igy sem rovidebb, tomorebb, stb. mint a kerdezoe. Udv.: Laci -- Laszlo Baranyai [EMAIL PROTECTED] Corvinus University of Budapest _ linux lista - linux@mlf.linux.rulez.org http://mlf2.linux.rulez.org/mailman/listinfo/linux