My ~/.bash_aliases 2017

I have a base ~/.bash_aliases file which I normally use Ansible to update on various servers when needed and thought I’d share it.
This is intended for sys admins using Ubuntu.
The main aliases are :
ll – I use this ALL the time, it’s `ls -aslch` and shows the file listing.
agu – Apt get update, just refreshes the apt files from the net, doesn’t actually install anything but should be run before running any apt programs.
agg – Apt Get Upgrade this updates all the programs that need upgrading. Usually the server needs to be restarted after.
acs – Apt Cache Search. If there’s something to install like the PHP gearman extension I’ll usually use `acs php | grep gearman` to work out the name.
a2r – Apache2 reload.
a2rr – Apache2 restart, for when just reloading the config isn’t enough.
aliasd – Open up the local aliases file. Will apply the changes when you exit nano.
aliasd_base – Open up the main (base) aliases file which contains these aliases. If not using Ansible then I normally load the aliases into a new server by pasting the contents of the file in on the command line, then running aliasd_base and pasting it in again into the file.
chownWWW – Change the file and folder contents to being owned by www-data:www-data DO NOT RUN THIS IN THE ROOT DIRECTORY.
du – Directory usage. A general listing of file and directory sizes.
das – A directory size listing ordered by largest at the top. It’s not amazing but works well enough. I use `ncdu` the program (usually has to be installed with `agi ncdu`) to get better directory listing.
directoryExec – Makes the directories executable by the user and group.
logs – Shows most of the /var/log files, tails them so you can see any changes.
logsudo – Same as logs, but with sudo so you see more of the files.
gac – Git add and git commit. A nice quick way of doing a git commit. I usually do `gac -m “* Commit message here”
gitt – Shows the last 24hrs worth of git commits. Great for putting into a timesheet.
gittt – Shows how long ago the commits were, I mainly use this when trying to work out which commits are from today vs yesterday.
ssh-config – Edit the main ssh config file.
diglookup – Does a quick check of the A records, MX, TXT and other stuff for a domain, useful when someone says that there’s an issue with the site. example usage `diglookup`
Note that the attempt to do a reverse lookup on the IP usually fails if there’s multiple A records for the main site, so you sometimes have to [ctrl] + [c] cancel out of that bit at the end. I’ll fix it one day :P
$ diglookup
=== ===
Wed Jan 18 11:36:58 ACDT 2017
--- dig
--- dig
--- dig mx
--- dig txt
--- dig
--- whois
Whois Server Version 2.0
Domain names in the .com and .net domains can now be registered
with many different competing registrars. Go to
for detailed information.
Sponsoring Registrar IANA ID: 677
Whois Server:
Referral URL:
Status: clientDeleteProhibited
Status: clientTransferProhibited
Status: clientUpdateProhibited
Updated Date: 29-oct-2014
Creation Date: 06-jul-2007
Expiration Date: 06-jul-2017
>>> Last update of whois database: Wed, 18 Jan 2017 01:06:49 GMT <<<
For more information on Whois status codes, please visit
--- Web server's reverse IP 'nslookup'
Non-authoritative answer: name =
Authoritative answers can be found from:
I then have a ~/.bash_aliases_local file that has server specific changes. e.g kublermdk-logs which will show the logs specific for my site, esp if it’s something like a Symfony project where a lot of the useful log files are stored in something specific. I’d have
alias kublermdk-logs='tail -f /var/logs/apache2/kublermdk/*.log /var/www/kublermdk/www/app/logs/*.log'
Grab what you want, let me know if you’ve got any good aliases yourself.

Leave a Comment