This link gives the pointer on how to recall the arguments of the last successfully executed command in the command line.
I wanted to access all the arguments of a particular command from the shell history.
To me only this syntax works
ls f1 f2 f3
file !ls:1-3 --> file f1 f2 f3
And, if I use !* which should give all the arguments of previous command throws error
file !ls:!*
-bash: !: unrecognized history modifier
I can only use this syntax (i.e) all arguments of last executed command.
file !*
Problem with the above methods are if I had executed ls with some option, for eg: ls -l, then the file command would have thrown a different output as the option of ls would be considered as first argument in this case.