General :: Renaming MP3 Collection (Bash Script)
Dec 20, 2010
I've been trying (and trying...) to write this script. I'm a complete newbie on bash scripting. This is what I've come up so far:
Code:
./reading
| Number of characters 48
| + Current: 107_david_guetta_-_missing_you_(feat._novel).mp3
| + Changed: 107_david_guetta-missing_you_(ft._novel).mp3
| + Matched: "(feat._" substitute "(ft._"
| + Morping: "107_david_guetta-missing_you_(feat._novel).mp3" to "107_david_guetta-missing_you_(ft._novel).mp3"
'-[END] ....
View 7 Replies
ADVERTISEMENT
Feb 10, 2011
I'm trying to rename ~11000 files. What has happened is I have files in the following format:
string1_100_string2_200_string3_300.log
now the numbers 200 and 300 are sometimes below 100 and the file looks like this:
string1_100_string2_99_string3_99.log
and I want to rename such files to be like this:
string1_100_string2_099_string3_099.log
I wrote a small matlab script but it seems to take forever so thought I'd try and do it bash and have got near to nowhere....
View 3 Replies
View Related
Apr 1, 2010
I'm trying to rename a lot of files getting rid of the space on the names. For that purpose I wrote this very simple bash script, but for some reason is not working.
Code:
for i in "$(ls)"
do
j=$(echo "$i" | sed 's/ /_/g')
mv "$i" "$j"
done But what I get in return for each line is just one long file name with all the file names concatenated. I've tried with echo -e "$i" as well with no results. This has to be something really simple that I'm missing but I just can't see it.
View 11 Replies
View Related
Feb 28, 2010
I created a little bash script for renaming files from a folderEvery time i hv to put that bash script file (rename.sh) in folder Is there any ways i will call (rename.sh) from terminal without moving rename.sh into any folder ?ne More Question : Whenever i run any .sh file automatically one .sh~ file created it is my programing mistake or is it exists ?
View 7 Replies
View Related
Mar 6, 2011
I have this cool bash script that I worked hard on. But it broke down when it can across files that had non-English characters. Another small problem was getting it to descend into a directory. If it renamed a directory it would not descend into that dir to rename the other files. I would have to run the script twice on the same directory.
Here is the script:
Code:
find -type d -o -regextype egrep -iregex '(.*.ogg|.*.mp3|.*.wav)' | while read s
do
rename -v 'y/A-Z/a-z/' "$s"
done
find -type d -o -regextype egrep -iregex '(.*.ogg|.*.mp3|.*.wav)' | while read n
do
rename -v 's/ /_/g' "$n"
done
A French name like this:
Code:
Chateau De Sable (imagine accents above the letter a)
became this:
Code:
ch303242tea_de_sable
This is not what I wanted.
Why would the script not descend into a directory after it was renamed?
View 7 Replies
View Related
Jul 29, 2011
Is there a way I can do a "deep" renaming of files? For example, I can do this: rename 's/.JPG$/.jpg/' *.JPG to rename all files ending with ".JPG" to ".jpg", but this only works in the current directory. How can I make this recursive? There's not a flag (that I can see) that does this. Basically, I want to rename ALL files on my hard drive with an upper case JPG extention to make them have a lower case jpg extention.
View 9 Replies
View Related
Jul 19, 2010
I was using amarok fine with 10.04, upgraded to 10.10 alpha, still worked fine. Decided alpha had a few bugs I didn't like so I completely removed it, installed 10.04 from scratch again (I have two partitions, / and /home, only formatted /). Now I can't get amarok to build for me at all. It plays mp3's no problem but when I try to build my collection it pretends to (takes a few minutes but goes relatively fast compared to what it should take to build) then shows 0 songs. I've already tried deleting amarok inside of /home/user/.kde/share/apps/amarok
View 1 Replies
View Related
May 28, 2011
I was wondering is there another way of renaming a file aside from using mv in linux?
For example changing /home/usr/blah.txt to something like -home-usr-blah.txt
View 4 Replies
View Related
Jun 16, 2010
I am trying to find the word count of a specific word in a collection of documents, in Linux.
I have tried with grep and ack-grep in combination with wc but I can't seem to come up with a valid combination of pipes :)
View 1 Replies
View Related
Aug 23, 2010
I just started using ubuntu after being a long time windows user.
what i find really interesting is that in command line, i can type many programs and commands, eg firefox can be run via command line from anywhere. In windows cmd prompt, im used to having to run the .exe file by first navigating to it, then being able to run the .exe.
what i wanna know is how does linux know all the programs at the command line?
View 5 Replies
View Related
Apr 21, 2011
i want to upgrade my kernel of auditor security collection which i have installed on my hardisk.The kernel version is 2.6.11.
View 12 Replies
View Related
Dec 18, 2010
What's the easiest way to rename (change the volume label of) a fat16 volume (e.g. on a USB drive) from linux? It seems like mlabel from the mtools package is meant to do this, but the documentation is not geared to rapid assimilation.
View 1 Replies
View Related
Apr 13, 2011
the permission of 'renaming a file' is included in which right: 'read', 'write' or 'execute'
View 1 Replies
View Related
Jun 8, 2010
What's the command for renaming files? I thought it was "mv"--I typed "info" and read
Quote:
* mv: (coreutils)mv invocation. Rename files. So, desiring to give a .JPG extension to a jpeg file that had no extension (because I dug it out of my Firefox cache), I typed
Quote:
mv '/home/josh/Desktop/Natalie pictures/DEC8FFA5d01' *.jpg
That didn't rename the file; it made the file disappear from its folder. What did I do wrong?
View 6 Replies
View Related
Mar 14, 2011
I am trying to rename a list of variables in my script using a second list of variables. I want the variables in the second list to replace the variables in the first list such that the first variable in List 1 is renamed after the first variable in List 2, the second variable in List 1 is renamed after the second variable in List 2, the third variable in List 1 is renamed after the third variable in List 2, and so on.
For example:
I know how to rename each file individually, but would like to run Do Loop which can rename all my output files at once.
View 7 Replies
View Related
Mar 13, 2011
I have been using Linux close to 2 years now. One thing that always bewildered me is audio support in Linux. These days I login to windows only for listening to music. After reading various blogs, i decided to give it a try in Linux with Amarok. There again I am facing a problem.
while i try to scan for music files it is not finding any files.
what I did is as follows:
Quote:
Setting --> configure Amarok --> collection --> scan
I have tried with mp3 .wma format files. While I try to add these files individually, Amarok is able to play those.
I am using Amarok 2.3.2 with KDE 4.4.5. Fedora - 12 is my flavor.
Given below is the log obtained with amarok -debug option
Quote:
TagLib: MPEG::Header:arse() -- First byte did not match MPEG synch.
TagLib: MPEG::Header:arse() -- Invalid sample rate.
TagLib: A frame of unsupported or unknown type 'TSC' has been discarded
TagLib: A frame of unsupported or unknown type 'TSC' has been discarded
TagLib: A frame of unsupported or unknown type 'TSC' has been discarded
[Code].....
View 3 Replies
View Related
Dec 11, 2010
I run a script which generated about 10k files in a directory. I just discovered that there is a bug in the script which causes some filenames to have a carriage return (presumably a '' character).
I want to run a sed command to remove the carriage return from the filenames.
Anyone knows which params to pass to sed to clean up the filenames in the manner described?
I am running on Linux (Ubuntu)
The character causing the filename to 'break up' accross multiple lines appear to be a CR (carriage return) instead of ' '. The filename is being diaplayed in thetitle of a text editor with %0D in the positions of where the file name breaks up. So I need to remove the CR chars from my filenames.
View 1 Replies
View Related
Jul 20, 2010
Is there a way to do a batch renames of files that will keep each individual filename, but change it in the way I want?
The specific issue is this. I have a harddrive with something like 1300 movies on it. They're all organized alphabetically, but there are like 200 movies that begin with 'The'. I want to rename all of these movies that begin with The so that the The at the beginning is dropped and added at the end (for example, turn "The Shawshank Redemption" into "Shawshank Redemption, The"). I'd like to do this with a simple command if its possible.
View 2 Replies
View Related
Oct 17, 2010
its very easy to rename a flash disk or even a memory card or any storage in windows because all you have to do is right click on the disk and an option is there rename, i have failed to find a way of doing this in linux ubuntu 8.04, but i understand its possible even in the command line, i need to rename my flash disk
View 1 Replies
View Related
Apr 11, 2011
that works to disallow non-owners from renaming the file, but what I wouldlike to do is disallow EVERYONE ( including the owner of the file ) fromediting, moving, or changing the filename once it is created. the only personwho should be able to make those changes is a special user.
View 13 Replies
View Related
Apr 4, 2011
I have a dir (pub_html) with 45 sub dirsand in each there is a file with name file123.html) what command can I use to rename all files with this name in all sub dirs to file456.html ? I'm on opensuse 11.3
View 14 Replies
View Related
Feb 4, 2010
We are having 12 windows computers xp which are connected to a linux machine which has samba server installed on it for backup purposes of these 12 windows users. We want the like this , that a user copy a folder from their local machine and paste it to the samba server . but they cannot delete this folder once the backup is there at linux machine.
So this is working fine. But our users are able to Rename the folder they have pasted at linux machine which we dont want . and even they are able to cut and paste files from 1 folder to another folder in the samba server. We just want them to copy a file or folder from their local windows machine and paste to samba server and they can also read it (copy and paste back to their windows computer)whenever they want . but we dont want them to cut and paste within linux machine and rename that file as well.
View 1 Replies
View Related
Feb 12, 2011
I want to rename files in multiple subfolders with a prefix (e.g., rename "file.tif" with "prefix_file.tif") and not have to be in the subfolder.
code: for f in /path/to/*; do echo mv "$f" "PRE_$f"; done
gives you this: mv /path/to/file1 PRE_/path/to/file1
instead I want this: mv /path/to/file1 /path/to/PRE_file1
View 3 Replies
View Related
Mar 6, 2011
I have files whose names look like this:Sim1-2_40.36.chr20_sb.foo.indel.novoalign.samSim1-2_40.36.chr20_sb.foo.indel.bwa.samWhat I want to do is to replace all indel with snp in the namesyieldingSim1-2_40.36.chr20_sb.foo.snp.novoalign.samSim1-2_40.36.chr20_sb.foo.snp.bwa.samBut why this unix command doesn't work
View 4 Replies
View Related
Mar 20, 2011
I messed up the whole thing and the settings. Created some new thing named rhk which I can't remember as it got all messed up and Now I am getting nothing after Linux Mint 10(julia) boots up - no start menu, no panel, no taskbar nothing. I tried to work in the recovery mode and got some(downloaded) 216mb of something(in the repair broken packages). Moreover whenver I have booted in it shows messages like Could not update ICEauthority file /home/rk./.ICEauthority
there is a problem with the configuration server. (usr/lib/libconfig24/gconfsanitycheck2 exited with status 256) The panel encountered a problem while loading "OAFIID: NOME_mintMenu" The panel encountered a problem while loading "OAFIID: GNOME_IndicatorApplet" Naulitis could not create the following reqiured folders: /home/rk/Desktop, /home/rk/. Naulitis Moreover Alt+F2 gives Run application or run with file and nothing seems to be working.
View 2 Replies
View Related
Jul 20, 2011
Recently I installed Dropbox on a server to do file synchronization and it added " (Case Conflict 1)" to a whole bunch of my files! I realize now that it was caused by case insensitivity but I'm still left with hundreds of files that are in this renamed state. Is there a script in Linux that would allow me to recursively go through the directories and strip out this string?
i.e.
a (Case Conflict 1).jpg --> a.jpg
/myfolder/abc (Case Conflict 1).doc --> /myfolder/abc.doc
/myfolder/subfolder/mydoc (Case Conflict 1).pdf --> /myfolder/subfolder/mydoc.pdf
View 2 Replies
View Related
Apr 8, 2010
How can I copy multiple files, each with a slightly different name from the SOURCE in the same directory?
Example: '/home/junk' contains A.txt, B.txt
I want to copy /home/junk/A.txt to /home/junk/A1.txt and /home/junk/B.txt to /home/junk/B1.txt using a single command.
View 11 Replies
View Related
Feb 3, 2010
Basically I need to rename a bunch of .doc files using the for-structure and the mv command (w/ wildcards) in bash. I guess this would be a bit easier if I'd use the rename command, but since this is a school assignment of sorts I need to use for & mv. The .doc files are named "1filename.doc", "2filename.doc" etc. And I've got to rename them to "aaa_1filename.doc", "aaa_2filename.doc", "aaa_3filename.doc" and so on. Tried to dabble quite a bit with the for and mv commands, basically just got a bunch of errors. Every damn time. For 2 hours. The most common error was "mv: missing destination file operand after ..."
View 6 Replies
View Related
Feb 21, 2010
I have some random files in a folder. I want to rename all of the files in a batch process. I have a text file that contains the Currentname of all the files in the folder, as well as a text file with all of the Newname of files in the folder. I want to replace Currentnames with Newnames.
For example, here are the names of the files in the folder:
1.mp4
2.mp4
3.mp4
I have a text file with the Currentname of all the files in the folder:
1.mp4
2.mp4
3.mp4
I have a text file with the proper Newname of the file:
a.mp4
b.mp4
c.mp4
I want to rename Currentname with Newname in the folder. So when I go to the folder the Newname of the files are:
a.mp4
b.mp4
c.mp4
View 14 Replies
View Related
Sep 11, 2011
this seems to be a strange question, i know. I've a database sqlite file called "a.db".I need to copy it 20 times (1 time for each letter of the alphabet) to have : b.db, c.db , d.db.
View 1 Replies
View Related