Apple Interview Question
840 Interview Reviews |
Back to all Apple Interview Questions & Reviews
Interview questions and reviews posted anonymously by interview candidates
Interview Question for Software Engineer at Apple:
If you had to change permissions to read/write all recursively in the unix terminal, how would you do it?
Helpful Question?
Yes |
No
Inappropriate?
Answers & Comments (6)
0 of 5 people found this helpful
chmod -R 766 filename
Helpful Answer?
Yes |
No
Inappropriate?
4 of 5 people found this helpful
chmod -R 666 [pathname]
where:
chmod is the command
-R is the flag for recursive
666 is the octal permission for read+write for user/group/other
[pathname] is the item to apply the permission changes to. It should be a directory (not a file) as the recursive option has no meaning on a simple file.
A "7" adds execute permission, which is not what was stated.
Helpful Answer?
Yes |
No
Inappropriate?
7 of 7 people found this helpful
As stated, the question doesn't ask you to avoid ruining your directory permissions - but it does ask "how you would do it".
I use this, which makes sure to only change the permissions of files:
find . -type f -exec chmod 0666 \{} \;
Helpful Answer?
Yes |
No
Inappropriate?
9 of 9 people found this helpful
chmod -R a+rw /path
Helpful Answer?
Yes |
No
Inappropriate?
0 of 3 people found this helpful
Helpful Answer?
Yes |
No
Inappropriate?
Members can
answer or comment on this question
–
Join Now (It's Free) or
Sign In
0 of 5 people found this helpful
by Interview Candidate: