2

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

$ grep -rnw "umask" ~
  • 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
5

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

grep [OPTIONS] PATTERN [FILE...]

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" ~
| improve this answer | |