Score:0

I made a mistake with chown command

mq flag

i was tried to run a command sudo chown -R $USER:$USER . in a specific folder, but i pressed the button / instead of .

I canceled the command before it ended, but it certainly changed the owner of some folders from my Linux.

After that, some strange things started to happen in the system, can i revert the owner from all main folders in the system?

Score:1
cn flag

You have destroyed your system. Sorry.

There is no "revert" unless you have a complete backup to restore from.

If you don't have a complete backup, then use a LiveUSB to preserve your data to some other media, then reinstall Ubuntu.

Score:0
br flag

You can try this. Usually a reinstall is faster and more secure.

Boot a LiveUSB and transfer the file-ownership from the LiveUSB to your system.

Mount your system in "/target" and run this command as root (it will produce errors for files not found):

find /etc /dev /sbin /bin /usr /var | xargs -i -n 1 chown --reference="{}" "/target{}"

Depending on your system, you might have to adept the command.

The command will only update the files and directories which are on the LiveUSB. All others have to be handled manually.

The directories with the most diverse ownership is "/dev" and "/var", there you have to manually look and adept the settings.

Other directories, e.g. "/root", "/opt", "/srv" are usually belonging to user "root.root".
The content of directory "/home" should be clear to whom the files belong.

Good news: As you already broke the system, this procedure can not make it worse.

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.