I just don't use aliases. It's only in the last month or two, following some of the threads on this forum, that I've even bothered playing with them and, TBH, I just don't see the point. I think it would be bad practice to use an alias (or a script) with the name of a standard command to do some non-standard action or use some non-standard option.
Having said that, my OS, by default, sets up three aliases for "safeties" that do just that:
Code:
alias cp='cp -i'
alias mv='mv -i'
alias rm='rm -i'
which for many users is a life saver. Personally, I -hate- such things as I'm not in the habit of typing "rm my-important-file" unless I want to , y'know, remove said file. I'll let you know if I'm not sure! And yet I haven't (for over a decade) gone so far as remove the aliases. Go figure.
For script placement, I make some premeditated violations of the FHS. I have four places to keep scripts (and a few private binaries):
- /boot/bin64 for programs specific to the x86_64 architecture
- /boot/bin32 for programs specific to the x86 architecture
- /boot/bin for programs not specific to either architecture
- ${HOME}/bin for programs specific to the current installation (I have a bunch of completely distinct installations on any given machine even though I typically only use one or two of them)
FWIW, less than 1% of my scripts are one liners ("two liners" if you count the shebang). Several are full blown applications with built in help, argument processing, logging, etc, that run to hundreds of lines.
---
As food for thought, especially for those new to linux: One of the beauties of linux is that it is so "cutomizable". You can pick and choose your desktop environment, your file manager, your browser, etc, etc, etc.
But don't "customize" commands just to save a few keystrokes or to avoid having to remember command options even though aliases and scripts allow you to do just that. By all means, use scripts or aliases to bundle up commonly used combinations of commands. But don't give them the same names as existing commands (like the three I was grousing about above) - that will likely lead to confusion. Instead, dig in and learn to use the standard tools/utilities/commands. You'll be glad you did. After you've gained some (a lot of) experience and are no longer a noob (though you may always think of your self as a noob - I still do), go ahead and twek a few commands with aliases or whatever, if you still think it's a good idea... but chances are you won't need/want to.