Skip to main content
added 52 characters in body
Source Link
Milliways
  • 61.5k
  • 32
  • 108
  • 212

You can easily get a date in any format, although I would use an ISO8601 format, which has the advantage of being unambiguous and sortable e.g.

date "+%Y%m%dT%H%M%S"

gives

20131116T122633

You can use this in a script to construct your file name, using any other charactescharacters to construct the name.

echo Test > File`date "+%Y%m%dT%H%M%S"`.txt

You can easily get a date in any format, although I would use an ISO8601 format, which has the advantage of being unambiguous and sortable e.g.

date "+%Y%m%dT%H%M%S"

gives

20131116T122633

You can use this in a script to construct your file name, using any other charactes to construct the name.

You can easily get a date in any format, although I would use an ISO8601 format, which has the advantage of being unambiguous and sortable e.g.

date "+%Y%m%dT%H%M%S"

gives

20131116T122633

You can use this in a script to construct your file name, using any other characters to construct the name.

echo Test > File`date "+%Y%m%dT%H%M%S"`.txt
Source Link
Milliways
  • 61.5k
  • 32
  • 108
  • 212

You can easily get a date in any format, although I would use an ISO8601 format, which has the advantage of being unambiguous and sortable e.g.

date "+%Y%m%dT%H%M%S"

gives

20131116T122633

You can use this in a script to construct your file name, using any other charactes to construct the name.