Score:4

How to revert permissons of /media/username directory?

gb flag

I, by mistake, ran the command:

sudo chown -R username:username /media/username/*

While I intended to run:

sudo chown -R username:username /media/username/586e1a3e-80c3-4057-81bz7-bbfe7662c6ff

How can I revert the permissions of the /media/username directory and its contents?

cn flag
That command is valid for a removable media. If you want to revert either restore a backup or you will need to use `chmod` with the correct username and usergroup for each file and directory. But again: the command is the normal command to take ownership (for $USER:$USER)
Austin Rojers avatar
gb flag
You mean, there is nothing much to worry about?
Score:3
jp flag

I, by mistake, ran the command:

sudo chown -R username:username /media/username/*

While I intended to run:

sudo chown -R username:username /media/username/586e1a3e-80c3-4057-81bz7-bbfe7662c6ff

These two can be identical, if the only mounted media/disk partition was just 586e1a3e-80c3-4057-81bz7-bbfe7662c6ff.

If, however, other media were mounted at the time of running the first command, then * will normally be expanded by the shell to all non-hidden(Not starting with a dot .) files(media or otherwise) and therefore they will be affected by that command equally.

How can I revert the permissions of the /media/username directory and its contents?

This directory was not and can not be affected by your first command (Under the current versions of Ubuntu which inhibit hard/soft links to parent directories) and therefore, doesn't need reverting whatsoever.

Also, other than currently mounted media, that directory usually has no contents by default.

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.