I use su when I often need to set proper permissions when copying files etc, but forget if I used su to get there, ex:
root@host> su bob
bob@host> copy folderA folderB
But sometimes I forget if I logged in as bob or if I was root and su'd to become bob, make since? So a full example:
bob@host> su
....
root@host> su bob
bob@host> cp folderA folderB
....
bob@host> ????????
Now at this point I forget if I am directly logged into the computer or if I am su'd in, I can press CTRL-D which would tell me if I was root, but if not I get logged out.
I understand sudo is good and secure and all, but I'm curious if there is a way to do this without avoiding using su.
Anyone have some ideas?