From: Nicolas Boisselier Date: Sun, 5 Feb 2017 23:20:55 +0000 (+0000) Subject: etc/profile.d/functions X-Git-Url: https://git.nbdom.net/?a=commitdiff_plain;h=6f3af88e3c056d878d58359b7f023289442c6ba9;p=nb.git etc/profile.d/functions --- diff --git a/etc/profile.d/functions b/etc/profile.d/functions index f32edd66..9583d9fb 100644 --- a/etc/profile.d/functions +++ b/etc/profile.d/functions @@ -851,3 +851,19 @@ which_cache() { uncomment() { grep -Ev '^\s*(["/\#\;-]|$)' $@ | grep -Ev "^\s*'" | cat } + +gid_from_to() { + local cmd="find / -xdev -uid $1 -exec chgrp -v $2 {} \;" + echo "Press a key to run:" + echo "$cmd" + read + eval "$cmd" +} + +uid_from_to() { + local cmd="find / -xdev -uid $1 -exec chown -v $2 {} \;" + echo "Press a key to run:" + echo "$cmd" + read + eval "$cmd" +}