Visit Jeremy's Blog.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 11-11-2014, 10:33 AM   #1
Registered: Mar 2012
Posts: 115

Rep: Reputation: Disabled
mv command with timestamps not working on expected

Hi Linux Guru's
I was trying a lot of variety to include on my script on moving files with timestamps but I get the wrong output

I used this:
mv /var/tmp/pogi_install_note /var/tmp/pogi_install_note.`date +%F-%H%M%S`

but got this

[root@pogi ~]# ls -ltrh /var/tmp/pogi*
-rwxrwxrwx 1 root root 81 Nov 11 03:57 /var/tmp/pogi_install_note.file.file-035756OURCE
-rwxrwxrwx 1 root root 81 Nov 11 04:35 /var/tmp/pogi_install_note.file.file-043527OURCE
-rwxrwxrwx 1 root root 81 Nov 11 05:05 /var/tmp/pogi_install_note.file.file-050529OURCE
-rwxrwxrwx 1 root root 81 Nov 11 06:19 /var/tmp/pogi_install_note.file.file-061943OURCE
Old 11-11-2014, 11:03 AM   #2
Senior Member
Registered: Nov 2004
Distribution: Debian, Ubuntu, LinuxMint, Slackware, SysrescueCD, Raspbian
Posts: 2,192

Rep: Reputation: 339Reputation: 339Reputation: 339Reputation: 339
Hmmm. Your command worked just fine for me. Don't know what's different about your system.

$ ls
$ > xyz
$ mv xyz xyz.`date +%F-%H%M%S`
$ ls
Old 11-11-2014, 11:29 PM   #3
Registered: Jul 2004
Location: Chennai, India
Distribution: UBUNTU 5.10 since Jul-18,2006 on Intel 820 DC
Posts: 843

Rep: Reputation: 201Reputation: 201Reputation: 201
Looks like it's not issued from the command line but from within a text editor that has some smart substitution. (file.file for the -f and SOURCE for the -s).



Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
I don't understand why log timestamps are UTC but date command is local time Rogue45 Linux - Newbie 5 07-19-2013 03:39 PM
matching not working as expected... sebelk Programming 1 07-05-2011 07:17 AM
[SOLVED] >> not working as expected MartenH Linux - Newbie 5 08-22-2010 10:35 AM
ln command not working as expected walterbyrd Linux - Software 3 01-04-2008 01:51 PM
alias not working as expected marozsas Linux - General 3 06-01-2006 12:46 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:44 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration