Ubuntu :: Remove Some Files By Extension Only, Going Down Several Folders, While Leaving Everything Else Be?
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/
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.
How can I remove w7 starter from my HDD leaving everything for Ubuntu? Se picture.. I'm using Gparted as you can see. Guessing sda 1 and 3 = w7, sda 4 = recovery and sda 2 = linux? How do i proceed? (I don't know if it matters but I installed ubuntu via w7)
I have two folders - Folder abc and Folder xyz which contains 1000's of files with few of them having the same file names. How can I remove the duplicates from Folder abc?
how can i remove 'applications' and 'files and folders' launchers from unity in Ubuntu 11.04? Because applications and files and folders are already accessible from typing in the search box which gets opened clicking the top most left button.
(2 weeks) and i like it already enough to change from odd windows 7, but some people still will use windows 7 in this PC but with minimal usage (email, internet, writing docs, listening at music) i would like to delete as much file from windows7 as possible so i have more space for ubuntu using it as main system.any sugestions on what to delete in windows 7 to free up some space?
I've noticed in the last few weeks that whenever I open a PDF file in Adobe Acrobat Reader I get several files with names like 4cbe92d509fde in my /tmp directory. This happens for all PDFs, whether I download them or create them myself. Has anyone else seen this happen? It's not a big deal, since I can just rm those files. I'm just curious about how this happens, and if there's a way to stop it. I'm using Acrobat Reader 9.3.2 in F13 (32-bit).
On the new 11.04 when you select files and folders, "recent" are displayed at the top, and I can't find any options to make "recent" never appear. I don't know who, on a personal and not work PC, would want their recently uploaded and opened documents and files displayed at a simple click. Imagine this, I take dirty pics with the wife, I upload them to a secret folder, I use the same computer to show vacation pictures to my mom, I click on "files and folders", and poof, my mom sees naked pics of my wife displayed right across the "recent" files and folders section right at the top, regardless of the location of those files on the computer. So to avoid these situations, I would like to know how to disable the "recent" section of files and folders quick pop-out display.
I have a script almost working except for 1 thing. What I'm trying to do is read a file that has the files that need to be FTP'd using a bash script. I have everything working except the reading of the file. It works outside of the ftp script I've wrote but once I put it in the FTP script it doesn't.
Here's the Script:
#Here's where the problem is that I know of
I've been playing w/ the exclamation points to see if that could be the problem, but so far no luck.
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.
I am using CentOS 5.3. output of "uname -a" Linux localhost.localdomain 2.6.18-92.el5 #1 SMP Tue Jun 10 18:49:47 EDT 2008 i686 i686 i386 GNU/Linux
My kernal version is kernel-2.6.18-92.el5
Whenver i try to copy files from my centos to pendrive ( 2gb, kingston datatraveller) my system is gettin hanged leaving no option then to reboot. i tried from the terminal also, and as a diffrent user also. but same results. sometimes i can copy files of small size. but when i go above 5 mb..system hangs..
I had an extension i started making and had loaded in Chromium. Well i forgot to unload it and deleted the files for it. Well now Chromium crashes on startup saying it can't find the manifest file for it. How can i remove the entry for that in the extension cookies file?
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.
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.
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++?
I installed Mono 2.4 and I am struggling myself to remove all folders related to mono.. I didn't install from Synaptic so it's not just 'apt-get autoremove mono', I used the tarball.. how to remove all files from the installation?
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?
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.
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
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.
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...
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.
I have a Ubuntu file server with a mix of 30+ users ( mix of windows and linux ).All are members of the same group. All need read write create access. I want to prevent deletion of certain key folders. How can I achieve this ? sudo chmod -R nnnn ??
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!
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.
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.
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).