Hello StackExchange community,
This post relates to su options - running command as another user (however I cannot make comments yet, as I have created a profile to ask this specific question below).
I would like to ask the following question (as Google cannot find the answer for me).
I have a command, which is the following:
sudo su - usertwo -c 'mv /home/usertwo/file1.txt /home/usertwo/file2.txt'
The above command is executed by userone
.
I would like the command to also appear in .bash_history
of usertwo
.
Is there a way I can "forward" the entry in .bash_history of userone into usertwo?
Thanks in advance!