I want to find in the system a file, and I know part name of it. How could I do that? I tried unsuccessfully the command:  find / "*partname*"   The problem is probably very easy however I cannot find a decent tutorial on searching files in linux. Such one that explains searching in whole system files, in subfolders, recursively, for part of specific expression(s) or excluding. Please tell me what command solves my problem and if you know a good tutorial so that I can understand how to use various parameters for searching, post a link. Thank you so much.
116705
I need to search for files starting with some particular name. There can be multiple files starting with a particular pattern and I want to list all such files present in the directory.
75528
More often that I like to admit I look for a file that contains some strings.  Currently I do:  grep -rl string1 | xargs grep -l string2 | xargs grep -l string3   Is there a tool that does this prettier?  This greps for string1 or string2 or string3.   grep -rl -e string1 -e string2 -e string3   I want files that contain string1 and string2 and string3 but not necessarily on the same line.  Maybe one of the modern greps (ag/ack/rg/sift) can do this?
90361
I am able to locate files in a folder containing a specific text string using this command:  grep -lir 'string' ~/directory/*   How do I move the files that appear in the above result to another location?
90095
I'm trying to get my head around finding files in terminal at the moment. I've found a lot of answers about how to find files to a specific pattern, such as files ending in a certain extension, or from a certain timeframe, etc.  What I've been trying to figure out, though, is how to find and copy multiple arbitrary files, like a list of specific files.  Say, for example, I have the following folders and files  /Documents/Folder_1/ with contents:   file1.txt file2.txt file3.txt file4.txt   /Documents/Folder_2/ with contents:   file5.txt file6.txt file7.txt   /Documents/Folder_3/ with contents:   file8.txt, file9.txt   and what I want to do is to make a new folder called Folder_4 and copy file2.txt, file5.txt and file9.txt to that new folder.  Is there any way to do this through terminal?  What I've tried to do is to make a text list of the file names and call it something like list.txt, e.g.  file2.txt file5.txt file9.txt   and loading that text file into the Find command, for example like this:  find /home/usr/Documents -name $cat list.txt   with the thinking that I would then feed the output to either a text list or a copy command, but this doesn't seem to work.  I'm wondering if there is any way to find multiple arbitrary files through the Find command, or am I thinking about this in the wrong way?  EDIT: Just wanted to say thanks for the answers and summarise the way that I ended up approaching this problem. I especially appreciate that someone explained to me that the find command is not designed to accept more than one input without the -o flag, it made me feel a bit less stupid for not being able to figure it out!  What I ended up doing was to make a little shell script and ask for user input and use an array and a for loop to iterate through the list.  Basically the script that I ended up with is more or less like this:  #!/bin/bash  #take user input echo "Please enter list of filenames to search" read list echo "Please enter the folder path to search" read path echo "Please enter the destination folder path" read destination  #use inputted list as input for array, and then use a for loop to find each item on list one by one array=($list) for i in "${array[@]}" do     find "$path" -iname "i" -exec cp '{}' "$destination" \; done
121491
I have read the man page and other references, but I am still confused by the behavior of find with -print0 option.  -print0      This primary always evaluates to true.  It prints the pathname of              the current file to standard output, followed by an ASCII NUL              character (character code 0).   First command:  $ find /some/path/ -iname "*intro*jpeg" -o -iname "*intro*jpg" 2&gt; /dev/null /some/path//asdf199Intro-5kqlw.jpeg /some/path/199intro-2jjaj.JPEG /some/path/199intro-3.jpg /some/path/wuer199intro-4.JPG /some/path/xbzf199INTRO-1.jpg   Second command:  $ find /some/path/ -iname "*intro*jpeg" -o -iname "*intro*jpg" 2&gt; /dev/null -print0 /some/path/136intro-3.jpg/some/path/wuer136intro-4.JPG/some/path/xbzf136INTRO-1.jpg   I can see that the the filenames from the second command are null character separated, but why do I get 3 output as opposed to 5 above?
18387
I am using the find command of bash, and I am trying to understand it since it is part of a code that I am using. In the code, the command in question is -   find -L $RAW_DIR -mindepth 2 -maxdepth 2 -name "*.bam" -o -name "*.sam" | wc -l  I have been trying to understand this command by searching its components. In esence, I thinking it is trying to find the number of files that end with .bam or .sam. I think -maxdepth 2 means to search for these files in this folder and its immediate subfolder.  What I do not understand is what mindepth -2 does in this case. I looked up mindepth, and the explanation given everywhere is -  "Do not apply any tests or actions at levels less than levels (a non-negative integer). '-mindepth 1' means process all files except the command line arguments."  To me this explanation is not very clear. Just like maxdepth -2means search for subfolders upto a depth of 2, what does mindepth -2 correspondingly mean, in simple language?  Also, if mindepth is just the opposite of maxdepth in terms of the direction (which would make intuitive sense), then how do I understand the fact that executing the command above on a folder that does have a .bam file leads to the output  0, whereas omitting the mindepth part of the command leads to the output 1 ?
67398
Windows 7 Ultimate 64bit:  I'm looking for a way to find all the files in a directory that are NOT of a specific file type or extension.  Example: I'd like to find every file that isn't an .mp3 in my music folder (and all sub folders).
55464
How can I see the hidden files in Finder?  For instance, if I have a file named: .something  is is not listed.  Right now I have to open the terminal and type ls -la.
16320
When I'm using  find . -type f -name "*.htm*" -o -name "*.js*" -o -name "*.txt"  it finds all the types of file. But when I add -exec at the end:  find . -type f -name "*.htm*" -o -name "*.js*" -o -name "*.txt" -exec sh -c 'echo "$0"' {} \;  it seems it only prints .txt files. What am I doing wrong?  Note: using MINGW (Git Bash)
35593
Which is more efficient for finding which files in an entire filesystem contain a string: recursive grep or find with grep in an exec statement?  I assume find would be more efficient because you can at least do some filtering if you know the file extension or a regex that matches the file name, but when you only know -type f which is better? GNU grep 2.6.3; find (GNU findutils) 4.4.2  Example:  grep -r -i 'the brown dog' /  find / -type f -exec grep -i 'the brown dog' {} \;
92353
Assuming that the grep tool should be used, I'd like to search for the text string "800x600" throughout the entire file system.  I tried:  grep -r 800x600 /   but it doesn't work.  What I believe my command should do is grep recursively through all files/folders under root for the text "800x600" and list the search results.  What am I doing wrong?
96458
I have to check a particular path every day and find the file with a name of the form:  StaticData_Sets_yyyymmdd-232550.txt   The date in the name after the string StaticData_Sets_ is updated every day depending on the system date. The number after the date is random.  How can I find the file for the current date in Unix?
47336
I want to find a text file in my hard disk which contains a specific word.  Prior to Ubuntu 12.4 I used to start in the dash an application, I think it was called "Search for file...", whose icon was a magnifying glass.I can't find that simple application any more.
59740
I have a tree of source code and I am looking to find all files that contain a certain word and must not contain a second word. This, because I need to update older files to include some newer code.  I know I can use find, but I feel like if I try to chain grep statements it won't work because the second grep statement is going to be searching the results of the first and then I got lost.  I tried:  find . -type f -name "*.c" -exec grep -Hl "ABC" {} \; | grep -L "123"   And this totally did not work. Any help would be appreciated.
63
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
41439
What order does the find command use to print out a list of files? Is this order different across different Linux distributions or versions?
116068
I would like to list the files recursively and uniquely that contain the given word.   Example: Checking for word 'check', I normal do is a grep  $ grep check * -R   But as there are many occurrence of this word, I get a lot of output. So I just need to list the filenames that contain the given search word. I guess some trick with find and xargs would suffice here, but not sure.  Any ideas?