0

I was trying to set permissions on all of the files in a removable hard disk. I had tried chown and chmod on the disk address (i.e. /dev/sdb) but I still couldn't move files as a user. Then I tried to recursively set permissions and ownership on all files on the disk with

sudo chmod -R 666 /media/jdh/b041de7c-7698-44ae-a387-482ab9e60201/

and

sudo chown -R jdh /media/jdh/b041de7c-7698-44ae-a387-482ab9e60201/

Then when I checked the GUI if found all of the directories contained no files and all of the files were 0 bytes in size. To be sure I checked ran ls and found all of the files present and of reasonable size.

I don't know how the removable disk is formatted.

What has happened? How can I make the files visible in the GUI again?

6
  • 3
    You are missing the execute permissions on directories, so you will not be able to open/view them. Are you using root user to view them or the jdh user? What are you trying to accomplish? Why not set them with 775 instead? Commented Mar 11, 2020 at 9:05
  • I'm just trying to move the files with user the user account. I didn't realize that files had to be executable to be viewable in the file manager. I'm not trying to open them I just want to see that they are there. Commented Mar 11, 2020 at 9:30
  • I ran the commands using 775 instead and I can see the files once more. Thank you Commented Mar 11, 2020 at 9:33
  • Would it be impolite of me to write an answer to this question using the information you provided me? Commented Mar 11, 2020 at 9:35
  • Not at all, go ahead! Commented Mar 11, 2020 at 12:27

1 Answer 1

0

If a directory is not executable then it cannot be opened. chmod 666 removes execute privileges. If you use a different command like chmod 775 or chmod 777 then you will be able to see inside the directory again since they restore execute privileges.

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.