Hallo, Am Sun, 23 Jan 2005, Dr. Jürgen Vollmer schrieb:
Am Sonntag, 23. Januar 2005 18:15 schrieb Ekkard Gerlach:
Wie bekomme ich das Datum einer Datei heraus? Ich mein das Datum, das bei z.B. ls -l dabeisteht. Es reicht natürlich der Unix-Timestamp. Ich habe übrigens keine Lust das Datum aus ls -l mit awk oder sed herauszukratzen, zumal ls -l als root und als user unterschiedlich ausfällt. Es muß doch irgendeinen bash-Befehl geben, der mir das Datum auswirft, oder? [..] man stat: display file or filesystem status
dh@slarty[2]: ~ (0)$ stat bash: stat: command not found dh@slarty[2]: ~ (127)$ rpm -q coreutils coreutil fileutils fileutil package coreutils is not installed package coreutil is not installed package fileutils is not installed fileutil-4.0-75 dh@slarty[2]: ~ (3)$ LANG=C ls -l --full-time .bashrc | awk '{printf "%s %s %s %s %s\n", $6,$7,$8,$9,$10;}' Thu Oct 28 19:55:26 2004 dh@slarty[2]: ~ (0)$ perl -e 'print "", (stat(".bashrc"))[9], "\n";' 1098986126 dh@slarty[2]: ~ (0)$ perl -MPOSIX -e 'print ctime( (stat(".bashrc"))[9] );' Thu Oct 28 19:55:26 2004 Mit stat nimmt man dann eben "stat -c '%Y'" oder "stat -c '%y'". -dnh --
mangelnde Durchblutung des Gehirns solltet ihr Jungs doch gewohnt sein, oder nicht? -- Steffi Abel und Pah, ihr seid doch nur stolz, daß bei Euch alles unter Putz ist, während bei uns die Kabel lose baumeln ... -- Michael Fesser in darw