I've created a file containing these two lines of code:
#!/bin/sh
sudo sh -c "sync; echo 3 > /proc/sys/vm/drop_caches"
I have ticked (from 'properties') the appropriate box to run the file as a program. Clicking it, I am asked to either run it or run in terminal. The second option works as intended, with the terminal asking for my password then running the command.
Is there a way to run the program directly? Currently it doesn't work (presumably because it cannot run the sudo command without password)
gksu
instead of sudo, it's used for graphical confirmation – Sergiy Kolodyazhnyy Jun 24 '16 at 05:41