This question already has an answer here:

What command can you use to quickly find which file on your home folder containing the umask command?

$ grep -rnw "umask" ~

marked as duplicate by muru, karel, WinEunuuchs2Unix, heemayl command-line May 24 '18 at 12:03

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • What do you mean exactly by "containing umask command"? You mean with the default permission set by umask? By default it'd be umask 022, resulting in file permissions 755. – M. Becerra May 24 '18 at 9:05

The pattern in grep is placed in front of the file/path:


To receive just the matching filenames instead of the matches, you should use -l option:

grep -rlw "umask" ~

If you want all matches of all files including their line number, you need to use -n instead of -l:

grep -rnw "umask" ~