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

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • VCS
  • Interview Questions
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • 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. How To Disable MD5-based HMAC Algorithm’s for SSH
  2. CentOS / RHEL 4 : How to install and configure FTP server (vsftpd)
  3. Beginners Guide to Samba (Installation and Configuration)
  4. flameshot: command not found
  5. debuild Command Examples in Linux
  6. mdadm: Cannot open /dev/sda1: Device or resource busy
  7. CentOS / RHEL : How to rotate /var/log/wtmp and /var/log/btmp file using logrotate
  8. sudo Command Examples in Linux
  9. Where to find ASMLib / oracleasm RPMs for CentOS/RHEL, SUSE, OEL
  10. CentOS / RHEL 6 : How to change the verbosity of debug logs during booting

You May Also Like

Primary Sidebar

Recent Posts

  • protonvpn-cli Command Examples in Linux
  • protonvpn-cli connect Command Examples
  • procs Command Examples in Linux
  • prlimit: command not found

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright