![]() |
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 |
| removing particular lines ending with a .cnt extension in a text file | ramky79 | SUN Solaris | 2 | 03-03-2008 05:17 AM |
| Reading filenames with extension .xml | bhalotias | Shell Programming and Scripting | 3 | 01-21-2008 12:02 PM |
| Removing certain text from multiple filenames | Djaunl | UNIX for Dummies Questions & Answers | 6 | 01-15-2008 05:52 PM |
| Removing the extension and FTP the files | pradkumar | Shell Programming and Scripting | 1 | 02-14-2007 02:01 PM |
| Adding an extension to a group of filenames | pepintheshort | UNIX for Dummies Questions & Answers | 9 | 04-09-2004 09:11 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
removing the extension from all filenames in a folder
Hi there,
I'm pretty new to UNIX and have tried trawling through this forum to find an answer to what I want to try to do, which I'm sure is very simple but I don't know how to do it. What I have a a folder that contains multiple files that I have copied from Windows and I want to remove the .xls, for example, extension of the files without changing the rest of the filename. How do I do this please? Apologies if this does appear elsewhere in this forum and thanks in advance for any help. |
|
||||
|
Thanks for the response. Worked beautifully.
Any chance you have the time to explain exactly what the command you provided did/meant? Obviously I know what the outcome was but if you have time to explain all the parameters that'd be great. Don't worry if you don't, I'm sure, with time, I'll be able to figure it out for myself. Once again, thanks for the swift response ![]() |
|
||||
|
s -> substitute command
\(.*\).xls -> This saves the pattern before the dot (filename without extension) which is recalled with \1. The & gives the original line (filename with extension) so "mv & \1" prints: mv "the filename with extension" "filename without the extension" A useful link with some tutorials: Unix Tutorials/Programming Tutorials/Shell Scripting Tutorials Hope this helps. Regards Last edited by Franklin52; 05-21-2008 at 01:56 PM.. |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|