diff options
-rw-r--r-- | .zsh.after/functions.zsh | 84 |
1 files changed, 84 insertions, 0 deletions
diff --git a/.zsh.after/functions.zsh b/.zsh.after/functions.zsh index ecfc936..5be8e73 100644 --- a/.zsh.after/functions.zsh +++ b/.zsh.after/functions.zsh @@ -235,5 +235,89 @@ backupfolder() { --delete --ignore-existing --size-only -s --exclude 'lost+found' --exclude '.Trash-1000' --exclude '$RECYCLEBIN' --exclude 'System Volume Information' --exclude '.thumbs' $1 $2 } +# journalctl + +# show messages of specified system units +function sdsjfu(){ + local journal_cmd="sudo journalctl --system -a" + eval ${journal_cmd} $(echo $@ | sed 's/\ /\ -u\ /g; s/^/\ -u\ /') +} + +# follow messages of specified system units +function sdsjfu(){ + local journal_cmd="sudo journalctl --system -af" + eval ${journal_cmd} $(echo $@ | sed 's/\ /\ -u\ /g; s/^/\ -u\ /') +} + +# follow messages of specified system units for this boot +function sdsjbfu(){ + local journal_cmd="sudo journalctl --system -b -af" + eval ${journal_cmd} $(echo $@ | sed 's/\ /\ -u\ /g; s/^/\ -u\ /') +} + +# follow messages of specified user units +function sdujfu(){ + local journal_cmd="journalctl --user -af" + eval ${journal_cmd} $(echo $@ | sed 's/\ /\ --user-unit\ /g; s/^/\ --user-unit\ /') +} + +# follow messages of specified user units for this boot +function sdujbu(){ + local journal_cmd="journalctl --user -a -b" + #TODO: Check if first argument is a number, then use it for -b + eval ${journal_cmd} $(echo $@ | sed 's/\ /\ --user-unit\ /g') +} + +# show messages of specified system units since and until a specified time +function sdsjSUu(){ + local journal_cmd="sudo journalctl --system -a -S" + local args=(${@}) + journal_cmd="$journal_cmd $args[1] -U $args[2]" + args=(${args:2}) + eval ${journal_cmd} $(echo $args | sed 's/\ /\ -u\ /g; s/^/\ -u\ /') +} + +# show messages of specified system units since a specified time +function sdsjSu(){ + local journal_cmd="sudo journalctl --system -a -S" + local args=(${@}) + journal_cmd="$journal_cmd $args[1]" + args=(${args:1}) + eval ${journal_cmd} $(echo $args | sed 's/\ /\ -u\ /g; s/^/\ -u\ /') +} + +# show messages of specified user units since and until a specified time +function sdujSUu(){ + local journal_cmd="journalctl --user -a -S" + local args=(${@}) + journal_cmd="$journal_cmd $args[1] -U $args[2]" + args=(${args:2}) + eval ${journal_cmd} $(echo $args | sed 's/\ /\ --user-unit\ /g; s/^/\ --user-unit\ /') +} + +# show messages of specified user units since a specified time +function sdujSu(){ + local journal_cmd="journalctl --user -a -S" + local args=(${@}) + journal_cmd="$journal_cmd $args[1]" + args=(${args:1}) + eval ${journal_cmd} $(echo $args | sed 's/\ /\ --user-unit\ /g; s/^/\ --user-unit\ /') +} + +# show kernel messages since and until a specified time +function sdsjkSU(){ + local journal_cmd="sudo journalctl --system -a -k -S" + local args=(${@}) + journal_cmd="$journal_cmd $args[1] -U $args[2]" + eval ${journal_cmd} +} + +# show kernel messages since a specified time +function sdsjkS(){ + local journal_cmd="sudo journalctl --system -a -k -S" + local args=(${@}) + journal_cmd="$journal_cmd $args[1]" + eval ${journal_cmd} +} # FUNCTIONS > |