LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


Reply
  Search this Thread
Old 11-11-2014, 11:33 AM   #1
apss_evaluator
Member
 
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, 12:03 PM   #2
haertig
Senior Member
 
Registered: Nov 2004
Distribution: Debian, Ubuntu, LinuxMint, Slackware, SysrescueCD
Posts: 2,117

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

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

Rep: Reputation: 186Reputation: 186
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).

OK
 
  


Reply


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 04:39 PM
matching not working as expected... sebelk Programming 1 07-05-2011 08:17 AM
[SOLVED] >> not working as expected MartenH Linux - Newbie 5 08-22-2010 11:35 AM
ln command not working as expected walterbyrd Linux - Software 3 01-04-2008 02:51 PM
alias not working as expected marozsas Linux - General 3 06-01-2006 01:46 PM


All times are GMT -5. The time now is 06:55 PM.

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