[ncolug] Re: Bash One Liner for Backup File

  • From: Mike <bellyacres@xxxxxxxxx>
  • To: ncolug@xxxxxxxxxxxxx
  • Date: Wed, 10 Feb 2016 07:43:56 -0500

On 02/10/2016 12:38 AM, Rob Gibson wrote:

Chuck,

There is a one-liner that I have seen you use to make a copy of a file
you are modifying with a datestamp appended to the filename, and I have
been trying to rack my brain for that one-liner.

If I recall, it used 'cp' with a single argument?

Thanks,
Rob

Not Chuck, but this should work...

cp devmem2.c devmem2.c-$(date +'%Y-%m-%d')

Mike

To unsubscribe send to ncolug-request@xxxxxxxxxxxxx with 'unsubscribe' in the 
Subject field.

Other related posts: