Using bash scripting I am trying to access another's users documents and search for a word in a file, how would I do this?
migrated from stackoverflow.com Mar 18 '13 at 4:47
This question came from our site for professional and enthusiast programmers.
Are you allowed to do this?
First, you need to know where their home directory is. Let's say their name is
You will need to have sufficient privileges to do so. That means there must be read and execute permissions on that folder for 'all users' or for their group (if you are also in that group). The same applies to sub-directories and files that you wish to access.
As long as you have permissions, this is just a matter of locating and grepping the file.
If you don't have permissions, then you need to login as someone who does. That is likely to be the