Recommend use of sudo -v over sudo echo

`sudo -v` (or `sudo --validate`) updates the sudo credentials cache without running any commands.

It's slightly safer than `sudo echo` under the unlikely chance that `~/.local/bin/echo` (or elsewhere on the PATH) could be set to something malicious.
This commit is contained in:
Anthony Som authored and David Peter committed 2018-01-23 07:50:06 +01:00
1 parent 2784b7fc1b
commit e4e937715e
1 file changed
+1 -1
+1 -1
View File
@@ -51,7 +51,7 @@ on Linux, you can run
``` bash
sync; echo 3 | sudo tee /proc/sys/vm/drop_caches
```
To use this specific command with Hyperfine, call `sudo echo` to temporarily gain sudo permissions
To use this specific command with Hyperfine, call `sudo -v` to temporarily gain sudo permissions
and then call:
``` bash
hyperfine --prepare 'sync; echo 3 | sudo tee /proc/sys/vm/drop_caches' 'grep -R TODO *'