Let there be life!
# create directory named georgemkdir george​# create file with name georgetouch george​# edit filenano george​# edit with vivi george
# check for updatessudo apt-get update​# upgradesudo apt-get upgrade​# install new packagesudo apt-get install new_package​# cleanupsudo apt-get autoremove​# Fix missing keyssudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 4B8EC3BAABDC4346
# find process running on port 5000sudo lsof -i tcp:5000​# kill a process with pid 1990kill -9 1990​# find and kill a process running on port 5000sudo kill $( sudo lsof -i tcp:5000 -t )​# kill all processes named Google Chrome Helperkillall -9 "Google Chrome Helper"
# check docker usagesudo docker stats​# check process usagetop​# check memory usagefree -h​# check disk usagedf -lh​# list all directories in current folder with their sizedu -h
# full process treeps -axfo pid,uname,cmd
# check application certificatespctl -a -vv /Applications/Google\ Chrome.app# /Applications/Google Chrome.app: accepted# source=Notarized Developer ID# origin=Developer ID Application: Google, Inc. (EQHXZ8M8AV)
# gzip compression on a tar archiv: tar_file files_or_folder_to_be_compressedtar cvzf my-files.tar.gz ./my-files​# unzip a tar filetar xvzf my-files.tar.gz
# Find a file by name on your machinesudo find / -name 'secret.txt'​# delete backup filessudo find . -name "*.bak" -delete
Virtual Screen
# Note: you will still need to install all the dependencies for xvfb to runxvfb-run --server-args='-screen 0 1024x768x24' node src
apt-get update && apt-get install -yq gconf-service libasound2 libatk1.0-0 libatk-bridge2.0-0 libc6 libcairo2 libcups2 libdbus-1-3 libexpat1 libfontconfig1 libgcc1 libgconf-2-4 libgdk-pixbuf2.0-0 libglib2.0-0 libgtk-3-0 libnspr4 libpango-1.0-0 libpangocairo-1.0-0 libstdc++6 libx11-6 libx11-xcb1 libxcb1 libxcomposite1 libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 libxrandr2 libxrender1 libxss1 libxtst6 ca-certificates fonts-liberation libappindicator1 libnss3 lsb-release xdg-utils wget x11vnc x11-xkb-utils xfonts-100dpi xfonts-75dpi xfonts-scalable xfonts-cyrillic x11-apps xvfbapt-get update && apt-get install -y wget --no-install-recommends \&& wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - \&& sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list' \&& apt-get update \&& apt-get install -y google-chrome-unstable fonts-ipafont-gothic fonts-wqy-zenhei fonts-thai-tlwg fonts-kacst ttf-freefont \--no-install-recommends \&& rm -rf /var/lib/apt/lists/* \&& apt-get purge --auto-remove -y curl \&& rm -rf /src/*.deb
Loops
# For loop using counterfor COUNTER in `seq 1 10`;doecho The counter is $COUNTERdone​# For loop using other valuesfor i in $( ls ); doecho item: $idone
COUNTER=0while [ $COUNTER -lt 10 ]; doecho The counter is $COUNTERlet COUNTER=COUNTER+1done
COUNTER=20until [ $COUNTER -lt 10 ]; doecho COUNTER $COUNTERlet COUNTER-=1done