![]() |
|
|
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 |
| awk - Counting number of similar lines | dhanamurthy | Shell Programming and Scripting | 8 | 05-16-2008 07:00 AM |
| Appending line number to each line and getting total number of lines | chiru_h | Shell Programming and Scripting | 2 | 03-25-2008 10:19 AM |
| Searching filenames containing certain text??? | skyineyes | UNIX for Advanced & Expert Users | 6 | 01-16-2008 07:48 AM |
| Removing certain text from multiple filenames | Djaunl | UNIX for Dummies Questions & Answers | 6 | 01-15-2008 05:52 PM |
| changing filenames in a directory to a number within a loop | visitorQ | Shell Programming and Scripting | 30 | 12-14-2007 01:43 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Appending text to a number of similar filenames
Hi,
I was wondering if there was a way to append something to filenames based on a wildcard. For example, if I have the following files in a directory: blah1 blah2 blah3 blah4 blah5 I want to rename these all to: blah1.txt blah2.txt blah3.txt blah4.txt blah5.txt Is there a way to select all the blah files (using say, 'blah*'?) and then appending the same text to the end of them? I was looking at the mv command, but I was unsure of how to take all the filenames after saying 'mv blah*' and append text to them. Thanks, Dan |
|
||||
|
Wow, I never even thought of using a loop. That works perfectly!
Just one more quick question: Is there a similar method that will allow me to remove certain text from a number of files? For example, let's say I want to remove the .txt from all the files. I apologize if this should easily follow from the above example, but I'm pretty new to this type of manipulation. Thanks a lot, Dan |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|