I want to write an alias that does the following:
- The user’s (owner’s) permissions are unchanged.
- All group and world (others) permissions are set so they do not allow any access to the file – read, write, or execute
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I believe this does exactly what you want. It defines a shell function using Posix syntax that works with every Posix shell, not just bash. It works on any number of files.
It removes rwx permission bits from only the group and others, leaving the user permissions as whatever they previously were.