LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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, 03: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 03:10 PM.
 
Old 04-13-2003, 03: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, 03: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


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


All times are GMT -5. The time now is 05:01 AM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration