diff --git a/bash/biggest_dir_on_same_fs.sh b/bash/biggest_dir_on_same_fs.sh index 96d8ddd..81e109a 100755 --- a/bash/biggest_dir_on_same_fs.sh +++ b/bash/biggest_dir_on_same_fs.sh @@ -1,4 +1,4 @@ #!/bin/bash # find biggest directories in a given path without leaving the current filesystem -dir="/var/opt/gitlab"; for i in $(ls $dir); do mountpoint -q $dir/$i || du -shx $dir/$i ; done | sort -rh | head +dir="$1"; for i in $(ls $dir); do mountpoint -q $dir/$i || du -shx $dir/$i ; done | sort -rh | head diff --git a/falsefriends.md b/falsefriends.md index e6ea654..c0232a4 100644 --- a/falsefriends.md +++ b/falsefriends.md @@ -9,3 +9,7 @@ an empty string in `$PATH` is equivalent to `.`, so prepending `:` to your PATH, killall -1 -- in `killall` the parameter `-1` is - differnently to `kill` NOT interpreted as signal, but is a special variable for "applies to everything except PID1 and self". Therefore no signal is given, and the default one (15, SIGTERM) will be applied to each and every PID (but is then usually reduced again to the searchterm given). So `killall -1 java` does in pseudocode effectively: `where name is java; do [ ! PID == 1 ] && kill -s 15 $name; done` ...very dangerous + +grep -irl +-- +you'd normally expect, that `grep -irl` will find an expression to grep for at the desired location, but it does not, if symlinks are into play. Use `grep -iRl`instead.