Difference between revisions of "User:Gregor/FindThings"

(Created page with "= Find Things = How to find things under Linux. == Find files by filename == Case-insensitive: find . -type f -iname "*hello*" Finds "Hello, hello, Thello, Thelloman, HELL...")
 
(ack)
Line 5: Line 5:
 
== Find files by filename ==
 
== Find files by filename ==
  
Case-insensitive:
+
Case-insensitive example:
 
  find . -type f -iname "*hello*"
 
  find . -type f -iname "*hello*"
 
Finds "Hello, hello, Thello, Thelloman, HELLO, hELLO, ..."
 
Finds "Hello, hello, Thello, Thelloman, HELLO, hELLO, ..."
  
Case-sensitive:
+
Case-sensitive example:
 
  find . -type f -name "*Hello*"
 
  find . -type f -name "*Hello*"
 
Finds "Hello, THello, THelloman, ..."
 
Finds "Hello, THello, THelloman, ..."
  
 
(http://stackoverflow.com/questions/13131048/linux-find-file-names-with-given-string)
 
(http://stackoverflow.com/questions/13131048/linux-find-file-names-with-given-string)
 +
 +
== Find files by content and filename ==
 +
 +
Case-insensitive example:
 +
ack -i kmoretools
 +
 +
(Install with sudo zypper install ack)
 +
 +
Normally, one would use the standard tool grep, but ack is better in some ways: http://beyondgrep.com/

Revision as of 17:51, 11 October 2015

Find Things

How to find things under Linux.

Find files by filename

Case-insensitive example:

find . -type f -iname "*hello*"

Finds "Hello, hello, Thello, Thelloman, HELLO, hELLO, ..."

Case-sensitive example:

find . -type f -name "*Hello*"

Finds "Hello, THello, THelloman, ..."

(http://stackoverflow.com/questions/13131048/linux-find-file-names-with-given-string)

Find files by content and filename

Case-insensitive example:

ack -i kmoretools

(Install with sudo zypper install ack)

Normally, one would use the standard tool grep, but ack is better in some ways: http://beyondgrep.com/


Content is available under Creative Commons License SA 4.0 unless otherwise noted.