Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial![](https://ecs-static.teamtreehouse.com/assets/views/marketing/shared/community-banner-white-47072046c51352fe6a69f5e691ff5700b28bb11d45197d7bdf066d9ea3f72d0c.webp)
![Sahil Katrekar](https://secure.gravatar.com/avatar/ca2087fffd764e53f6f452b2933cb350?s=96&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
Sahil Katrekar
1,480 PointsConfused on this idea
I understood in general that the home directory is /home/username, so it makes sense that when we were logged in as the treehouse user, the home directory is /home/treehouse. When we created the mike user and switched to the mike user using the command 'su mike' and typed the command pwd, the result was still /home/treehouse. Shouldn't it be /home/mike because we are now logged in to the mike user and are now in mike's home directory? I feel like I am missing an important concept here.
Thanks for clarifying!
3 Answers
![Jennifer Nordell](https://uploads.teamtreehouse.com/production/profile-photos/5432702/micro_jen-square.jpg)
Jennifer Nordell
Treehouse TeacherYou know in Windows when you switch user and then log over to them, the desktop and the file structure and whatnot gets displayed for that user? Well, this doesn't work exactly like that. The command "su" stands for substitute user. It's also referred to switch user. What you're actually doing is not logging out. You're just switching the user of that log in session. But now you will have rights and permissions of that user. Here's some further info about the su command.
Note: if you were to log out and then log back into mike then you would see that it loads up /home/mike as the home directory. Likewise, if you "substitute user" to treehouse it doesn't jump around in the directory automatically. It just changes the owner of the login session to treehouse. Hope this helps!
![Steven Parker](https://uploads.teamtreehouse.com/production/profile-photos/969492/micro_tool_chess_set_2.jpg)
Steven Parker
230,688 PointsBy default, the su command only changes the user's identity but does not change the current directory.
The --login (or -l) option can be used to re-create the login environment of the new user (su -l mike
).
![ywang04](https://uploads.teamtreehouse.com/production/profile-photos/8077942/micro_xiaogua.jpg)
ywang04
6,762 PointsYou can use su - mike to change both home directory and user's identity.