Ubuntu :: Sort Files Into Folders Based On Extension?
Sep 16, 2010
I recovered some 60,000 files with PhotoRec and need a script to sort them into individual folders based on extension. I was able to do this once before but cannot find the script again (sad thing is that I probably saved it on another HD that I'm having partition issues with, but that's another story....).I found this script:
Code:
#!/bin/dash
mkdir "$1"
for file in *.$1; do
mv "$file" "$1"
done
While it does work, I am not looking forward to going through all 132 folders and typing in each extension. The last time I did it, the folder was automatically created based on the extension(s) found.
View 6 Replies
ADVERTISEMENT
Feb 19, 2010
I used MusicBrainz Picard to tag FLAC and Mp3 files, fixed any necessary genre tags in Rhythmbox, and used EasyTag to rename the actual files.But now I'm interested in using those genre tags as folder names...is there any program that will sort my music into folders based on their genre tags?
View 5 Replies
View Related
Apr 21, 2010
I'm a relative cli noob, and I screw something up. I want to remove some files by extension only, going down several folders, while leaving everything else be.I think this might be the the right command / syntax, can someone confirm:Code:rm -rf *.exe *.ini *.!ut /path/
View 9 Replies
View Related
Sep 8, 2009
I need a script that will take all the files in a given directory and create new monthly sub-directories and sort all the files based on the creation date into the appropriate directory.For example, all files created between 01/01/09 and 01/31/09 will be placed in 'JAN-2009'
View 5 Replies
View Related
Jul 7, 2010
Code...
But I want to get the files in order which they created like file, file1 and file2
Any way to obtain this?
View 6 Replies
View Related
Sep 28, 2010
I have very little linux experience. And need some help with a bash script. I need to a script I can set cron to run to sort files out of a holding folder into final folders. It doesn't necessarily have to be bash, but I think it would be sufficient for this. File names are formatted as such when created: Dest-Date-Time-CID-Destination# I want the files to be moved from a all in one holding folder to a folder structure like this.
.../storage/year/month/day/Destination#/VarX(type)/hour/CID/'File'
I would need an if/else if/else statement to say if Dest = A set VarX = B If for example the file name was
infinity-20100927-17:00-1112223333-4445556666.wav
I would like the above file to end up moved from
.../holding
to
.../storage/2010/09/27/4445556666/Inbound/17/1112223333/infinity-20100927-17:00-1112223333-4445556666.wav
So the script will need to make directories based on information in the file name which is delimited by single dashes. Then move files from the holding folder to the newly created "sorted" folders.
View 15 Replies
View Related
Jun 3, 2010
I have a directory listing with many subdirectories having many files. I want to recursively search for the oldest 5 files starting from the base directory and not 5 from each subdirectory. I am writing a shell script which sorts them using ls -lRtur|egrep "txt|jpg" > /tmp/file1 Now from this /tmp/file1 file I want to sort the files same as what the ls -ltr command does that is oldest file time to newest file time first. How do I sort based on Linux time stamp? The files itself also have Linux timestamps embedded in them So I can sort based after extracting them as well if it is easier.
My /tmp/file1 has entries like below.
-rw-rw-r--. 1 usr1 usr1 705 2010-01-22 17:25 sample20100603173659.jpg
I want to get the 5 oldest files and then delete them.
View 1 Replies
View Related
Jan 18, 2010
have a gzip file ABC_000023232.gzipBCD_023232032.gzipI want to split these files into smaller files but keep the extension same because I am using this as a variable in a script
Code:
for i in `ls *.gzip`
split -b 500K $i $i
[code]...
View 3 Replies
View Related
Oct 3, 2010
Many years ago, I converted a portion of my files to an arbitrary format with a specific extension. i no longer desire to have them in this format and i would like begin the process of replacing them because conversion is not an appropriate solution. unfortunately, they are mixed in separate folders of the same root folder with files in my current format of a different extension. I feel it would make this process easier if I were to move every folder that contained a file with the undesired format to a separate root folder. The files are stored on a Linux server and shared via samba. How can I do this with a couple of commands or a script? I am open to other suggestions as well. I want to avoid time spent editing text files. Ultimately, I'd like a command that produced a list of full paths for folders, sorted by the number of levels would be a nice touch. A list of all of the files is clearly not what I'm looking for.
View 2 Replies
View Related
Oct 11, 2010
My PC completely freezes after viewing any program on ABC's (Australian Broadcasting Corporation) iView service. The time at which it occurs varies but it completely locks the PC.
I'm running 10.04.1 and have an Nvidia 6200 card, I'm running the propriety drivers.
Could this be an issue with my graphics card? I updated it a couple of months ago and can't think of any other changes that have been made.
I have the latest version of Flash.
My biggest problem has been coming across someone else who has experienced the problem so how should I be going about trying to debug it?
View 5 Replies
View Related
Nov 17, 2010
I tried using cron to start rtorrent. But I couldnt start it successfully. My crontab looks like this.
Code:
# m h dom mon dow command
40 22 17 11 * rtorrent
My cron is running properly. How could I start a new shell , so that rtorrent could run using cron.
View 2 Replies
View Related
Apr 3, 2011
When I used windows as my media server I had a program called SCRU (Scene release unpacker - [URL] that could unpack and move my downloads to folders based on their names. Is there something like that for linux?
View 1 Replies
View Related
Sep 21, 2010
how to convert mp3 files into files with the m4a extension? Need to get music files to be recognized by my DSi.
View 4 Replies
View Related
Jan 26, 2010
Xubuntu 9.10 Shared folders keeps warning that shared services samba of nfs not installed although ive d/l them and installed them when i hit install again it just keeps looping back to the warning
View 1 Replies
View Related
Nov 11, 2010
I'm a new openSUSE user. I want to make an account for my cousin, but we want our NTFS folders (from the dual WIndows XP install) inaccessible to each other. Problem is that, if I've read well in other searches, permissions can't be applied to NTFS (only the power to write, not only read, the whole partition). I know this can be done in Ubuntu, so I don't find a reason not to be able to do it, and I think my fault is that I'm using KDE (which I like more now, by the way) instead of GNOME.
View 9 Replies
View Related
Feb 19, 2009
I am thinking about writing a script to search through specific folders on a Linux based server (Centos 5) and report any changes made to any file on that server.Like a detailed change log with the date it was changed and the difference in size. Dose anyone know if such a script exist?
View 2 Replies
View Related
May 8, 2011
any utility to search for a file of a particular extension like search for all .txt files only
View 1 Replies
View Related
Mar 8, 2010
I want to search a Windows partition for all .doc and .xls files and move them over to Xubuntu to burn them to CD.
Is this easiest to do via terminal? I tried to use catfish and select all files, but I think my Mac keyboard (and USA standard keyboard settings) threw the select all files ability.
View 4 Replies
View Related
Oct 12, 2010
i am using ubuntu 8.04 and am trying to install a file with a .bin extension so opened the terminal and typed ($ chmod +x typingmastermac.bin )then the computer gave me this (bash: $: command not found). so i am not aware what to do next though most articles i have read about the topic tell me that that is supposed to be the first step in installing a file with a .bin extension. better way to install the typingmastermac.bin file.
View 12 Replies
View Related
Nov 18, 2010
I'm doing a project in Unix version Ubuntu 10.04. I'm doing an standalone app using C++(Qcreator) and GMT(generic mapping tool) so i need help in the following: how to invoke any extension files using C++?
View 1 Replies
View Related
Jul 26, 2010
I basically want to transfer firefox settings from one machine to another (or from one user to another) which includes some extensions. Instead of running the browser and installing the extension manually, I just want to copy and paste the relevant files.
I noticed that the folder name where the 'extensions' folder is present is different for different users. And just copying to that folder does not work. code...
I'm guessing there are other configuration files that I need to modify. Can someone tell me right way to go about this?
View 1 Replies
View Related
Jan 19, 2011
how to go about extracting the .inf, .sys. and any .bin files from a driver. I found the windows driver for my laptop on the HP website, but it is a .exe file. How do I find the correct file?I am using the Broadcom BCM4312 chipset, on Ubuntu Maverick 10.10 unity 32bit.
View 1 Replies
View Related
May 30, 2011
I got around 6,000 songs that I copied from my ipod to my external hard drive through rhythmbox, but for some reason it didn't copy over any extensions (all of my music files are mp3's) so I was wondering what would be a really simple way to add the extension to all the files in the music folder. My folders are setup like /Music/Artist/Album/song.mp3 (well right now there is no .mp3 but ya get the point
View 4 Replies
View Related
May 30, 2011
I have made the simple mistake of using dolphin to rename several picture files of types jpg and png. I have no problem viewing them and Ubuntu still knows which is which (if i view their properties it will state File Type: JPEG or PNG) but unfortunately Ubuntu Tweak does not allow you to chose them without the extension (I am trying to change my login background using this) So what i need is something that can scan several files, determine the file type, and add an appropriate extension to it. I have found several to do so for music files but none for images. I am using Ubuntu 11.04 at the moment.
View 5 Replies
View Related
Jul 2, 2011
Is there an easy way to do a recursive command line search on a path for a particular type of file extension?I want to build a script that will check for the existence of any .xxx files in a recursive path, if they exist, I would like to run the "mail" command to send me a message. I already have mail running on he server.My thoughts were to tryQuote:ls -R |grep .iniorQuote:find . |grep .inibut neither of those return only the .ini files, they also return files that are named such as .ini.bak, .ini.original, .ini.old, ect...
View 2 Replies
View Related
Jul 20, 2011
I have noticed that the files and folders search in Unity, only shows up those files which have been amended (or possibly just opened) since the install.
i was wondering if there was a way i could have the search index (or something vaguely equivalent) all the files on my machine. This is especially important given that i reinstall the OS every six months on a new distribution cycle, copying all my old files across.
Without being able to see my old files the search is pretty much reduced to a recent history search.
View 3 Replies
View Related
May 22, 2010
how can I rename all files in a directory up to the first dot (there by leaving the file extension alone) to the same thing? Im trying to rename all my media files and associated files in a directory to (preferably) the name of the directory it self. if I have
Code:
A Clockwork Orange -
wzzyfg.cd1.avi
wzzyfg.cd2.avi
wzzyfg.nfo
ACO.fanart.jpg
orange.tbn
Id like to automatically mass rename them all to
Code:
A Clockwork Orange
A Clockwork Orange.cd1.avi
A Clockwork Orange.cd2.avi
A Clockwork Orange.nfo
A Clockwork Orange.fanart.jpg
A Clockwork Orange.tbn
I have rename on my server which I used to remove underscores from file names, but I dont know how I would use it to rename everything up to the first period. Bonus points for renaming stuff to the name of the parent folder!
View 5 Replies
View Related
Sep 19, 2010
This should be easy but despite all the hints and tricks I've read, I cannot make this work. I have 130+ files with the names filename.avi.001, filename.avi.002, filename.avi.003 all the way up to filname.avi.132. How do I join them? A simple cat command does not work, neither does avimerge or any other utility I can find. I'm guessing because the file extension is a number and not .avi. Is there and easy way to rename them all and then join them? I can't be the only one with this issue but I've scoured the forums and found nothing.
View 7 Replies
View Related
Jun 30, 2011
I want a list of all my mp3 files (or any other kind of file, actually) telling me HOW MANY OF THEM I have in my computer.I tried with both find and locate commands in terminal, but they don't tell me how many files I have.
View 2 Replies
View Related
May 9, 2011
Suppose there is a directory named mydir containing ...
aaa.cpp
aaa.h
bbb.cpp
bbb.h
Makefile
a
b
Where a,b are executable files. What I want to is to only copy a and b to another location. Is it possible? (other than by manually issuing copy a,b another_dir).
View 2 Replies
View Related