Last active
December 4, 2022 23:10
-
-
Save naneri/c62eeaf2b7e031cf9230741b9a0d49fd to your computer and use it in GitHub Desktop.
My bash cheatsheet
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
# ========== | |
# Laravel | |
# ========== | |
# Laravel folder permissions | |
sudo chgrp -R www-data storage bootstrap/cache | |
sudo chmod -R ug+rwx storage bootstrap/cache | |
# ========== | |
# SSH | |
# ========== | |
# quickly copy your ssh key to remote server | |
ssh-copy-id username@remote_host | |
# ========== | |
# Echo | |
# ========== | |
# echo output to a file | |
echo "some text" > kana.txt | |
# echo append output to a file | |
echo "some text" >> kana.txt | |
# echo with interpreting special characters | |
echo -e "some text \nnew line \nanother line" | |
# ========== | |
# DOCKER | |
# ========== | |
# install Docker script | |
curl -fsSL get.docker.com -o get-docker.sh | |
sh get-docker.sh | |
# install Docker | |
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add | |
https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | |
sudo apt-get update | |
sudo apt-get install -y docker-ce | |
# list all docker containers | |
docker container ls -a -q | |
# stop all docker containers | |
docker container stop $(docker container ls -a -q) | |
# remove all docker containers | |
docker container rm $(docker container ls -a -q) | |
# remove all docker images | |
docker rmi (docker images -a -q) | |
# ========== | |
# DOCKER | |
# ========== | |
# Kill process by port | |
sudo kill $(sudo lsof -t -i:9001) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment