0

I am trying to copy a file from Root directory over to my home directory. I had to execute the extraction of a file as ROOT user. I can see it is extracted into root directory but I now want to access this in my home directory. I have tried a number of commands to do this but it seems to fail.

  • welcome to U&L, what do you mean by "extracting" ? tar ? unzip ? a system command that must be run as root and is redirected in a file ? can you edit your question to add more details ? – Archemar Oct 3 '18 at 13:53
  • So…the extract command doesn't let you choose a directory to put your extracted files? What commands have you tried? – 炸鱼薯条德里克 Oct 3 '18 at 14:07
2

Assuming your username is deirdre:

As root, you have to move the file from root's homedir to deirdre's homedir and give it ownership to deirdre:

mv /root/somefile ~deirdre/
chown deirdre ~deirdre/somefile

Once you've done this, you will be able to login as deirdre and access the file.

It isn't clear from your question whether the file is in root's home directory or in the filesystem root; if it is the last case, the commands are instead:

mv /somefile ~deirdre/
chown deirdre ~deirdre/somefile
  • thank you so much this worked for me finally! – Deirdre Oct 3 '18 at 15:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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