In order to monitor the filesystem activity on my computer, I found command "sudo fs_usage", which works very well in Terminal. Then I had the idea to display those system activities (written) on my desktop wallpaper.

I downloaded the app "GeekTool" and created a "Shell" widget with the command:

echo "root password" | sudo -s fs_usage

But it doesn't work :(

  • I expect sudo doesn't work with GeekTool widgets, as there's nowhere for you to authenticate as root. – Timothy Mueller-Harder Oct 18 '18 at 22:29
  • When you say "monitor the activity" do you specifically mean file reads/writes? – Timothy Mueller-Harder Oct 18 '18 at 22:32
  • @ Timothy Mueller-Harder - yes, I mean monitoring reads and writes on my hd. I use little snitch to monitor network activity. I did not find any similar app for hd activity; and there are a lot of activity always going on in background I like to know or kill, respectively. – Vincent Oct 19 '18 at 0:02
  • But you give me also hint for CPU usage and RAM usage. Activity Monitor. iStat has great graphics. But I would like to know where it is, especially folder/source on HD / RAM. – Vincent Oct 19 '18 at 0:11
  • Try "echo <root password> | sudo -s fs_usage" in your terminal and you don't need to type root password – Vincent Oct 19 '18 at 0:12

You can circumvent the need to enter a password to use fs_usage by means of the sudoers file.

Warning: I am not a security expert in any way, and modification of the sudoers file should only be performed with extreme caution. I don't think this particular solution would be a security issue, but again, I’m not an expert.

  1. Open Terminal, type sudo visudo, and enter your password.
  2. Scroll down using the arrow keys to the “User privilege specification” section.
  3. Look for a line that starts with your username, or failing that, one that starts with %admin.
  4. Position the cursor just below that line and press A to enter insert mode.
  5. Add the following text on its own line:

    yourusername ALL=(root) NOPASSWD: /usr/bin/fs_usage
  6. Press esc, then type :wq enter to save your changes and quit.

You will need to restart GeekTool. I don’t think you need to reboot for the changes to take effect, but if it doesn’t work, try that.

  • 1
    This is a much better idea than putting your password into your Geek Tool shell widget. 👍 ★ – TJ Luoma Oct 19 '18 at 1:20
  • Ok, I accidentally deleted unrecoverable my sudoers file. What now? – Vincent Oct 19 '18 at 20:27
  • How.... 😐It should be ok if you follow these instructions carefully. – Timothy Mueller-Harder Oct 19 '18 at 20:45
  • Oops, I forgot to link the thing I meant to! unix.stackexchange.com/a/74145 – Timothy Mueller-Harder Oct 19 '18 at 20:52

You must log in to answer this question.

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