|
|||||||
| Forums | Search Forums | Register | Forum Rules | Man Pages | Albums | FAQ | Members | Calendar | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
|
|
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Move Command with Adding Yesterday date
How to move a file with mv command by adding yesteday's date(YYYYMMDD) at the end
Example: /a/abc.txt should be moved to the same folder /a/abc_yyyymmdd.txt YYYYMMDD should be yesterday's date |
| Sponsored Links | ||
|
|
#2
|
||||
|
||||
|
With GNU date: Code:
mv abc.txt abc_$(date -d "-1 day" +%Y%m%d).txt |
| Sponsored Links | ||
|
|
#3
|
|||
|
|||
|
Thanks a lot!
|
| Sponsored Links | ||
|
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Need help in Shell Script comparing todays date with Yesterday date from Sysdate | kumarmsk1331 | Shell Programming and Scripting | 0 | 07-29-2011 04:49 PM |
| Using the find command to copy yesterday date only files | Colel2 | UNIX Desktop for Dummies Questions & Answers | 4 | 05-28-2009 08:18 PM |
| Compare date from db2 table to yesterday's Unix system date | sasaliasim | Shell Programming and Scripting | 9 | 12-01-2008 10:37 PM |
| yesterday date month/date | skully | Shell Programming and Scripting | 5 | 06-24-2008 05:51 AM |
| get yesterday's date? | fedora | Shell Programming and Scripting | 1 | 12-08-2006 02:28 PM |
|
|