[Tfug] Unix Question

Stephen Hooper stephen.hooper at gmail.com
Sun Sep 24 20:44:03 MST 2006


Here are the two ways (assuming you use bash):

history | grep foo | lpr -P fooprinter
history | grep foo > foofile

That keeps the line numbers, if you didn't want those, you could throw
awk, or cut, or sed in there.

Also, there is a handy utility called "script" which forks a shell,
and saves all input.  Maybe it would be useful to you for future
exercises of this kind.

On 9/24/06, Christopher Robbins <robbinsc at gmail.com> wrote:
> Is there a way to grep the last few commands I've done and print them out or
> pipe them to a file?
>
> Thanks
>
> -Chris
>
> --
> Chris Robbins
> Dept. of English Technical Support
> http://www.homerengineeringcorp.net
> _______________________________________________
> Tucson Free Unix Group - tfug at tfug.org
> Subscription Options:
> http://www.tfug.org/mailman/listinfo/tfug_tfug.org
>




More information about the tfug mailing list