finding specific files and data inside files

Naseer

I am pretty new to Ubuntu I am trying to grasp concepts of finding specific files in directories and in another instance finding specific string or pattern of strings in files. I have read various articles and found command grep and find. Am I on the right track if not please guide me?

nux

grep command is used to search text or searches the given file for lines containing a match to the given strings or words. By default, grep displays the matching lines.

Examples :

grep 'yourword' filename 
grep 'yourword' file1 file2 file3
grep 'string1 string2'  filename
cat otherfile | grep 'something'
command | grep 'something'
command option1 | grep 'data'
grep --color 'data' fileName

Find Command is one of the most important and much used command in Linux sytems. Find command used to search and locate list of files and directories based on conditions.

Examples :

Find all the files whose name is test.txt in a current working directory.

find . -name test.txt

Find all directories whose name is test in / directory.

find / -type d -name test

Find all the files whose name is test.txt and contains both capital and small letters in /home directory.

find /home -iname test.txt

More Help man grep , man find

Reference Site

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Headers not finding files inside folders

From Dev

Finding files not ending with specific extensions

From Dev

Finding and deleting files with a specific date

From Dev

Finding files not ending with specific extensions

From Dev

Finding files in a specific date and then search for a phone number

From Dev

Finding files in a specific date and then search for a phone number

From Dev

Comparing two files script and finding the unmatched data

From Dev

Not finding local data files saved in my application

From Dev

Comparing two files script and finding the unmatched data

From Dev

data getting truncated while finding files in subfolder

From Dev

Finding the oldest folder in a directory in linux even when files inside are modified

From Dev

Finding match from a specific columns across two files

From Dev

Finding files with specific name and making output like txt

From Dev

Finding and comparing files in Python

From Dev

Grunt uglify not finding files

From Dev

Finding files for playing sound

From Dev

Regular Expressions for finding files

From Dev

finding files and moving their folders

From Dev

Finding and renaming files

From Dev

Finding edited system files

From Dev

Finding files in sub directories

From Dev

karma not finding files

From Dev

Finding files for playing sound

From Dev

Finding sparse files?

From Dev

Linux finding files -mtime

From Dev

Finding Files using regex

From Dev

Finding files using /\.c/

From Dev

Nginx not finding PHP files

From Dev

Using data files not incorporated inside my app