11

I am working with meteor.js and I need to increase the value of /proc/sys/fs/inotify/max_user_watches to solve my problem (here is a description of problem and solution).

But I can not do it:

➜  ~  sudo echo 10000 > /proc/sys/fs/inotify/max_user_watches
zsh: permission denied: /proc/sys/fs/inotify/max_user_watches

How can I change this value ?

1
  • 1
    sudo su and than echo 10000 > /proc/sys/fs/inotify/max_user_watches
    – Qasim
    Oct 3, 2013 at 7:46

3 Answers 3

16

Just become root by running

sudo su

And then

echo 10000 > /proc/sys/fs/inotify/max_user_watches
14

with your command, only the part on the left is run as root. you're running echo as root but not the file writing on the right. You could use this to echo as a normal user and write to the file as root.

echo 10000 | sudo tee /proc/sys/fs/inotify/max_user_watches

tee will write to standard out (your terminal) and to a file, so you run tee as root to write to a root-owned file.

1
  • sorry for the necromancy here.
    – Joe A
    Feb 5, 2014 at 0:22
7

For permanent configuration:

echo 'fs.inotify.max_user_watches = 1524288' | sudo tee /etc/sysctl.d/99-whatever.conf 
sudo sysctl -p --system

then restart the application you've been using.

source: https://confluence.jetbrains.com/display/IDEADEV/Inotify+Watches+Limit and this: https://github.com/guard/listen/wiki/Increasing-the-amount-of-inotify-watchers

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .