LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 02-26-2014, 07:27 PM   #1
stf92
Senior Member
 
Registered: Apr 2007
Location: Buenos Aires.
Distribution: Slackware
Posts: 4,442

Rep: Reputation: 76
find /tmp -xdev -type f -printf "%Ts %p\n" Why does it work?


Hi: The following command prints the file modification time in seconds since 1970-01-01 00:00:00:
Code:
find /tmp -xdev -type f -printf "%Ts %p\n"
However, I can't find the 's' in the format string in the find(1) man page. The find version is 4.4.2, the one that comes with Slackware 14.0. Do you know where I can find it documented?
 
Old 02-26-2014, 07:39 PM   #2
ljb643
Member
 
Registered: Nov 2003
Posts: 526

Rep: Reputation: Disabled
The letter after %T is passed to the C function strftime, so find handles whatever characters there that strftime does. (They aren't all documented under find, because strftime can vary from system to system.) See man 3 strftime, where %s means seconds since epoch.
 
2 members found this post helpful.
Old 02-26-2014, 08:05 PM   #3
stf92
Senior Member
 
Registered: Apr 2007
Location: Buenos Aires.
Distribution: Slackware
Posts: 4,442

Original Poster
Rep: Reputation: 76
Thank you very much. By the way, is there any way to print a file's date in the same fashion with ls? I mean, seconds from 1970?
 
Old 02-26-2014, 09:46 PM   #4
ljb643
Member
 
Registered: Nov 2003
Posts: 526

Rep: Reputation: Disabled
Code:
ls -l --time-style=+%s
 
1 members found this post helpful.
Old 02-27-2014, 06:26 AM   #5
stf92
Senior Member
 
Registered: Apr 2007
Location: Buenos Aires.
Distribution: Slackware
Posts: 4,442

Original Poster
Rep: Reputation: 76
Thank you very much.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Samba - "Word Work File L_<somenumber>.tmp" files chakkerz Linux - Server 1 05-09-2014 10:42 AM
What's the difference between "mv dir/* /tmp" and "find dir/* -print0 | xargs" ? thomas2004ch Linux - Software 8 04-19-2012 10:43 AM
FC6 Install Problem: "Unable to find any device of the type needed for instal" AeroGT3 Fedora 23 05-21-2008 10:40 PM
"/tmp/sv001.tmp/setup.bin" error while installing OO1.1.0 Choey Linux - Software 0 09-16-2003 04:52 PM
<input type="button" disabled="true" > does not work in ns4.7 or 4.9 cybercop12us Programming 2 11-29-2002 08:31 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 08:55 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration