http://www.perlmonks.org?node_id=1011899


in reply to Re: perl one liner print columns 2.. last
in thread perl one liner print columns 2.. last

If you have both history and Perl, then you probably also have cut.

history | cut -f 2-

On my system, -n suppresses line numbers (but not the leading tab).

history -n

Though it's handy to know -a and @F autosplit command-line idioms for use in some situations, this specific situation is one for which there's a simpler, less arcane way that doesn't require Perl. Also, using cut is less destructive than using Perl because it doesn't convert tabs to spaces as the Perl autosplit trick does. (Of course, this can be remedied by specifying an alternate separator pattern with the -F command-line option, but this is just leading you down the garden path.)

Jim