Skip to main content

Posts

Showing posts from March, 2016

grep command in Linux

In Linux grep stands for “global regular expression print”. The grep command used in searching and matching text files contained in the regular expressions. The syntax is: # grep pattern filename SNo Example Explanation 1 # grep apple filename The word apple will get extract from the filename 2 # grep -i apple filename ‘-i’  is a ignore case sensitive 3 # ls -l | grep filename List the files and in the listed files extract the filename 4 # ls -l | grep d Lists all the directories including files starting with d 5 # ls -l | grep ^d In this we will get only directories starting character of ‘d’ 6 # ls -l | grep ^- In this we will get only files

find command in Linux

The find command is used to find the files or directories path. The syntax is: # find /- [option] [filename] Option Usage -name For searching a file with its name -user For files whose owner is a particular user -group For files belonging to particular group