[colug-432] Another bash question, su + history ?
Tom Hanlon
tom at functionalmedia.com
Wed Dec 28 23:05:53 EST 2011
On Dec 28, 2011, at 9:16 PM, Rob Funk wrote:
> 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.
Laziness or accidental mostly.
> --
> 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
> _______________________________________________
> colug-432 mailing list
> colug-432 at colug.net
> http://lists.colug.net/mailman/listinfo/colug-432
Tom Hanlon
tom at functionalmedia.com
Cloudera Certified Hadoop Developer
Certified MySQL DBA
More information about the colug-432
mailing list