ubuntu.sh 587 B

1234567891011121314151617181920212223242526272829
  1. # Ubuntu related aliases
  2. # systemd
  3. function sys () {
  4. # systemd aliases
  5. # https://linuxhandbook.com/systemd-list-services/
  6. if [ $# -eq 0 ]; then
  7. echo "$FUNCNAME: Usage: $FUNCNAME {list|running}" 1>&2
  8. return
  9. fi
  10. if [ "$1" == "list" ]; then
  11. # list all systemd services
  12. systemctl --type=service
  13. elif [ "$1" == "running" ]; then
  14. # list running systemd running
  15. systemctl --type=service
  16. else
  17. echo "$FUNCNAME: Unknow command $1" 1>&2
  18. echo "$FUNCNAME: Usage: $FUNCNAME {list|running}" 1>&2
  19. fi
  20. }