LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


Reply
  Search this Thread
Old 04-13-2003, 02:08 PM   #1
wickdgin
Member
 
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
Proud
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
wickdgin
Member
 
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.
 
  


Reply



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

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 02:47 PM.

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