Last active
May 30, 2023 11:32
-
-
Save Feniksovich/6ee82d59c6af7a1d7a75cf719c202b62 to your computer and use it in GitHub Desktop.
systemctl aliases
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Basic systemctl commands | |
alias ctlsp="systemctl stop" | |
alias ctlst="systemctl start" | |
alias ctlrt="systemctl restart" | |
alias ctls="systemctl status" | |
# Enable/Disable commands for units | |
alias ctle='systemctl enable' | |
alias ctld='systemctl disable' | |
# Start and then view status of service | |
ctlsts () | |
{ | |
systemctl start "$1" | |
systemctl status "$1" | |
} | |
# Restart and then view status of service | |
ctlrts () | |
{ | |
systemctl restart "$1" | |
systemctl status "$1" | |
} | |
# Masking Units to disabling them | |
alias ctlmask='systemctl mask' | |
alias ctlunmask='systemctl unmask' | |
# List failed units and reset systemd system status | |
alias ctlfailed='systemctl --failed --all' | |
alias ctlrf='systemctl reset-failed' | |
alias ctldrd="systemctl daemon-reload" | |
# Launch backup script with --manual argument | |
alias sqlbackup="sh /etc/mysql/sqlbackup.sh --manual" | |
# Lookup iptables chain | |
alias lookup="iptables --line-numbers -nvL" | |
# Parsing command | |
parse () | |
{ | |
source "$1" | |
} | |
# Archive without compressing | |
tarw () | |
{ | |
tar -cvf "$1.tar.gz" "$2" | |
} | |
# Archive with compressing (gzip) | |
targz () | |
{ | |
tar -zcvf "$1.tar.gz" "$2" | |
} | |
# Unarchive in folder with archive name | |
untar () | |
{ | |
tar -xvf "$1" | |
} | |
# Unarchive to specified path | |
untarto () | |
{ | |
tar -xvf "$1" -C "$2" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment