...making Linux just a little more fun!
[ In reference to "/lg_tips.html" in LG#issue75 ]
Jim Cox [jim.cox at idt.net]
Another option, though I'm not sure if it fits the OP's constraint of "plain shell methods", is stat with a custom format:
prompt$ stat -c %y /tmp/teetime.log 2009-08-31 09:30:11.000000000 -0400
I stumbled across this while looking for filesizes in scripts, seemed a bit cleaner v. cut against ls output:
prompt$ stat -c %s /tmp/teetime.log 7560497
Jim Cox [jim.cox at idt.net]
Another option, though I'm not sure if it fits the OP's constraint of "plain shell methods", is stat with a custom format:
prompt$ stat -c %y /tmp/teetime.log 2009-08-31 09:30:11.000000000 -0400
I stumbled across this while looking for filesizes in scripts, seemed a bit cleaner v. cut against ls output:
prompt$ stat -c %s /tmp/teetime.log 7560497
Thomas Adam [thomas.adam22 at gmail.com]
2009/8/31 Jim Cox <[email protected]>:
> Another option, though I'm not sure if it fits the OP's constraint of > "plain shell methods", is stat with a custom format: > > prompt$ stat -c %y /tmp/teetime.log > 2009-08-31 09:30:11.000000000 -0400 > > I stumbled across this while looking for filesizes in scripts, seemed a > bit cleaner v. cut against ls output: > > prompt$ stat -c %s /tmp/teetime.log > 7560497
Uh huh, or see:
ls --time-style=+%s -l
Or my preferred method:
find . -printf '%f:%A\n'
(Find uses stat(2) under the hood anyway.)
-- Thomas Adam
Thomas Adam [thomas.adam22 at gmail.com]
2009/8/31 Thomas Adam <[email protected]>:
> 2009/8/31 Jim Cox <[email protected]>: >> Another option, though I'm not sure if it fits the OP's constraint of >> "plain shell methods", is stat with a custom format: >> >> prompt$ stat -c %y /tmp/teetime.log >> 2009-08-31 09:30:11.000000000 -0400 >> >> I stumbled across this while looking for filesizes in scripts, seemed a >> bit cleaner v. cut against ls output: >> >> prompt$ stat -c %s /tmp/teetime.log >> 7560497 > > Uh huh, or see: > > ``` > ls --time-style=+%s -l > ''' > > Or my preferred method: > > ``` > find . -printf '%f:%A\n' > '''
My '@' disappeared:
``` find . -printf '%f:%A@\n' '''
-- Thomas Adam