Useful bash aliases for VPS ================================================================================ Some useful bash aliases that I use on my VPS’: www=/srv/www conf=/etc/apache2/sites-enabled alias ra='/etc/init.d/apache2 restart' alias ownit='chown -R www-data:www-data .' Create an Apache conf and directory for a new domain: function makeconf { primary=${1} conffile="${conf}/${primary}.conf" site_path="/srv/www/${primary}" mkdir -p ${site_path} echo "" >> "${conffile}" echo " ServerName ${primary}" >> "${conffile}" echo " ServerAlias www.${primary}" >> "${conffile}" shift for i; do cat >> "${conffile}" <> "${conffile}" echo "" >> "${conffile}" } Grab the latest Wordpress tar and extract it to the current directory: function wordpressitup { wget --no-check-certificate https://wordpress.org/latest.tar.gz tar xfz latest.tar.gz cd wordpress cp -R * .. cd .. rm -r wordpress echo "Wordpress installed" } Some shortcuts to go to common directories: function dwww { cd /srv/www } function dcache { cd /var/cache/mod_pagespeed/v2 } function dconf { cd /etc/apache2/sites-enabled/ } See which directories and files are using up all of the space: function fsizes { du -h --max-depth=1 | sort -hr df -BG } ================================================================================ Published March 17, 2017 Generated from the original post: https://blog.omgmog.net/post/useful-bash-aliases-for-vps/ Max Glenister is an interface designer and senior full-stack developer from Oxfordshire. He writes mostly about front-end development and technology. - Mastodon: https://indieweb.social/@omgmog - Github: https://github.com/omgmog - Reddit: https://reddit.com/u/omgmog - Discord: https://discordapp.com/users/omgmog#6206