PDA

View Full Version : [ubuntu] New to Linux - How do I find...



bobsummer45
September 20th, 2009, 09:53 AM
New to Linux - How do I find a file or a name inside a file.
I know its something with grep but I am not really sure.
Please someone help.

Thanks

mapes12
September 20th, 2009, 09:59 AM
Hi

I would go Places>Search for files

There are probably other ways to find stuff..............

badger_fruit
September 20th, 2009, 10:09 AM
New to Linux - How do I find a file or a name inside a file.
I know its something with grep but I am not really sure.
Please someone help.

Thanks


if you insist on using the terminal, the man pages are usually VERY good places to start; eg "man grep"

Grep (if I recall correctly) allows you to filter the outputs of things such as system commands or the contents of files


tail -f /var/log/messages | grep usb

or


more /path/file | grep sausages

would tail the /var/log/messages file and update automatically but only display the line if something with the phrase "usb" is found within - or - example 2 will display the /path/file using "more" and only show lines with the phrase "sausages" in.

"find" will find files, use man find or google "man find" will produce countless pages, here's one I found
http://unixhelp.ed.ac.uk/CGI/man-cgi?find

Another good resource is http://www.manpagez.com/

konqueror7
September 20th, 2009, 10:09 AM
search a file via,

locate <filename>
and search a name in a file,

cat <filename> | grep <keyword>

my above suggestion are based on what i understand from your post, hope it helps!