Last active
November 24, 2021 16:37
-
-
Save rcmorano/5056366 to your computer and use it in GitHub Desktop.
'.bash_aliases' useful bits (recopilation)
This file contains hidden or 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
# do not check certs when connecting thru ssh NOTE: you shouldn't use it as default | |
alias ssh-no-check='ssh -o StrictHostKeyChecking=no' | |
# 'ps' that shows cgroupped processes | |
# | |
# check url for more info: http://0pointer.de/blog/projects/systemd-for-admins-2.html | |
# | |
alias psc='ps xawf -eo pid,user,cgroup,args' | |
# docker | |
alias docker-container-most-recent='docker ps| grep -v ^CONTAINER | head -n1 | awk "{print \$1}"' | |
alias docker-container-diff-most-recent='LAST_CONTAINER=$(docker-container-most-recent); if [ ! -z "$LAST_CONTAINER" ]; then docker diff $LAST_CONTAINER; else echo "There are no running containers!"; fi' | |
alias docker-container-inspect-most-recent='LAST_CONTAINER=$(docker-container-most-recent); if [ ! -z "$LAST_CONTAINER" ]; then docker inspect $LAST_CONTAINER; else echo "There are no running containers!"; fi' | |
alias docker-container-remove-all='docker ps -a | grep -v ^CONTAINER|awk "{print \$1}" | xargs -I % sh -c "docker kill %; docker rm %"' | |
alias docker-container-remove-all-non-running='docker ps -a | grep -v ^CONTAINER | grep Exit | awk "{print \$1}" | xargs -I % sh -c "docker kill %; docker rm %"' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment