I face the problem with $_ usage, which $_ special parameter in terminal, And its call the last argument of the previous command.It was not work with cp and mv command in gnome-terminal.It happen to me during folder creation and mv or cp file with $_ like below mkdir test cp file.c $_instead of copying file to destination , it create a file in current directory named _filedir.Same happen with mv commandmkdir testmv file.c $_instead of moving file to destination, It moving in the name _filedir.To find the problem i use echo$ mkdir test$ echo $__filedirWhy is $_ not working with cp, mv commands?
$_ not working with copy and move commands
bash;cp;gnome terminal;mv;mkdir
$_ - Gives the last argument to the previous command. At the shell startup, it gives the absolute filename of the shell script being executed. When you execute mkdir testmv file.c $_Check if your mv, cp is an aliasIn bash to acces the last arg to the previous command in History use !:$ ,like:> mkdir test> mv file.c !:$mv file.c test