Tag Info

Hot answers tagged

4

!-2 More fun is available. Say you want to keep operating on a file (as above, where you're using test.py, repeatedly): cp foo.py thing.py edit $_ python $_ !-2 ^thing^foo Copy an existing file to thing.py Edit (vim, emacs - though why you'd be using a command line if you were running Emacs-OS, I have no idea) thing.py - the last word in the previous ...


4

You can use !-2: $ echo foo foo $ echo bar bar $ !-2 echo foo foo That may not help with your right-hand situation. You can also use !string history searching for this sort of case: $ python test.py $ vim test.py $ !py python test.py # Printed, then run This may be more convenient to use. It will run: the most recent command preceding the current ...


2

Options for compgen command are the same as complete, except -p and -r. From compgen man page: compgen compgen [option] [word] Generate possible completion matches for word according to the options, which may be any option accepted by the complete builtin with the exception of -p and -r, and write the matches to the standard output For options ...



Only top voted, non community-wiki answers of a minimum length are eligible