I’ve often been tempted with the idea of using an alias to modify the default behavior of a command line tool. For example, I often want to resolve the actual path after following a symlink (and have never wanted to maintain the symlink path), so I was thinking about adding something to my .bash_profile file, to make this the default behavior, e.g.:
alias cd="cd -P"
Is this bad or dangerous for any reason? If not for this example, is it a bad idea in general? It makes me feel a little dirty…
It’s a very common technique. Here are some common examples.
If later you want to run without the alias you can \ the first letter or put the command in quotes, as in