Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

share|improve this question
up vote 4 down vote accepted
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.
share|improve this answer
Thanks that worked amazingly well and simple too. – larrware Feb 13 '13 at 15:58
sudo chown -R user /yourdir

will change the owner of /yourdir and subfiles to "user".

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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