Automatically change directory when switching to su

Aknot

Active Member

Reaction score: 7
Messages: 105

Hello,

Is it possible to automatically change working directory when su via Putty?
I tried to do that when logging in with a wheel account, by making changes in Putty, but that didn't work.

Thank you,
 

covacat

Member

Reaction score: 28
Messages: 85

su -l will get you to /root (simulate a login)
su -m will preserve your environment, shell history etc

depends on what are you trying to accomplish
 
Top