Enrollments closing soon for Post Graduate Certificate Program in Applied Data Science & AI By IIT Roorkee | 3 Seats Left
Apply NowLogin using Social Account
     Continue with GoogleLogin using your credentials
If you want to locate a word in files, you can use the grep
command. Grep lists all the lines from files in which a particular word exists. Examples of grep
grep myword file1 file2
If you want to search in files recursively - inside every subdirectory of a directory, use the following command
grep -r myword directory
If you want to search case insensitive, use -i
switch
grep -i myword file1 file2
grep
is a very powerful tool. It can somewhat behave like where clause in SQL queries.
Few Examples are:
grep nyc tempdirectory/*
Taking you to the next exercise in seconds...
Want to create exercises like this yourself? Click here.
No hints are availble for this assesment
Answer is not availble for this assesment
Loading comments...