Skip to main content

Questions tagged [find]

This tag has multiple meanings. Please DO NOT use this tag if you're just trying to find something.

7538 votes
56 answers
11.2m views

Find all files containing a specific text (string) on Linux?

How do I find all files containing a specific string of text within their file contents? The following doesn't work. It seems to display every single file in the system. find / -type f -exec grep -H '...
Nathan's user avatar
  • 76.9k
2219 votes
49 answers
1.8m views

How do I exclude a directory when using `find`?

How do I exclude a specific directory when searching for *.js files using find? find . -name '*.js'
helion3's user avatar
  • 36.6k
981 votes
21 answers
688k views

How can I exclude all "permission denied" messages from "find"?

I need to hide all permission denied messages from: find . > files_and_folders I am experimenting when such message arises. I need to gather all folders and files, to which it does not arise. ...
Léo Léopold Hertz 준영's user avatar
941 votes
14 answers
3.3m views

Find a value in a list [duplicate]

I use the following to check if item is in my_list: if item in my_list: print("Desired item is in list") Is "if item in my_list:" the most "pythonic" way of finding ...
Stephane Rolland's user avatar
766 votes
18 answers
430k views

How do I find files that do not contain a given string pattern?

How do I find out the files in the current directory which do not contain the word foo (using grep)?
Senthil Kumar's user avatar
764 votes
14 answers
456k views

Does a "Find in project..." feature exist in Eclipse IDE?

Does Eclipse have a way to search a whole project for some text like Xcode's "find in project" feature?
William Jockusch's user avatar
716 votes
7 answers
767k views

Find duplicate lines in a file and count how many time each line was duplicated?

Suppose I have a file similar to the following: 123 123 234 234 123 345 I would like to find how many times '123' was duplicated, how many times '234' was duplicated, etc. So ideally, the ...
user839145's user avatar
  • 7,231
655 votes
26 answers
775k views

How can I get a recursive full-path listing, one line per file?

How can I spit out a flat list of recursive one-per-line paths? For example, I just want a flat listing of files with their full paths: /home/dreftymac/. /home/dreftymac/foo.txt /home/dreftymac/bar....
dreftymac's user avatar
  • 32k
642 votes
14 answers
462k views

find -exec with multiple commands

I am trying to use find -exec with multiple commands without any success. Does anybody know if commands such as the following are possible? find *.txt -exec echo "$(tail -1 '{}'),$(ls '{}')" \; ...
Andy's user avatar
  • 6,429
529 votes
8 answers
331k views

Find a file by name in Visual Studio Code

How can I find a file by name (or path) in Visual Studio Code? A Visual Studio shortcut I'm used to is CTRL+,, but it does not work here.
Nenad's user avatar
  • 26k
442 votes
12 answers
504k views

Using find to locate files that match one of multiple patterns

I was trying to get a list of all python and html files in a directory with the command find Documents -name "*.{py,html}". Then along came the man page: Braces within the pattern (‘{}’) are not ...
Xiong Chiamiov's user avatar
436 votes
9 answers
642k views

How to use regex with find command?

I have some images named with generated uuid1 string. For example 81397018-b84a-11e0-9d2a-001b77dc0bed.jpg. I want to find out all these images using "find" command: find . -regex "[a-...
thoslin's user avatar
  • 6,909
428 votes
15 answers
162k views

Make xargs handle filenames that contain spaces

$ ls *mp3 | xargs mplayer Playing Lemon. File not found: 'Lemon' Playing Tree.mp3. File not found: 'Tree.mp3' Exiting... (End of file) My command fails because the file "Lemon Tree.mp3" ...
showkey's user avatar
  • 588
421 votes
18 answers
462k views

How to loop through file names returned by find?

x=$(find . -name "*.txt") echo $x if I run the above piece of code in Bash shell, what I get is a string containing several file names separated by blank, not a list. Of course, I can further ...
Haiyuan Zhang's user avatar
414 votes
8 answers
499k views

How can I find elements by text content with jQuery?

Can anyone tell me if it's possible to find an element based on its content rather than by an ID or class? I am attempting to find elements that don't have distinct classes or IDs. (Then I then need ...
sisko's user avatar
  • 9,772

15 30 50 per page
1
2 3 4 5
751