In many cases when I move one or more files to a directory I want to change to that directory afterwards. I did a little search and found this discussion, which resulted in the following bash script function:
function mvcd ()
{
num_of_files=$(($# - 1))
for i in $(eval echo {1..$num_of_files})
do
eval mv \${$i} \${$#}
done
eval cd \${$#}
}
Example:
mkdir c touch a.txt b.txt mvcd a.txt b.txt c
