Ubuntu – How to change ownership of hiddenfiles

command linenautilus

I've had to move from one user to another, I have found online how to move all files (including hidden) from the old user to the new and change the ownership of those files. However how can I change the ownership of all hidden folders & files which I moved across to my new home dictionary in one simple command.

Best Answer

cd ~
sudo chown -R $USER:$USER .* 
  • The -R will do all dirs and files in dirs.
  • The . will alter only hidden files (since those always start with a .).
  • The $USER needs no changing: it will be substituted to your username.