I wanted to use and have tried  sudo usermod durrantm_test -mdl durrantm_test2but I get Usage: usermod [options] LOGIN...Howeversudo usermod durrantm_test -l durrantm_test2 -md durrantm_test2doesn't give an error but seems repetitive, can I shorten it?
Is there a shorter way to change username, home directory and move files at the same time
users;sudo
usrmodx() { sudo usermod $1 -l $2 -md $2; }usrmodx durrantm_test durrantm_test2But shouldn't it be,sudo usermod -l new_name -md new_dir old_namesosudo usermod -l durrantm_test2 -md durrantm_test2 durrantm_testand as a function,moveuser() { sudo usermod -l $2 -md $2 $1; }moveuser durrantm_test durrantm_test2or am I missing something?This assumes you're using a shell which supports functions (e.g. bash), and avoids aliases because you can't use positional variables.