[try Beta version]
Not logged in

 
how to rerun the command without last argument in unix

Dec 21, 2013 at 4:46am
Hi,

how to rerun the command without last argument in unix?

It means I have passed 4 arguments for execution but next time I want re-run the same command without last argument/parameter.

Please help me on this.
Last edited on Dec 21, 2013 at 4:58am
Dec 27, 2013 at 11:46pm
That depends on your shell. Bash, for example, has command line history, so you could tap Up-arrow once and then delete the trailing parameter with Backspace.
Dec 28, 2013 at 5:58am
I am asking like as follows

>!3*
Dec 30, 2013 at 10:27pm
man bash Word Designators:
> echo foo bar gaz bah
foo bar gaz bah

> !!:0-3
echo foo bar gaz
foo bar gaz

Topic archived. No new replies allowed.