Fedora :: Accidentally Renamed A Batch Of Files To The Same Name?
May 26, 2010
I just did something stupid... I wanted to remove a numeric prefix from a bunch of files in a folder (EXT4 filesystem), and I ran the following Python commands to rename the files:
On a KDE4 environment after downloading some music from rapidshare with JDownloader the archives self-extracted with the symbol in some of the file names. Those files couldn't be renamed or deleted, the file manager said that the files didn't exist - very weird. The files should have had some swedish characters in their file names. Now I'm stuck with those files on my machine. Anyone knows how to get rid of them?
I have this script that I use to find log files in the /var/log directory that are 2 days old, move them to /var/log/tmp, rename them to the system date.filename and move them back to /var/log. Everything seems to work as planned, except that the files don't get moved out of temp, and they keep getting rename. This leads to very long filenames such as:
What is it about this script that isn't moving it back to /var/log? Also, is there a better way of doing this than what I'm doing? Basically, I'm just trying to set up an audit trail on some of the files in /var/log, so that at the end of the month I can tar them, and then have our syslog server pick up the one giant monthly log.
king for a program or command line tool that ease the process of reducing size of many .jpeg files at once.I've been doing this with gimp manually by reducing jpeg quality and it's painful for 10 or 15 files to do that
After what feels like weeks have tinkering around trying to get a Samba file server set up, I've finally given up! I have 4 drives and 2 groups:
1) Dev - Available to all users in both groups (normal and admin) 2) Misc - Available to users in admin group only 3) Admin - Available to users in admin group only 4) Accounts - Available to users in admin group only
Drives 1 and 2 are working fine, with the correct access rights. Drives 3 and 4 can be browsed by admins only, but no changes can be made at all - files & directories can't be renamed/moved/deleted. What is most confusing is that Drive 2 is set up exactly the same as Drives 3 and 4. The process I went through to get them working:
the permissions for my home directory were accidentally changed from 'access files' to 'create and delete files', and I changed them back, but ever since then I am not able to change any preferences/settings at all. power management, themes, panels, emerald, anything. my user account is supposed to be the administrator, and all the user privliges are checked. how to get control of my computer back?
I get annoyed sometimes that from one Fedora release to another, some programs get renamed or put into different packages. Examples:
* Gnome's volume control applet. Used to be provided by gnome-media, now it's moved to control-center. Worse, the command itself was renamed from gnome-volume-control-applet to gnome-sound-applet, so I couldn't even try a `yum provides` search to locate it.
* Gnome's Disk Usage Analyzer tool. Used to be in a package by itself, baobab. Now it's provided by gnome-utils.
Is there a wiki or something where the full list of all renamed/repackaged programs can be found? I'm not a Gnome desktop user, so, while I'm sure all the packages I like from Gnome are just there out-of-the-box for most users, it doesn't help me very much. The volume control applet for example is extremely useful for other desktop environments (and Gnome itself really doesn't have much need for it anyway, since they have their own built into the window shell).
I recently installed JDK 6 runtime using apt-get install in terminal. I downloaded a .jar file and attempted to run it but I got an error telling me it has blocked the file for some reason.Another thing was, how can I run batch files? I know ubuntu doesn't come with something like MS DOS but is there anything similar that I can run batch files with?
Is it possible?I am mainly looking for A shell script or program that can convert a Batch (.BAT) file into a Windows executable (.EXE), or A program that can be run from MS-DOS that can turn a batch into an exe.
I'm completely new to scripting and I'm trying to figure out how to write a script that will get a list of all the files in a directorywn through any subdirectories.When I have the list I want to o each file in VI and change the fileformat. So far all I have been able to figure out is that VI can do the batch processing and that "ls -R" gets me the recursive file list. I'm still pretty clueless on how to do the batch process with the VI editor. I think I'm supposed to use the Ex mode but I don't know how to get the list of arguments from the filelist into the editor so they can be processed. If it matters the files were all written in a Windows editor and have gotten the MS carriage returns so I want to do a :set ff=unix command on all the files without having to go into each file manually, there are over 300 files that need updated.
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.
So I have a php script that is setup to stream flash video (.flv) and I absolutely love having it. The problem is that any files I want to stream have to be in .flv format for it to work properly as .avi and others obviously don't stream well. Up until now, I've used FFMpeg to change the format from .avi to .flv, however the process takes a lot of time if you have a lot of videos, added to that you have to do one file at a time definitely makes it a pain.Does anyone know of a bash script that can take all the files (i.e. avi, .wmv, .mkv, .mpeg4) in one folder and automatically convert it to .flv? Then possibly delete the old files? Low resolution is fine, so long as it at least viewable. Does anyone have a script or know of a program that can do this (I run Ubuntu 10.04). I think FFMpeg has the best chance of doing this, but I don't know the syntax to actually do so.
I've searched the internet, and while I have found a few scripts, they didn't work for me (still looking into two scripts I found.I am currently messing with them to see if I can get them to work).It would be immensely helpful if someone knew of a way to do this.I also forget to mention that I have used Winff, but I was looking more for a bash script to do this so that I can set a cron job to convert them every hour or so.
I have a lot of pdf files and I want to convert them to a lower quality for the web. I tried to use the following command (using ghostscript): Code: gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/default -dNOPAUSE -dQUIET -dBATCH -sOutputFile=output.pdf input.pdf Is there a way to make a batch to do this for all pdf-s in a folder?
System - openSUSE 11.2 "Emerald" KDE (with gnome base) Player - vlc I'm hoping to find a batch of codecs for my newly installed openSUSE OS. I have a very troublesome collection of .mkv files that took several codec packs to make them work. For a brief explanation, I had tried haali and matroska both together and they still didn't work on certain mkvs. I ended up using CCCP, but that's win only as far as I can tell. It took the latest update of CCCP to work on all of my mkvs.
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
I have a bunch of photos with varying names. I want to give each photo a random name(*), how do I do that? (*)I'm going to put them on a digital photo-frame that can't shuffle
I have recently been tasked to extract the subtitles from a lot of mkv files. Hundreds of them, maybe even more than a thousand. To do this, I modified a script I found online:
#!/bin/bash IFS="|" if test -z $1; then
[Code].....
So in the above example the subtitle is actually in track number one and my script would be borked for that particular file. Is there a way to integrate mkvinfo into the script and parse it to see what track should be extracted? Like, read it line-by-line and change the value of some #TRACKNO variable everytime a string like "| + Track number:" appears, and stop when a string like "| + Track type: subtitles" appears? Maybe even skip doing anything if there aren't any subtitles.
PS: I actually prefer SRT subtitles to ***. If there was some command line tool I could use to convert the resulting *** file to SRT I would be much obliged.
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
I'm not asking for help here, just documenting something I just discovered. Yesterday I wanted to batch-convert a bunch of old wma files to ogg vorbis. Not wanting to go through intermediate wav files, I tried to use ffmpeg to do it in one go. I first tried using the following command (in a loop, which I won't print here).
Code: ffmpeg -i $file -f ogg -acodec vorbis -ab 192k outputdir/$file "vorbis" turns out to be the built-in libavc implementation of the codec. In the process I discovered that the -ab value is always ignored. No matter what value you put, the output is always the default 64k (average, but of course it's vbr). You can however use the poorly-documented -aq option to set the audio quality used. The values don't correspond to the oggenc values though, being a number ranging from 10-100 (or more, I don't know what the maximum is). It's not exactly clear what number corresponds to what average bitrate, so you have to experiment. ~30 seems to give you an average-rate file, while anything above 60 is probably overkill.
Switching to the external libvorbis gave me more flexibility, although at a cost of much longer encoding times (note that ffmpeg must have been compiled with libvorbis support first).
I could use both -ab and -aq (with the numbers corresponding to the oggenc values), with no problems. ffmpeg does display some wrong values in it's output text, however. In addition, there's one more difference. The vorbis (libavc) codec provides an entry in the header of the ogg container reporting the average bitrate, but it doesn't appear to provide a similar bitrate header in the vorbis stream itself. Some programs may not report the bitrate value because of this.
libvorbis provides both headers, avoiding that problem. So to summarize, libvorbis appears to be a better codec choice than vorbis.
I have about 300 files that need renaming, because the file system does not display the French characters properly. The dodgy letter in question has been replaced by a "question mark in a black diamond" symbol.No way of renaming, other then using mv in the Konsole has worked. Is there any way, script or program out there, that will do a batch rename?
I scanned hundreds of pages in gray scale and would like to batch process them to B&W. You can do this using the gimp GUI. what it does is get rid of all the gray shading from reflections off the paper when scanned. So you get crisp white backgrounds with black text and diagrams. I would like to simply do this to the entire group directory at one time as it would be quite a lot of effort to open them and do them one by one.
a movie is encoded with AC3 in 6 channel audio, what I get out is all of the sounds except for voices, which in 5.1 would be sent to the center channel. What I usually do is fire up avidemux and convert the audio to mp3 stereo, as converting to a 5.1 format usually ends up with a very odd sound (like running everything through an echo chamber). What I'd like to do is run a script to batch-convert these files from AC3 to MP3. The video format may vary, but they are usually XVID. I am comfortable at the command line, but I am not well-versed in audio/video tool terms. I don't need anything extravagant, I just want something that works. Heck, even if it is done one at a time, having a shell script that I can use to simply type:
I have quite a few sound sample files totaling over 4 gigs in size with around 80 root folders and then around 34 sub folders. i have a total of 13 DVD's in the above format. how do i "change the date" on all files in one go is that possible?
I'm trying to clean up a few hundred thousand mp3 files and I'm dying to find a way to automate some of the mechanical tasks I keep doing. It seems like at least two of these tasks could be easily accomplished with something at the command line, but I don't have the chops/know-how to figure out how (and would really rather not trial and error with batch deleting files & folders...).
1) Delete all folders named "_MACOSX" (and all subfolders/files contained therein) -- Basically, I'd like to apply this command to a few hundred directories that may or may not contain a subfolder called "_MACOSX" that I'd really like to get rid of.
2) Delete all files named "*.m3u". -- Similar to the first, I want to automatically scan all directories and subdirectories in a given location for all instances of this file-type and delete them wherever they're found.
3) Move all files named *.txt", "*.doc", "*.pdf" to a specific location. -- Similar to the last, except instead of deleting, I'd like to just move them, so that if there is anything worth keeping, I can keep it.
possible to rename a list of files in batch in order to maintain the last part of them, then purge a central section and then again maintain the extension?I.E.:
Initially, I was trying to get around a Nautilus log in error. Using this, I was able to log in, but I entered what seems to be a perfectly clean version of Ubuntu...with no access to my files. [URL].... Now, I can't seem to find any of my original files. Some of the commands I entered in the terminal included:
[code]...
I'm afraid that I may have deleted the files, or have moved them to another user or someplace on the drive I can't see.
Accidentally we happened to rename the ldl 64 bit library and since then no command has been working on the linux box, inlcung cp,move and su. How to recover from this?
Is there a good tool for "batch-editing" a number of files non-interactively? Replace a string with another and add a couple of lines in several files...
sed would've been ideal, but AFAIK, sed(1) can't work on normal files. Is it possible to get ed(1) to execute a sed-like script on a file/number of files? Is there perhaps a cross between sed(1) and ed(1) out there?
Call me lazy, but it just seems such a waste to have to cat(1) the file through sed(1) and to a temp-file, and then overwrite the original with the temp-file...
I've been an UBUNTU advocate and supporter since I switched to Ubunto v8.4. However, in my opinion, version 10.10 is the biggest piece of **** yet - everything is broken.
I have seven PC's at home: an office PC, a Media centre, two computers for the kid's, a milling machine running EMC2 and two laptops.
If I recall, v8.04 was okay and v8.10 gave me endless hassles. But I stuck with it, taught myself the basics, and got each of my machines doing what I needed them to do.
Upgrading from v8.10 to 9.04 to 9.10 to 10.4 all occurred effortlessly and without any issues.
However. both the Beta and final releases of v10.10 are extremely disappointing. Why do you guys need to release a "NEW" OS every six months? Why can you not fix / enhance the latest, best version?
Since upgrading to v10.10, ALL my PC's are broken in some way: Drive sharing is broken, my Media centre is broken (tuner cards won't lock onto signals - what is that?), VPN is broken, Remote Desktop is broken, printing doesn't work, sound is screwed.......And I certainly do not have the time and the patience to start from scratch trying to get everything working again - that's why I make backups (twice a month).
What are you guys doing? And please don't ask for logs and hardware specs - Everything was working great with v10.04.
Herewith a question to my fellow countryman Mark S - Wat gaan aan? Wat vang julle aan? Why change things that work(ed) perfectly fine? Maybe you should change the name for v10.10 to "Ubutu VISTA". That's exactly what made me (finally) dump Microsoft.