where have my files under 'root' gone (Solved)

Quick to answer questions about finding your way around Linux Mint as a new user.
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions use the other forums in the support section.
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
Crumblins

where have my files under 'root' gone (Solved)

Post by Crumblins »

hi please excuse me if this is a silly question can anyone tell me where my files have gone under 'root' ..? under 'home' and under 'root' are showing same files as can be seen from this screenshot any pointers as to my ignorance would be a help with thans for your time and I suspect patience...



file:///home/david/Pictures/Screenshot%20from%202013-07-06%2016:54:11.png
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 2 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
User avatar
xenopeek
Level 25
Level 25
Posts: 29597
Joined: Wed Jul 06, 2011 3:58 am

Re: where have my files under 'root' gone

Post by xenopeek »

Something went wrong; you didn't include a screenshot, just the name of the file on your computer?
Image
Crumblins

Re: where have my files under 'root' gone

Post by Crumblins »

xenopeek wrote:Something went wrong; you didn't include a screenshot, just the name of the file on your computer?

hi sorry cant get screenshot to work on this ...Screenshot from 2013-07-06 16:54:11.png is an invalid filename. keeps coming up
User avatar
xenopeek
Level 25
Level 25
Posts: 29597
Joined: Wed Jul 06, 2011 3:58 am

Re: where have my files under 'root' gone

Post by xenopeek »

Try uploading it to a image file hoster, such as http://imgur.com/, and sharing the link there.
Image
Crumblins

Re: where have my files under 'root' gone

Post by Crumblins »

xenopeek wrote:Try uploading it to a image file hoster, such as http://imgur.com/, and sharing the link there.

hope this helps [img]http://i.imgur.com/TOkRKmC.png?3[/img]
gollum17

Re: where have my files under 'root' gone

Post by gollum17 »

That's because the home variable changes when you become root. By default under a regular account it sets it to /home/$USER but when you change to root it becomes /. The home variable is what tells linux where your home directory is, so when you open terminal your greeted with your own directory.

If you want to get back to your home directory from a root account, just type

Code: Select all

 cd /home/yourusername 
.

Sprint GS3 Running TN's Msg and Chubbs
gollum17

Re: where have my files under 'root' gone

Post by gollum17 »

To see a list of all your local variables, type "set" in terminal.

Sprint GS3 Running TN's Msg and Chubbs
Crumblins

Re: where have my files under 'root' gone

Post by Crumblins »

gollum17 wrote:To see a list of all your local variables, type "set" in terminal.

Sprint GS3 Running TN's Msg and Chubbs
man I am so confused ... why does linux make it soo hard to follow ...or am I just stupid... ...? :(
User avatar
xenopeek
Level 25
Level 25
Posts: 29597
Joined: Wed Jul 06, 2011 3:58 am

Re: where have my files under 'root' gone

Post by xenopeek »

What actually happened in your screenshot:
- You were in your own home directory, and showed its contents
- You ran `sudo su`, which changes only which user you are
- You were still in your own home directory, and not in root's because you haven't changed to that, and showed its contents

That is all as expected. You just changed which user you are, and nothing else.

As per the manpage of su, use `sudo su -` (a minus sign as a parameter at the end) to get what you want: changing the user and also changing to its home directory.

Code: Select all

OPTIONS
       The options which apply to the su command are:

       -, -l, --login
           Provide an environment similar to what the user would expect had
           the user logged in directly.
.
Of course, this is rather redundant as the above can just be done with `sudo -i`; no su needed. Linux doesn't make this difficult, its all documented right there in the manpages :wink:
Image
Crumblins

Re: where have my files under 'root' gone

Post by Crumblins »

xenopeek wrote:What actually happened in your screenshot:
- You were in your own home directory, and showed its contents
- You ran `sudo su`, which changes only which user you are
- You were still in your own home directory, and not in root's because you haven't changed to that, and showed its contents

That is all as expected. You just changed which user you are, and nothing else.

As per the manpage of su, use `sudo su -` (a minus sign as a parameter at the end) to get what you want: changing the user and also changing to its home directory.

Code: Select all

OPTIONS
       The options which apply to the su command are:

       -, -l, --login
           Provide an environment similar to what the user would expect had
           the user logged in directly.
.
Of course, this is rather redundant as the above can just be done with `sudo -i`; no su needed. Linux doesn't make this difficult, its all documented right there in the manpages :wink:



ok thank you its a virtual 'root' so to speak ... does this mean that I cannot access my 'real' root on my machine i have seen that nearly all recommend staying clear of 'root' as much as possible as a precaution against the user damaging his OS for good...
Locked

Return to “Beginner Questions”