FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
scripts/scripts/datedir at master · pixelb/scripts · GitHub
pixelb
/
scripts
Public
Notifications
You must be signed in to change notification settings
Fork
189
Star
789
Code
Issues
3
Pull requests
1
Actions
Projects
Wiki
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
scripts
/
scripts
/
datedir
Copy path
More file actions
More file actions
Latest commit
History
History
History
executable file
·
16 lines (14 loc) · 547 Bytes
Breadcrumbs
scripts
/
scripts
/
datedir
Copy path
File metadata and controls
executable file
·
16 lines (14 loc) · 547 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!
/bin/sh
#
Set modification date of the current (or specified) directory
#
to the earliest file in that directory.
#
#
License: LGPLv2
#
#
I use this when I don't want to record when I (re)filed something,
#
and would like the directories to be ordered by date of the contents.
#
Digital camera pictures is usually what I use this for.
[
-z
"
$1
"
]
&&
set
"
.
"
file=
`
find
$1
-maxdepth 1 -type f -printf
"
%p\t%T@\n
"
|
sort -k2,2n
|
head -1
|
cut -f1
`
[
-z
"
$file
"
]
&&
exit
filedate=
`
date --reference=
"
$file
"
+%y%m%d%H%M
`
touch -c -t
$filedate
$1
Back
|
FazBrowse Home
|
New Git URL