![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | 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 !! |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Renaming multiple files | jayell | Shell Programming and Scripting | 7 | 01-12-2009 04:27 PM |
| Moving multiple files and renaming them on the fly | daemongk | Shell Programming and Scripting | 1 | 06-08-2007 01:36 PM |
| moving and renaming multiple files | rocinante | Shell Programming and Scripting | 1 | 06-07-2007 08:20 PM |
| Renaming multiple files | jxh461 | Shell Programming and Scripting | 4 | 04-01-2003 06:25 PM |
| renaming multiple files | piltrafa | UNIX for Dummies Questions & Answers | 6 | 11-10-2001 12:27 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
Renaming multiple files
Help!
I was trying to rename multiple files. Like in DOS, i decided to use wildcards and now i am missing some files. Any ideas on how to recover them? Or find out where the files went? I had these 3 files resume1.log elecresume.log compresume.log The command I ran was mv *.log *.log.bak Now elecresume.log is missing but nothing happened to the other two files. Also no new files got created i.e., the *.log.bak files. Thanks in advance. |
|
||||
|
mv works on 1 target at a time.
you cant specify multiple files unless you are moveing them to a directory. on my solaris 8 box. i get the following: Code:
$ ls *.log 1.log 2.log 3.log $ mv *.log *.log.bak mv: *.log.bak not found $ ls 1.log 2.log 3.log |
|
||||
|
If those are the only 3 files ending in .log in your directory, you could do this:
for i in `ls *.log`;do mv $i $i.bak done That would do each one individually but loop through the 3 files so you only have to do the one command. |
|
||||
|
you cant get it back unless you restore it from backup.
you shouldnt have lost the file in the first place the command should have failed per my example. mabey your os's mv command acts differntly then mine. my os: sol8 on sparc |
| Sponsored Links | ||
|
|
![]() |
| Bookmarks |
| Tags |
| solaris |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|