• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • VCS
  • Interview Questions
  • Database
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

nice: command not found

by admin

The nice command enables you to run a command with a different nice value than the default. The -n option increments the nice value by the given integer; if you don’t provide an integer, then the command will assume an increment of 10. By running nice without any options, you’ll see the default nice value. You must have the root user authority to run a command at a higher priority. Once lowered, the priority for any process cannot be increased by normal users, even if they own the process.

Syntax

The syntax of the nice command is:

# nice [-n {nice value increment}] [command]

If you encounter the below error while running the nice command:

nice: command not found

you may try installing the below package as per your choice of distribution:

Distribution Command
OS X brew install coreutils
Debian apt-get install coreutils
Ubuntu apt-get install coreutils
Alpine apk add coreutils
Arch Linux pacman -S coreutils
Kali Linux apt-get install coreutils
CentOS yum install coreutils
Fedora dnf install coreutils
Raspbian apt-get install coreutils

Normally, when a process is started, it gets the default priority value of 0. The nice command is used to start a process with a different priority. Its syntax is as follows:

# nice -n [NICELEVEL] [command]

Here’s an example of setting a big job to run at nice level 7:

# nice −7 sort VeryLargeFile > outfile

If you run nice without a level, 10 is used. Normal processes (run without nice) run at level zero, which you can see by running nice with no arguments:

# nice
0

The superuser can also lower the nice level, increasing a process’s priority:

# nice --10 myprogram

(Yes, that’s “dash negative 10”.) To see the nice levels of your jobs, use ps and look at the “NI” column:

# ps -o pid,user,args,nice

Filed Under: Linux

Some more articles you might also be interested in …

  1. CentOS / RHEL 6 : How to password-protect single user mode
  2. iw Command Examples in Linux
  3. jhat Command Examples
  4. Linux / UNIX : How to create primary partition using fdisk
  5. firebase – Test, manage, and deploy Firebase projects from the command-line
  6. Linux OS Service ‘NetFS’
  7. doctl serverless: Manage serverless functions
  8. repo-add: command not found
  9. ect: Efficient Compression Tool
  10. iostat: command not found

You May Also Like

Primary Sidebar

Recent Posts

  • Vanilla OS 2 Released: A New Era for Linux Enthusiasts
  • mk Command Examples
  • mixxx Command Examples
  • mix Command Examples

© 2025 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright