0

Can some one tell me the Linux command to search for any name that has referenced inside in any of the files in the directory? eg : I need to search for a script say abc.sh that has reference in any other scripts in the same directory. So I need the list of all scripts where the abc.sh has a reference.

Thanks,

user3834663
  • 513
  • 2
  • 7
  • 17
  • What do you mean with "reference"? A is referenced by B if the name of A is written inside B? Or you are referring to symbolic links? – Emanuele Paolini Aug 29 '14 at 07:19
  • possible duplicate of [Finding all files containing a text string on Linux](http://stackoverflow.com/questions/16956810/finding-all-files-containing-a-text-string-on-linux) – Emilien Aug 29 '14 at 08:24

1 Answers1

0

Try this to get the list:

grep -l abc.sh  *
Mark Setchell
  • 191,897
  • 31
  • 273
  • 432
  • Thanks, But can you tell me what -l is used for ? – user3834663 Aug 29 '14 at 16:32
  • It tells `grep` to only show the NAMES of the files rather than the complete lines on which your string occurs. Type `man grep` and then hit SPACEBAR to read through the manual for `grep`. – Mark Setchell Aug 29 '14 at 17:51