if i have one folder say aaa and that folder having 100
files from that 50 files there aaa word is written how to
find in which aaa is writen and without opening that file
Answers were Sorted based on User's Feedback
Answer / vaithy
grep -r aaa -e aaa
where,
-r recursive (includes all files, Folders and subfolders)
-e pattern (to be searched)
Is This Answer Correct ? | 2 Yes | 0 No |
Answer / nixor
grep -rl aaa ./aaa/*
That would list the file name where the string aaa is
present. (-l switch)
Is This Answer Correct ? | 0 Yes | 0 No |
Answer / m.krishna kumar
#cd aaa
#cat <file name> | grep aaa
this is work only if you know the file name otherwise it is
not use . other way is if you must count the file then find
the file name of the 50 file then use the above command.
Is This Answer Correct ? | 1 Yes | 1 No |
Answer / brian
Find ./aaa -type f -exec grep -l aaa {} \;
This will list the paths and file names containing the text aaa in any file in the directory named aaa.
Is This Answer Correct ? | 0 Yes | 0 No |
Answer / rallapalli
#cd /aaa | ls -l | grep aaa
see which file time and date through that u can know
Thanks
Is This Answer Correct ? | 0 Yes | 5 No |
How do I change shell in linux?
What is the symbol of linux?
Who am I command in linux?
1. Why "d" is postfix in almost every service name of Linux like httpd, dhcpd? 2. how to restrict su & ssh services for some users? 3. how can we configure a default gateway for 10 n/w cards in a server?
What is grep command in linux with examples?
I lost a root password and i need to give it, I treid to change it through single usermode even though i am not get a password, then what is the other procedure to give a root password?
What is option in linux command?
difference between patches and packages? and how to upgrade patches
Which is the required command for checking the file system?
What are system commands?
what is difference between $@ and $* in UNIX Shell script
what is ldd?
7 Answers IBM, Magnum, TCS, Tech Mahindra,