Questions tagged [find]

A commandline utility to find files and directories.

Filter by
Sorted by
Tagged with
0 votes
1 answer
556 views

Find and exec using pulled variable

So far I have a simple batch script that moves *.mkv files from their source folders to a folder called "Movies". Now I would like FileBot to rename them using the 'find' command, since it (filebot) ...
user1652011's user avatar
2 votes
1 answer
675 views

I can't find a file in ubuntu 12.04

i used the code in terminal sudo mv filename.jpg /usr/share/backgrounds but when i check there, it is missing, also can't find in /home
Muin's user avatar
  • 21
3 votes
1 answer
2k views

Cat all files in a directory, with a specific file at the beginning an end...?

Is there a way to cat all files in a given directory, but with a particular file at the beginning and end? For example, say I have: file1.js, file2.js, file3.js, file4.js, file5.js -- Effectively I ...
Aeisor's user avatar
  • 133
11 votes
2 answers
223 views

Does apt-cacher change packages access time?

I tried to remove the long time unused packages from apt-cacher archive using find: $ find /var/cache/apt-cacher -atime +5 -type f -name ".*deb*" | wc -l 8471 $ find /var/cache/apt-cacher -atime +9 ...
Amir Naghizadeh's user avatar
4 votes
1 answer
6k 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?
user avatar
4 votes
3 answers
1k views

bash escaping and find command

I trying to remove boring \-escaping from this command: find . \( -name '*.mp3' -o -name '*.jpg' \) -print by wrapping it in single quotes: find . '( -name *.mp3 -o -name *.jpg )' -print implying ...
user52151's user avatar
  • 265
5 votes
2 answers
4k views

How to find all the files related to a software?

I'm not sure if it is possible, but if it is, how can I find all the files related to a software? For example, is there any way to find all files that gedit needs and uses to work? Does such command/...
Pouya's user avatar
  • 463
2 votes
0 answers
160 views

How can I synchronize all PDFs from one directory with Dropbox?

I want to synchronize all the PDFs from one directory (my Zotero library) to Dropbox. Finally, I want to have a list of all the PDFs, not the directory names. I successfully synchronized all my PDFs ...
mcbetz's user avatar
  • 3,069
20 votes
5 answers
67k 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 >> ...
Asken's user avatar
  • 543
2 votes
3 answers
2k views

Recursively find every first file at each branch of a directory tree

Consider the following directory listing: /a/1 /a/2 /a/3 /b/1 /b/2 /b/3/a /b/3/b /c/a.whatever /c/b /c/c I want a command that will find the first (alphanumeric sort) file in each directory (inc ...
Oli's user avatar
  • 293k
93 votes
5 answers
67k 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 /Artist/Album/cover.(jpg|...
Oli's user avatar
  • 293k
9 votes
1 answer
23k views

List of files modified between perticular time period

I am trying to get list of files modified between particular period of time as explain in this answer. I stored date and time in two variables [nn and nn1 (stupid naming)] and tried with find ...
Vikram's user avatar
  • 218
2 votes
1 answer
189 views

React to a modified directory

In linux everything is considered as file, Now if I want to find only folders/directories not the files then how can i do that? I am getting all the modified files with the following command. find /...
Ghanshyam Rathod's user avatar
46 votes
3 answers
153k views

How to find files between two dates using "find"?

I have an email account that has passed 60GB of emails, and currently I'm having a lot of trouble using an email client to archive emails of last year (2011). Via terminal, I am trying to use find to ...
Zuul's user avatar
  • 1,984
1 vote
2 answers
2k 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
Yotam's user avatar
  • 1,339
1 vote
2 answers
265 views

Can someone explain me the find command behavior that I use?

Can any one tell me why the following command won't run : find ./assign/*.c -exec cp ./assign2 {} \; and what's the difference when i do the following(which actually runs): find ./assign -type f -...
Brut3e's user avatar
  • 111
2 votes
1 answer
911 views

find command to remove files says that some files don't exist

I have an OSX Mountain Lion Laptop connected to and Ubuntu 11.10 system and tried to copy one .csv file from the OSX machine to the Ubuntu machine. I stopped the file transfer as I realised it created ...
Harry Haller's user avatar
3 votes
2 answers
6k views

Exclude some of the "find" results

I'm using find command along with -exec something argument. Can I exclude some directories/name that match regex (something like rsync's --exclude)? Will -prune be enough if I want to exclude many ...
vfg's user avatar
  • 31
3 votes
2 answers
4k views

Find files/folders in folder except some specific folders

I'm trying to move all files from one folder to another, except some specific folders. I tried this to move all files except the .git, assets or build folders: find .. ! -regex '\(.git\|assets\|...
EsTeGe's user avatar
  • 133
2 votes
3 answers
385 views

cp: `./lcommands/cde.pdf' and `lcommands/cde.pdf' are the same file

I am trying to learn about the find command. I would like to understand the meaning of this warning: ankit@battlestar:/home/mount_150/studies$ find -iname "*.pdf" -exec cp -ar {} lcommands/ \; cp: `....
Ankit's user avatar
  • 6,789
6 votes
2 answers
9k views

Searching for a filename without a certain string

So when you want to search for a file with a filename containing the string xyz from a directory to all depths, you write sudo find path -name '*xyz*' How do I find all files without the string xyz?
notablytipsy's user avatar
  • 2,917
20 votes
1 answer
62k views

What does "paths must precede expression" mean when using find?

I want show all the files that have a .bak extension. kaykav@ubu2:~/Documents$ ls cdIndex1-60 met.bak tem.bak I type the cmd : $ find . -name *.bak I'm in the correct Directory for this. I get ...
kaykav's user avatar
  • 201
34 votes
3 answers
20k views

How do I get mlocate to only index certain directories?

I'd like to use mlocate on my Ubuntu server, but only to index certain directories (e.g. /home and /data, but not everything under /). However, mlocate's standard configuration works the opposite way; ...
Andrew Ferrier's user avatar
1 vote
1 answer
101 views

Which package manages the Ctrl+F function?

I'm trying to find out which package manages the Ctrl+F (Find) function. I need this so I can properly file a bug; the Ctrl+F function is constantly being launched on whatever application I have on ...
mxyzptlk's user avatar
3 votes
1 answer
2k views

I just recursively chmod'd everything under / to 750. Any tips?

I won't be the first and I won't be the last, I suppose. While playing around with the find command, I made a whoops and it would appear that instead of changing the permissions of the ~/web directory ...
Ouairz's user avatar
  • 143
13 votes
2 answers
15k views

how to have 'find' not return the current directory

I'm currently trying to find (and copy) all files and folder structure matching a specific pattern, in a specified directory and I'm so nearly there! Specifically, I want to recursively copy all ...
Pinpin's user avatar
  • 165
15 votes
1 answer
49k 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. ...
Sam007's user avatar
  • 4,383
5 votes
2 answers
8k views

How to use find when there are spaces in the directory names?

I need to find all .nfo files in my media directory so I can use sed to change some parts. The problem is my folders have spaces in the names. find /media/media1/HDTV -name \*.nfo -type f media/...
papampi's user avatar
  • 407
1 vote
3 answers
337 views

Help locating the virtualbox export?

I just did this VBoxManage export foo_to_be_export --output bar.ova But then I forgot to setup the default path. However, it shows it's 100%. I couldn't find this image now. I tried sudo find / -...
user1012451's user avatar
  • 3,115
1 vote
1 answer
1k views

Count duplicated words in a text file

I have a 20 mb file with text and ids. I need a grep or something to count and show any duplicated ids.
Martin's user avatar
  • 366
305 votes
9 answers
1.3m views

Find a file by name using command-line

I would like to determine the location of a file using command-line. I have tried: find . -type f -name "postgis-2.0.0" and locate postgis-2.0.0 to no avail. What is the command to determine the ...
Sam007's user avatar
  • 4,383
1 vote
1 answer
1k views

find . -type l says missing argument

I want to find all symbolic links in the current directory and below. Therefore, I used: find . -type l Running that clears the screen showing "Pattern not found (press RETURN)" at the bottom of the ...
Sebi's user avatar
  • 246
13 votes
1 answer
42k views

find: unknown predicate

This is probably not a Ubuntu question as such, but a Linux one instead, still hope some Linux user out there can help me understand this. I'm trying to use the find command to look for some files an ...
yorch's user avatar
  • 183
1 vote
2 answers
7k views

find: missing argument to -exec

The following works from the terminal no problem find testDir -type f -exec md5sum {} \; Where testDir is a directory that contains some files (for example file1, file2 and file3). However, if I ...
Peter Kelly's user avatar
4 votes
1 answer
10k views

Grep for a word in a file and show below and above lines too? [duplicate]

Possible Duplicate: How to grep 2 or 3 lines, one containing the text I want, and the others just below it? Say I have a file. I want to find a particular word in that file and show the line. ...
David's user avatar
  • 391
2 votes
0 answers
358 views

Fail to access a Windows drive from a live session [closed]

I am attempting to use Ubuntu to rescue files from a Windows pc. I am using Ubuntu for the first time, so I am a complete novice. I am asking for assistance to find the files on the pc. I have a ...
New Ubuntu Fan's user avatar
4 votes
1 answer
217 views

Custom GREP with asterisks and anchors?

I have lots of EDI files (which is pretty much a single line of gibberish text) that are about 300mb/pcs. I'm looking to pattern matching this: `*UP*605284466346 {lots of other stuff inbetween with ...
ehime's user avatar
  • 546
1 vote
1 answer
232 views

find symlink to a known file /etc/init.d/ portmap

I'm looking for the /etc/rc.X/ softlink to /etc/init.d/portmap. Does anyone know where portmap is called? How can I find all symlinks to a file? Chris
chris's user avatar
  • 756
85 votes
4 answers
331k views

How to find a folder on my server with a certain name?

I have a directory somewhere on my server wth the name "exampledocs". I tried to find it's location using: ls -d */ | grep -E 'exampledocs' and find * -regextype posix-extended \-regex '...
user avatar
2 votes
1 answer
6k views

Missing php.ini after apt-get install php5

I just installed php5 as root via apt-get install php5, and for whatever reason I can't find my php.ini file. Running locate php.ini or ls /etc/ | grep php.ini both yield no results. Is there ...
Holland's user avatar
  • 145
1 vote
2 answers
2k views

Finding directories inside a folder and deleting if smaller than a certain size?

What command can I execute to check the directories inside a folder and if the total size of the directory is smaller than 30MB, delete it? I played around with the find command trying to move files ...
Daniel Gomes's user avatar
75 votes
2 answers
208k 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 the location where the ...
Raven's user avatar
  • 864
8 votes
4 answers
21k 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 ...
lumbric's user avatar
  • 3,994
4 votes
1 answer
3k 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?
npiv's user avatar
  • 163
8 votes
7 answers
6k 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 ...
Chaitanya's user avatar
  • 645
1 vote
3 answers
185 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 /...
0xC0000022L's user avatar
  • 5,720
2 votes
2 answers
162 views

I cannot find anything in LibreOffice help [closed]

I have packages libreoffice-help-en-gb and libreoffice-help-en-us installed. LibreOffice 3.4.4 OOO340m1 (Build:402) pre-installed on Ubuntu Oneiric Here is the screen shot. Error message: No ...
hgajshb's user avatar
  • 349
2 votes
1 answer
473 views

subshell ls -lh "$(find /music -type d)" doesn't return list, instead results of find command

I'm trying to list the details of all the directories in my music folder using the following command: ls -lh "$(find /music -type d)" However all I get is the return of the find command. Is this ...
user784637's user avatar
  • 10.9k
14 votes
1 answer
51k 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.
RocketMan's user avatar
  • 1,051
1 vote
1 answer
199 views

Get disk utilization by file-type?

Is there a way to get a break down of a disk (or directory) utilization based upon file-type from the command line? I guess I could write a bash script to find+du based upon a few known file-types, ...
BassKozz's user avatar
  • 111