[phpBB Debug] PHP Notice: in file /includes/db/dbal.php on line 110: Undefined array key "cached"
[phpBB Debug] PHP Notice: in file /includes/db/dbal.php on line 111: Undefined array key "normal"
[phpBB Debug] PHP Notice: in file /includes/db/dbal.php on line 112: Undefined array key "total"
[phpBB Debug] PHP Notice: in file /includes/session.php on line 885: Cannot modify header information - headers already sent by (output started at /includes/functions.php:2922)
[phpBB Debug] PHP Notice: in file /includes/session.php on line 885: Cannot modify header information - headers already sent by (output started at /includes/functions.php:2922)
[phpBB Debug] PHP Notice: in file /includes/session.php on line 885: Cannot modify header information - headers already sent by (output started at /includes/functions.php:2922)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3391: Cannot modify header information - headers already sent by (output started at /includes/functions.php:2922)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3393: Cannot modify header information - headers already sent by (output started at /includes/functions.php:2922)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3394: Cannot modify header information - headers already sent by (output started at /includes/functions.php:2922)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3395: Cannot modify header information - headers already sent by (output started at /includes/functions.php:2922)
Cabrillo College Linux Classes • View topic - Searching files for specific text

Searching files for specific text

UNIX/Linux Installation & Configuration

Searching files for specific text

Postby Benji Simms on Mon May 26, 2008 12:01 pm

I can't remember where I put a file. What is the command to search through the files on my computer to find one with the word "Bones" in it?
User avatar
Benji Simms
 
Posts: 5
Joined: Thu May 15, 2008 3:40 pm

Re: Searching files for specific text

Postby Rich Simms on Mon May 26, 2008 12:44 pm

Try:

[code] find / -mount -type f -exec grep -l "Bones" {} \; 2> /dev/null
[/code]

It can take awhile to search through every file. If you see the file you want get listed you can end the search with cntl-c

The find command has a ton of options. Use the man command to read all the documentation on this command:

[code]man find[/code]

- Rich
User avatar
Rich Simms
Site Admin
 
Posts: 640
Joined: Thu May 15, 2008 2:44 pm

Re: Searching files for specific text

Postby Benji Simms on Mon May 26, 2008 12:46 pm

Thanks! I found the file I was looking for.

- Benji
User avatar
Benji Simms
 
Posts: 5
Joined: Thu May 15, 2008 3:40 pm


Return to CIS 191A - Fall 2008

Who is online

Users browsing this forum: No registered users and 0 guests

cron