Does anyone know if it's possible to execute and renice a process in one command, i.e. without having to look up the command in the list of processes using the ps command and then renice that particular pid.
Execute and renice a process in one command
command line;priority;nice
As I mentioned, @glenn-jackman gave you the answer. But just to elaborate a bit more, if you wish to give higher priority to the command but do not intend to run it as root, you could use a function (and sudo):nice_cmd() {  PRIORITY=$1 ; shift  CMD=$1 ; shift  ${CMD} $@ & cmdpid=$!  sudo renice -n ${PRIORITY} -p ${cmdpid}}Then execute it as (this could ask for your user password, depending on how is sudo configured)$ nice_cmd -5 vim somefile$ fgAnd from a top on another terminal, you can double check the nice value.