A commandline utility to find files and directories.

learn more… | top users | synonyms (1)

22
votes
1answer
867 views

What is the difference between using '+' (plus) and ';' (semicolon) in -exec command?

I'm wondering to know that what difference is the between using + and ; at the end of -exec command when I use in find command? find .... -exec ... \; VS find .... -exec ... +
10
votes
1answer
22k views

How can I use find command more efficiently?

I wanted to know, what is the best way to use the find command efficiently? I generally use, find [filename] [dir] which gives me a long list of file names none of them any way related to my search. ...
5
votes
2answers
4k views

How can I search for files in Unity?

I'm trying to use the dash instead of gnome-do, but I can't find files. "Find files" only returns "Top Results". In gnome-do, I was able to set some often-used directories to index. For example, I ...
7
votes
3answers
10k views

How can I find the location of an icon of a launcher in use?

I have a launcher on my desktop and want to add another one manually with the same icon. When I go to the preferences of the existing launcher and click the icon, it doesn't take me to the folder ...
26
votes
2answers
5k views

Did I just delete everything with find -exec mv?

I tried to figure this out on my own. Here's the command I used in the terminal: find . -name "*.jpg" -exec mv {} pictures \; I did not create a directory named pictures first. What happened was a ...
7
votes
1answer
21k views

Find file or directory in whole directory structure

How can I find a file with a specific name in bash. I want to search through the whole system. I tried with find, but that only work through one level.
5
votes
6answers
690 views

How can I find files quicker than find or locate?

I have been using find command to find files on my 1 tb hard disk. it takes very long. then I used locate which proved to be faster with regular update using updatedb. But the limitation of locate is ...
4
votes
1answer
2k views

What is the difference between “find” and “locate” search methods in Catfish?

There seem to be two different methods of searching for files in Catfish What is the difference?
1
vote
2answers
1k views

Using grep to find a string

I am trying to locate a file that (should) contains the string "1896.345", somewhere under /home/dir/. Any ideas of how I can do it? Thanks
1
vote
3answers
123 views

Accessing a folder that I can't “name” in the shell

I have a stubborn folder that someone must have created accidentally and that has persisted all this time. I can see it with: # find /var/www/html -maxdepth 1 -type d which gives me: /var/www/html ...
38
votes
7answers
75k views

Find number of files in folder and sub folders?

I want to find the total count of the number of files under a folder and all its sub folders.
30
votes
3answers
9k views

Find directories that DON'T contain a file

Yes, I'm sorting out my music. I've got everything arranged beautifully in the following mantra: /Artist/Album/Track - Artist - Title.ext and if one exists, the cover sits in ...
20
votes
6answers
39k views

Find the latest file by modified date

If I want to find the latest file (mtime) in a (big) directory containing subdirectories, how would I do it? Lots of posts I've found suggest some variation of ls -lt | head (amusingly, many suggest ...
18
votes
2answers
27k views

How to find location of installed library

Background: I'm trying to build my program but first I need to set up libraries in netbeans. My project is using GLU and therefore I installed libglu-dev. I didn't note location where the libraries ...
8
votes
4answers
16k views

Using locate to find a directory

I use locate all the time to find files that I know the name of, locate is very fast and I love that. For recently created files find is great, normally with recently created files I know where ...
7
votes
2answers
8k views

How can I move all files in subdirectories recursively to a single directory?

I am trying to collect all the files under the current directory and all the subdirectories to one directory. I am trying something like the following find -type f -exec mv {} collection/{} \; ...
6
votes
8answers
22k views

Filenames with spaces breaking for loop, find command

I have a script which searches all files in multiple subfolders and archives to tar. My script is for FILE in `find . -type f -name '*.*'` do if [[ ! -f archive.tar ]]; then tar -cpf ...
10
votes
4answers
23k views

Find files in linux and exclude specific directories

I have a find looking like this: rm -f crush-all.js find . -type f \( -name "*.js" ! -name "*-min*" ! -name "*console*" \) | while read line do cat "$line" >> crush-all.js echo >> ...
10
votes
3answers
2k views

How to list files older than a day with “2015” in filename?

I want to list all the log files which do not belong to today and only the files that contain 2015 in their names. These are the commands I have tried: find . -name 2015 -mtime +1 -exec ls -ltrh ...
2
votes
1answer
8k views

Search for a string recursively whilst in current directory

I want to search all files recursively from the directory I am in for a particular string. I tried grep -r -i my_string and I tried it in a test folder with two tiny files but it wouldnt find the ...
1
vote
2answers
548 views

Creating a directory of recently created files

On a system I have, files are uploaded through a series of various mechanisms into one central "incoming" directory. Once a day those files are processed and they are moved off to where they need to ...
8
votes
5answers
557 views

How do you output the filename in find command while using -exec?

I use the following line to find all sub-directories of the PWD and run svnadmin verify on each directory (I already know that they're Subversion repositories) find ./* -maxdepth 0 -exec svnadmin ...
6
votes
3answers
8k views

using grep with pipe and ampersand to filter errors from find

I am using cygwin to find a file on the cygdrive. However I need to suppress the permission denied messages (otherwise the results get hidden in the error messages). The following command works: ...
5
votes
1answer
319 views

Finding all .cpp files in the users home directory

How we will find more accurately all .cpp files in the users home directory that were modified no more than 5 minutes ago?
5
votes
2answers
2k views

Find and delete all files without extensions witin a folder and its subfolders

I have a folder without around 500 subdirectories. There is a lot of trash to be found in it and I want to clean it up. I have already deleted certain filetypes that I don't want, like images, with ...
3
votes
2answers
106 views

locate command finds a file's path, but the file does not exist in that path [duplicate]

I have written: locate Origin90SR2DVD.iso And I received the path where that file is located: /home/david/Origin90SR2DVD.iso Then I have written: cd /home/david I have run: ls -lrth And ...
3
votes
6answers
1k views

command to find files by searching only part of their names?

Say there are files with names: batman.c batwoman.c batgirl.c cricketbat.c What command and how should I use it to list all these files by using the searchtag bat?
3
votes
2answers
278 views

How to find executables

I know there is a find switch. but I want to know how to search a specific type of file . For example I need kind of terminal command witch search for only executable files
2
votes
2answers
654 views

Command “find -name” must be enclosed in quotes or it doesn't work. Why is that?

find . -name *.rb doesn't work on my ubuntu I have to do find . -name "*.rb" to get it to work. Why is that?
1
vote
1answer
29 views

Edit find command to exclude a file

So I made this script Convert videos recursively with handbrake. And it uses this command as an option find . -name '*.mkv' -exec rm -r {} \; But i made this new script, for removing audio streams ...
1
vote
2answers
221 views

Find and execute multiple scripts in parallel

G'day, I have tried to solve this problem all morning but have not had success. I would like to search for certain scripts in a particular folder and execute them all in parallel. The scripts have ...
1
vote
2answers
211 views

How to use 'grep' with characters like * and _?

I need to find some text in one or more files. This is what I use: grep -irI "hello" ~/ However, if I want to find a string containing characters like * or _ then these seem to be ignored. Let's ...
1
vote
3answers
6k views

Character encoding problem with filenames - find broken filenames

I have the problem described in this Q&A. Probably from quite old linux distros or from windows I have several files with broken filenames. ls displays a "?" instead of the broken character. I ...
1
vote
3answers
407 views

How can I recover data deleted using find -delete?

HI Guys! I am working on Ubuntu 10.04 version. I accidentally deleted my code from find -delete command. Is there any way to recover the data? Many thanks in advance.
0
votes
3answers
55 views

Zip files into weekly archive with week number

I am trying to take a weekly archive of a folder to separate zip files. find . -name '*.txt' -ctime +7 -exec zip "archive-$("date+%Y-%U").zip" {} \; I am stuck on how to name the zip file. Any ...
0
votes
1answer
134 views

Can a directory's mtime be older than that of file inside?

I have this very silly and very basic question but I thought better to ask before I start pruning my NAS. I want to delete all directories in which all files are older than 30 days. For files I ...
0
votes
3answers
103 views

What is wrong in follwing -exec command

I m getting error in follwing command cd /opt/lampp/htdocs/EspoCRM-2.5.2 && find data -type d -exec chmod 775 {} error: find: missing argument to `-exec'
0
votes
3answers
2k views

how or where will i find C:\Program Files(x86) in Ubuntu 13.04?

How or where will I find C:\Program Files(x86) in Ubuntu 13.04? I cannot find it. I need it as I have installed a game there and I need to uninstall it. I have already tried to post a similar question ...