Bash History: Correct / Repeat The Last Command With a Substitution

Posted on in Categories , , last updated February 23, 2016

I often type the wrong command as follows under Linux bash shell:

rsync -av dir1 [email protected]:/path/to/dir1

OR

cp -av file1*.txt file2*.txt /path/to/dest

I need to correct those command as follows:

rsync -av dir5 [email protected]:/path/to/dir1
cp -av delta1*.txt delta2*.txt /path/to/dest

How do I replace dir1 with dir5 or file with delta and repeat the last command under bash shell?

Unix / Linux: Find Information About The Process Including All Command Line Parameters

Posted on in Categories , last updated March 28, 2012

I‘m using ps command to read a snapshot of the current processes under Unix / Linux operating systems. However, ps -e or ps aux only displays command / processes names. I need to see complete information about the process including all parameters passed to it. How do I see it under Unix / Linux using ps command?