[colug-432] Another bash question, su + history ?

Rob Funk rfunk at funknet.net
Wed Dec 28 21:16:03 EST 2011


Why not just use sudo instead of su? Then your history stays in one place, and only the commands that need to run as the other user do.
-- 
Sent from my Android phone with K-9 Mail. Please excuse my brevity.

Tom Hanlon <tom at functionalmedia.com> wrote:

Colug, 

I find myself in training classes as the instructor where a student or myself has performed a number of steps while logged in as the incorrect user. 

So I point this out, and they su as needed. 

But the history is left as entered in the wrong user history file. 

Does anyone here have any quick tricks to su but also grab the last 10 lines or so of history ? 

I am thinking I could write up a shell script, but thoughts on shortcuts. 

history 10 >> new user history file or something ? 

--
Tom 



Tom Hanlon
tom at functionalmedia.com
Cloudera Certified Hadoop Developer
Certified MySQL DBA


_____________________________________________

colug-432 mailing list
colug-432 at colug.net
http://lists.colug.net/mailman/listinfo/colug-432

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.colug.net/pipermail/colug-432/attachments/20111228/8f3622a4/attachment.html 


More information about the colug-432 mailing list