Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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

2 Answers 2

up vote 3 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. –  lucasarr 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

 
discard

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.