Linux and Bash


For Loops

Digital Ocean has a great writeup to get you started

sed: String Replacement

Here is an illustrative example. We want to change a folder’s permissions, but the path name is surrounded in quotation marks and needs to be extracted from the output of another command (docker ps). Our desired path is the second string in the output of grep, so we pass it to awk before sed:

sudo chmod 777 $(docker inspect shared-shared | grep "Mountpoint" | awk '{print $2}' | sed 's/"//g' | sed 's/,//g')


Restarting Networking

Setting Up A Secure Ubuntu Server in the Cloud

Michael Pilosov
An (applied) mathematician on a mission. Based in Denver, CO.