[opensuse] appending date to a file name
It is really sad to get old. I use to know how to do this. I want to append a date (m-d-y) to a file. The command should be something like the following using touch as and example: touch temp[command involving date] so the result is similar to "temp_07-15-16". Thanks for any suggestions. Terry -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
* Terry Eck <terry_eck@verizon.net> [07-14-16 18:56]:
It is really sad to get old. I use to know how to do this. I want to append a date (m-d-y) to a file.
The command should be something like the following using touch as and example:
touch temp[command involving date]
so the result is similar to "temp_07-15-16".
Thanks for any suggestions.
maybe are they photographs? -- (paka)Patrick Shanahan Plainfield, Indiana, USA @ptilopteri http://en.opensuse.org openSUSE Community Member facebook/ptilopteri http://wahoo.no-ip.org Photo Album: http://wahoo.no-ip.org/gallery2 Registered Linux User #207535 @ http://linuxcounter.net -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On Thu 14 Jul 2016 05:54:53 PM CDT, Terry Eck wrote:
It is really sad to get old. I use to know how to do this. I want to append a date (m-d-y) to a file.
The command should be something like the following using touch as and example:
touch temp[command involving date]
so the result is similar to "temp_07-15-16".
Thanks for any suggestions.
Terry
Hi If you use +\ to add formatting to the date command.... touch temp_`date +\%m-%d-%y` -- Cheers Malcolm °¿° LFCS, SUSE Knowledge Partner (Linux Counter #276890) openSUSE Leap 42.1|GNOME 3.16.2|4.1.26-21-default up 4:15, 2 users, load average: 0.07, 0.12, 0.18 CPU AMD Athlon(tm) II X4 635 @ 2.90GHz | GPU Nvidia GeForce 8800 GT -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
Thanks to both Malcolm and Carlos for two versions of the solution I needed. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 On 2016-07-15 00:54, Terry Eck wrote:
It is really sad to get old. I use to know how to do this. I want to append a date (m-d-y) to a file.
The command should be something like the following using touch as and example:
touch temp[command involving date]
touch temp_`date --iso=d` I use that format for stamps, because it sorts automatically. Year-month-day. - -- Cheers / Saludos, Carlos E. R. (from 13.1 x86_64 "Bottle" (Minas Tirith)) -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (GNU/Linux) iF4EAREIAAYFAleIHxgACgkQja8UbcUWM1y6FQD+NAFcX2CVFLdcYCcuPdoM8/cK VNxixQ8blCTENoWSMnoA/30GxDQWsRT2UeMtr04hJSmAXJRpPpmZJ3oIw++YNMUh =aY84 -----END PGP SIGNATURE----- -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
participants (4)
-
Carlos E. R.
-
Malcolm
-
Patrick Shanahan
-
Terry Eck