.bashrc.d/10aliases: Add a 'cdcwd' alias
authorW. Trevor King <wking@tremily.us>
Fri, 24 Apr 2015 03:40:43 +0000 (20:40 -0700)
committerW. Trevor King <wking@tremily.us>
Fri, 24 Apr 2015 03:43:40 +0000 (20:43 -0700)
For expanding symlinks in the current working directory.  'realpath'
isn't in POSIX [1], but it is in GNU Coreutils [2].

[1]: http://pubs.opengroup.org/stage7tc1/idx/utilities.html
[2]: https://www.gnu.org/software/coreutils/manual/html_node/realpath-invocation.html

src/.bashrc.d/10aliases

index 69614bc78c9518b16aeed32041e3ab1361e1d16a..cd7f969b96d7d082d1fad52d4be2dd0021c45bb1 100644 (file)
@@ -24,6 +24,7 @@ alias w3mg='w3m http://www.google.com/'
 alias oggr='ogg123 -qb 500' # play ogg radio streams (quiet, big input buffer)
 
 # Alias useful one-liners & common commands
+alias cdcwd='cd $(realpath "${PWD}")'
 alias findex='find . -perm -u+x ! -type d'
 alias git-blame-author='git blame sudoku.c | sed "s/^[^(]*//" | sed "s/ [0-9]\{4\}-[^)]*//" | less'
 alias sortdat='find . -printf "%TY-%Tm-%Td+%TH:%TM:%TS %h/%f\n" | sort -n'