How do i copy the last used command in linux comand prompt?
use echo to print
echo !!
use redirection to dump to file
echo !! > last_command.txt
use two greater-thans to append a file
echo !! >> command_list.txt
copying to an environment variable depends on your shell. in csh, it'd be
setenv MYCOMMAND !!
but in bash it'd be something like
export MYCOMMAND=!!
7/21/2008
Copy the last used command in linux comand prompt
Posted by
admin
at
7/21/2008
Labels: Linux
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment