9

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 ?

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

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.

  • sorry for the necromancy here. – Joe A Feb 5 '14 at 0:22
6

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.