View Single Post

  #2 (permalink)  
Old 03-29-2006, 03:20 PM
nixcraft's Avatar
nixcraft nixcraft is offline
Never say die
User
 
Join Date: Jan 2005
Location: BIOS
My distro: Ubuntu
Posts: 1,101
Rep Power: 10
nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute
Default

Both stat and ls -l are not suitable for this job. Use date command formatting.

Code:
echo $(date +"%b-%d-%y").log.txt
More examples
Code:
NOW=$(date +"%b-%d-%y")
cp log.txt "$NOW.log.txt"
ls *.txt
See our article Creating report/log file names with date in filename for more info http://www.cyberciti.biz/nixcraft/vi...-reportlog.php
__________________
Vivek | My personal blog
Linux Evangelist
Play hard stay cool
Reply With Quote