1

I accidentally ran the following command: sudo chmod 754 opencv instead of sudo chmod 754 home/mrman/opencv

Now I can't access the folder which contains all the OpenCV files without being root. Furthermore, when I navigate to the folder, it has become an (executable) file? Please, how can I restore the folder?

folder which has become a file after chmod 754

2

That command only will change 1 file named "opencv". It would make sense for it to be a folder and if so ...

chmod 775 opencv

should restore it.

Then again: your image is showing "opencv-3.0.0-alpha". That command you used ("chmod 754 opencv") does NOT change that filename; it would only change something actually named "opencv".

So is that all you did? or did you do more?

7
  • Thanks, worked like a charm. Yes I only ran sudo chmod 754 opencv and then the folder "opencv-3.0.0-alpha" changed. I do not understand that either. Running chmod 775 opencv changed "opencv-3.0.0-alpha" back to a directory. – mr_man Feb 14 '16 at 22:21
  • you might have added a * behind it? or pressed "tab"? (so it would expand?) – Rinzwind Feb 14 '16 at 22:26
  • Ah , perhaps I did a tab yes. – mr_man Feb 14 '16 at 22:32
  • In case you want to know: type "history|grep chmod" in command line. It might list what you typed. – Rinzwind Feb 14 '16 at 22:34
  • Thanks again! It gives me this 1995 sudo chmod 754 opencv Not sure whether I did the extra tab or not. Come to think of it, I'm pretty sure I didn't... – mr_man Feb 14 '16 at 22:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.