-1

I had/have Raspbian and used the LXDE desktop environment. Many posts will commands to enter in and not use the GUI. I took a quickie online video crash course on using linux and being an admin. They covered something about aliasing commands in general, which I think is really helpful. Like aliasing the ls -l command as ll or ls -a command as la. For using the raspberry pi and the commands line, I know many of these may depend on what you are intending to do with the Pi. But what are some good commands to alias that probably could be used for all projects?
(ie - "sudo apt-get update && sudo apt-get upgrade" being aliased as "upgrade" or something like that). I am not worried or concerned about what the aliased phrase will be as everyone will have a preference I am sure. But based on some common commands, what should be aliased?

3
  • 2
    My recommendation to someone who is new to Linux & Linux admin: don't use aliases for your commands until you've issued each of them at least 1,000 times. It takes time to really know what you are doing, and with Linux command line, a mistake is easily made. Plus, knowing the commands and not your alias names allows you to work on other Linux systems (not your own) that don't have those aliases. Of course, if you need to do something repeatedly for work purposes, for a longer time, by all means summarize the common commands.
    – Phil B.
    Nov 28, 2016 at 14:50
  • Besides a search of the web for common aliases, you may want to increase the size of your history file and then periodically search through it for common commands. This blog post from our blog may help raspberrypise.tumblr.com/post/142215518744/…. I would not go overboard with the aliases as they are only as useful as your memory. Starting with 10 common ones is usually good, once you have those memorized and committed to muscle memory you can slowly add new ones. Nov 28, 2016 at 14:54
  • As Nathan Smith says, this is going to vary from person to person. Although there are some that specific distros commonly include by default (such as aliasing rm with rm -i for safety, or grep with grep --color, since it might as well be so on any modern terminal), it would be better to think of there being nothing which should be universally aliased. Command interfaces aren't arbitrary; the fact that it may only take you 30 seconds glancing at a man page doesn't mean that's how long the design took to think up. Of course, there may be many specific things specific people want to do
    – goldilocks
    Nov 28, 2016 at 15:08

1 Answer 1

4

As I don't think this exactly answers your question, I'd prefer to post this as a comment but I don't yet have the reputation to do so, my apologies.

Although this would be a great convenience, I feel like I should also warn you of potentially limiting your experience. Sure, aliasing the update/upgrade command to simply upgrade would make your work on this machine much simpler, but beware of falling into habit of this and not having your skill transfer over to other Debian like systems. Say in the future you get an admin position running a ubuntu server and you no longer have access to your aliases.

That being said, I think your list of commands isn't something you can really have a "once size fits all" thing, so much as keep a list for yourself of things you often use. I personally would use

  • update for sudo apt-get update && sudo apt-get upgrade && sudo apt-get autoremove
  • serverconnect for quickly SFTPing into my remote server
  • I also run some server type applications, so perhaps a startservers to (re)boot apache, your VoIP server, your file server, etc. all with one command

Not the answer you're looking for? Browse other questions tagged or ask your own question.