-
Notifications
You must be signed in to change notification settings - Fork 10
/
date2name.1.txt
143 lines (88 loc) · 3.57 KB
/
date2name.1.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
date2name(1)
==========
Name
----
date2name - add datestamps to file- and directorynames
Synopsis
--------
date2name [ options ] <file[s]>
Introduction
------------
date2name adds ISO 8601+ compatible datestamps (YYYY-MM-DD,
link:http://datestamps.org/index.shtml[ISO 8601+ webpage]) to file- and
directorynames or converts datestamps between known datestamp formats.
Per default, date2name uses the modification time of matching files and
directories to add a datestamp at the beginning of the file- or directoryname.
Executed with an examplefilename "file" this results e.g. in "2008-12-31_file"
if the 31st of december 2008 is the modification time of the file.
If an existing timestamp is found, its style will be converted to the selected
ISO datestamp format but the numbers stays the same.
Executed with an examplefilename "20071130-file", date2name reformats the
existing datestamp to the (default) datestamp format. In this example it
results in "2007-11-30-file".
There are various options to modify the default behaviour of date2name.
Options
-------
The following options are supported:
*-h*, *--help*::
Display usage information and exit.
*-d*, *--directories*::
Modify only directory names. Default is: modify directory names as well as file
names (including links).
*-f*, *--files*::
Modify only file names including links. Default is: modify directory names as
well as file names.
*-C* *--compact*::
Use compact datestamp format: YYYYMMDD
*-M* *--month*::
Use datestamp format with year and month: YYYY-MM
*-w* *--withtime*::
Use long datestamp format including timestamp: YYYY-MM-DDThh.mm.ss
*-m*, *--mtime*::
Use modification time for generating new datestamps. (default)
*-c*, *--ctime*::
Use creation time for generating new datestamps.
*-q*, *--quiet*::
Do not output anything but just errors on console.
*-v*, *--verbose*::
Be verbose when writing output. Good for investigating unwanted behaviour in
combination with dryrun mode.
*-s*, *--dryrun*::
Do not modify any names, just simulate a dry run.
*--nocorrections*::
Do not modify existing datestamps, just add a datestamp to each item given.
*--version*::
Print out version information and exit.
Usage examples
--------------
# date2name -fs *pdf
Simulate, what datestamps would be added to all files with the extension "pdf".
# date2name -f *pdf
Add datestamps to all files with the extension "pdf" in the current directory.
# date2name *
Add datestamp to all files and directories in the current directory. If any
known datestamp is found, modify the format to the default ISO format
YYYY-MM-DD.
# date2name --withtime procmail.log
Add a long datestamp (including timestamp) to the file "procmail.log".
# date2name --files --month 20*
Add datestamps to all files beginning with "20" in the current directory in the
format YYYY-MM or (more likely due to the "20"-condition) modify known
datestamps to the YYYY-MM one.
Note on timestamp format including time
---------------------------------------
Other that defined in ISO 8601+ the delimiter between hours, minutes, and
seconds is not a colon but a dot. Colons are causing several problems on
different file systems and are there fore replaced with the (older) DIN 5008
version with dots.
Online Ressources
-----------------
Check out the link:http://Karl-Voit.at/scripts/#date2name[date2name webpage].
ISO 8601+ annoted and DIN 5008 link:http://www.cl.cam.ac.uk/~mgk25/iso-time.html[Cambridge Webpage]
Bugs
----
Please report feedback, bugreports and wishes <<X7,to the author>>.
[[X7]]
Author
------
Karl Voit <[email protected]>