alias yourCommand="YourTerminalCommand"
example:
alias la="ls -la"
Aliases shorten the amount of keystrokes necessary to throw commands.
I put my aliases in a file called ~/.aliases and then insert "source ~/.aliases" in my bash ~/.profile. That way it's easy to grab a copy of .aliases in case I'm doing command-line stuff on someone else's computer and don't want to mess with their .profile.
I would advise that you only alias commands, that don't change your system or delete files. So don't alias "sudo" or "apt-get". When you're actually installing software, you want to do it deliberately, and you don't want the chance that a typo will actually do something that changes your system with elevated permissions.
No comments:
Post a Comment