Linux Commands

From WICS
Jump to navigation Jump to search

nice

nice is a Linux command that allows a user to define the "niceness" of a process. Basically, a user can set the priority of their process above other processes (less nice) or below other processes (more nice). This can be really useful when someone wants to run a long simulation on a shared workstation.

The range of values is -20 to +19.

  • A low or negative value means that your process gets high priority; in other words, you're not very nice to other users on the system.
  • A high value means that your process gets low priority; in other words, you're going to be nice to other users on the system.

If you don't assign a "niceness" to a new process, then the new process is given a default nice value by the parent process.

Cass & Oakland Setup

On cass and oakland, the default nice value appears to be +4, and since it doesn't appear that we have permission to become a super-user, we can't set the nice value < +4. Also, because we can't become super-users, we can't change the nice value of other user's processes (which is both good and bad).

Example(s)

  home -: nice +10 icfb &
  home -: nice +8 matlab &

renice

renice is a Linux/Unix command that allows a user to change the "niceness" of a process that's already running. This can be really useful if someone starts a long simulation but forgets to change the nice value so that other users can work on the shared workstations.

The range of values is -20 to +19; however, you can only increase the nice value of a process with the renice command. In other words, it is only possible for a user to be nicer.

Example(s)

If a icfb process is already running with a nice value equal to +4, then the following is a valid command:

  home -: renice +5 icfb &

However, if a icfb process is already running with a nice value greater than +5, then the previous command would return an error.

top

top is a Linux command that allows a user to see information about the current processes that are running on a machine. To quit out of the command, type q.

Example(s)

  home -: top
  home -: top [-u user]

Headings

  • PID - process id
  • USER - user name
  • PR - priority
  • NI - nice value

...

  • %CPU - % of CPU (per CPU core) being utilized
  • %MEM - % of memory being utilized

External Links