From a4fa177b3f84d8c1cb8b77e08475d973bcee8032 Mon Sep 17 00:00:00 2001 From: Anthony Wang Date: Fri, 22 Nov 2024 21:01:06 -0500 Subject: Add system management Fish functions --- fish/functions/pacprov.fish | 3 +++ fish/functions/pacreq.fish | 3 +++ fish/functions/sysusers.fish | 4 ++++ 3 files changed, 10 insertions(+) create mode 100644 fish/functions/pacprov.fish create mode 100644 fish/functions/pacreq.fish create mode 100644 fish/functions/sysusers.fish diff --git a/fish/functions/pacprov.fish b/fish/functions/pacprov.fish new file mode 100644 index 0000000..729bc7a --- /dev/null +++ b/fish/functions/pacprov.fish @@ -0,0 +1,3 @@ +function pacprov + pacman -Qi | grep ^Provides | grep -wo "[^ ]*" | sort | uniq -d | grep -v ":\|None\|Provides" +end diff --git a/fish/functions/pacreq.fish b/fish/functions/pacreq.fish new file mode 100644 index 0000000..e6e057b --- /dev/null +++ b/fish/functions/pacreq.fish @@ -0,0 +1,3 @@ +function pacreq + pacman -Qi (pacman -Qeq) | grep "Name\|Required" | grep -v None | grep "Required" -B1 +end diff --git a/fish/functions/sysusers.fish b/fish/functions/sysusers.fish new file mode 100644 index 0000000..eef7b11 --- /dev/null +++ b/fish/functions/sysusers.fish @@ -0,0 +1,4 @@ +function sysusers + diff (awk -F: '$3 < 1000 {print $1}' /etc/passwd | sort | psub) (systemd-sysusers --tldr | awk '$1 == "u" {print $2}' | grep -v nobody | sort | psub) + diff (awk -F: '$3 < 1000 {print $1}' /etc/group | sort | psub) (systemd-sysusers --tldr | awk '$1 == "u" || $1 == "g" {print $2}' | grep -v nobody | sort | uniq | psub) +end -- cgit v1.2.3-70-g09d2