Help answer threads with 0 replies.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 04-13-2003, 02:08 PM   #1
Registered: Apr 2002
Distribution: Gentoo, Slackware
Posts: 63

Rep: Reputation: 15
Mass Rename

I need to append the extention off about a 100 files in a directory (i.e. if the file is named File.OK it needs to become File). I've been searching and trying to get this to work a number of different ways, but with no sucess.

I almost forgot the main problem was that most of the file names contain spaces, and that seems to be causing most of my problems.

So I need to get a way around the spaces in the file name and remove the extention.

Last edited by wickdgin; 04-13-2003 at 02:10 PM.
Old 04-13-2003, 02:18 PM   #2
Senior Member
Registered: Dec 2002
Location: England
Distribution: Used to use Mandrake/Mandriva
Posts: 2,794

Rep: Reputation: 116Reputation: 116
I believe you need to write a small shell script to do this.
Something like:
List the files, then for each file, search for the last ".*", and rename the file.
Old 04-13-2003, 02:29 PM   #3
Registered: Apr 2002
Distribution: Gentoo, Slackware
Posts: 63

Original Poster
Rep: Reputation: 15
Got it!

That's basicly what I was trying to do doing (in BASH), but I got it done with a quick C program I just wrote.

Thanks for your help.


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
BASH USAGE: mass files rename sirpelidor Linux - General 8 09-20-2005 12:36 AM
is there a way to rename a user? Pear-i Linux - General 3 09-09-2005 04:16 PM
Mass log out. Thrifty Linux - General 2 02-16-2004 03:53 PM
Rename my pc ? Tanc Linux - Newbie 6 09-13-2003 08:28 AM
slacky x-mass :) Tinkster Slackware 5 12-25-2002 07:08 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 02:40 AM.

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