LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 07-16-2009, 03:29 AM   #1
jaytd
LQ Newbie
 
Registered: Jul 2009
Posts: 2

Rep: Reputation: 0
How to remove bad filename pattern from every file in one folder?


Hello Guys,
i need help with a big problem. After unpacking an iso file i get very strange reults. Every File that was unpacked gets the extension ';1' in the end. For example: start.exe;1 or picture.jpg;1

Now my question is how to remove this bad extension from every file in this folder without doing every single file by hand. May there is also a method to prevent this failure. Thank you for your Help!

jaytd
 
Old 07-16-2009, 03:43 AM   #2
PMP
Member
 
Registered: Apr 2009
Location: ~
Distribution: RHEL, Fedora
Posts: 381

Rep: Reputation: 58
try this out,

Make sure u have a backup of the files first
Code:
for i in *; do nn=`echo $i| cut -d";" -f1`; mv $i $nn;  done
 
Old 07-16-2009, 03:47 AM   #3
i92guboj
Gentoo support team
 
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,063

Rep: Reputation: 381Reputation: 381Reputation: 381Reputation: 381
Another one:

Code:
for i in *; do mv "$i" "${i/\;1/}"; done
In bash, only. However, I am nore concerned about the *why* are those files being screwed. But, if you are sure that their contents is ok, then you can rename them this way.
 
Old 07-16-2009, 03:55 AM   #4
jaytd
LQ Newbie
 
Registered: Jul 2009
Posts: 2

Original Poster
Rep: Reputation: 0
Their contents are okay. The way this ending appears is always the same: I got a simple .iso file. Then i right click on it and press "extract here". Everything works fine but i get these endings on every file that was inside the .iso file. Renaming them makes them usable again. Thank you for your answers!
 
  


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
Create folder from .rar or .r00 file with filename excluding the extension (usinBash) Techno Guy Linux - Newbie 7 01-04-2009 01:13 AM
ERROR :: The file or folder smb://<I,P.>/<Filename> does not exist rushadrenaline Linux - Networking 12 02-02-2008 01:18 AM
How to remove konqueror file/folder association drudge Linux - Newbie 6 11-04-2007 06:03 AM
Replacing a image filename with a regex pattern in a script jonaster Linux - General 1 09-05-2006 08:02 PM
Remove folder and file os2 Programming 1 03-12-2005 03:12 PM


All times are GMT -5. The time now is 01:02 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