Pinterest Stumbleupon Whatsapp
Ads by Google

linux command lineConventional wisdom states that graphical user interfaces (GUIs) are easy and the command line is hard.

Conventional wisdom isn’t always right.

There are a lot of things easier to do with a command line then with a graphical user interface. That’s not to say doing things with a command line is intuitive – no, you will need to learn how to use the tools – but it is easier – that is to say, quick and simple to remember. A powerful, easy-to-use command line is a huge part of what makes Linux so powerful.


Don’t believe me? Check out the list below for things I feel are easier with a Linux command line than with a GUI. I highlighted 7 things easier to do in Ubuntu than Windows 7 Things That Are Easier To Do In Ubuntu Than In Windows 7 Things That Are Easier To Do In Ubuntu Than In Windows Read More ; consider this article an extension of that one as we explore the power of the Linux command line.

Quickly Check Memory Usage

Sure, you could find out what program is using up your memory using the Gnome System Monitor by clicking “System,” then “Administration,” then “System Monitor,” then clicking the “Processes” tab, then clicking the “Memory” column. You could, but that process took 17 words to explain.

If you’ve got a command line open all you need to do is type “top” and you’ve got the same list.

Ads by Google

linux command line

Kill Any Program

If a certain program is acting up and causing you trouble you can always kill it from the Linux command line. Just type “killall” followed by the name of the program you’re trying to kill.

For example, if Firefox is acting up (as Firefox will do from time to time) simply type “killall firefox” and it should kill the application completely.

linux command line

In the rare circumstances that this doesn’t work you can always type “xkill” and then click on the window that won’t close; this will completely close a given window immediately.

Every time I fix a Windows computer I end up wishing I could make use of xkill at least once.

Install A Program (Or Several)

When it comes to installing software you simply can’t beat the command line. How to do this varies from system to system, so I’ll just focus on Ubuntu here for the sake of simplicity, but know that the same concepts can be applied for any distro. Check your distro’s documentation for more information.

Ubuntu/Debian types realize the wonders of apt-get. This command line program makes installing programs a snap; for example, installing the SNES emulator ZSNES is as easy as typing “sudo apt-get install zsnes“.

What does all that mean? Well, “sudo” just means you’re typing the command as an administrator. “Apt-get” is the name of the program you can use to install and remove software. The word “install” is telling “apt-get” what to do, and the word “zsnes” is the name of the package  needed to install zsnes.

linux command line programming

You can use this same command to install several programs at once. Let’s say you wanted to install Dosbox, ZSNES and mednafen all at once (you retro-gaming addict you.) Type “sudo apt-get install dosbox zsnes mednafen” and you’re good to go.

Update Your Software

When the “Update Your Software” window pops up in Ubuntu I hardly ever use it. Instead, I open up a command line and type “sudo apt-get upgrade” and install everything that way. I find this is a great deal easier than clicking the “Update” button on the window, waiting for the prompt, typing your password and then dealing with the windows popping up and bugging me.

Instead, I type “sudo apt-get upgrade” and have all my updates install in a single window. This leaves me alone and allows me to get back to my work.

Add A PPA [Ubuntu]

Personal Package Archives (PPAs) are a great way for Ubuntu users to keep a particular piece of software on the bleeding edge; read more about them here. Since the release of Ubuntu 9.10 adding a PPA is as simple as typing a single command.

For example. let’s say you wanted the bleeding-edge version of Gwibber (the social networking program that allows Ubuntu to unite all your inboxes). To add the PPA that makes this possible you need only type “sudo add-apt-repository ppa:gwibber-daily/ppa“.

linux command line programming

This simple command can be used for any PPA; you’ll find the particular command on a given PPA’s home page.

Conclusion

There you have it: just a few things that are easier to do from the command line than they are from a GUI. This is of course a little subjective, but I think if you learn to do these things from the command line you’ll never really want to go back to the GUI way of doing them.

There are more such things, of course, and I’m counting on you smart Linux types to point them out in the comments below. I’m also expecting ignorant comments about how the existence of the  command line is proof that Linux is inferior to Windows (preferably in all-caps).

  1. jeffatrackaid
    June 17, 2010 at 4:33 pm

    I use grep, awk, sed, sort and uniq very often to manipulate data. My Excel skills are limited, so when I need to re-format some data into new columns or switch some formatting, I find the command line to be great. You can very quickly split fields, change delimiters and do some text manipulation very quickly. Bash loops are a boon as well.

  2. Narnold
    June 16, 2010 at 7:27 pm

    It seems to me that by "reading between the lines" that what might be very helpful is a semi-comprehensive article written for moderately-tech-savvy (or better) Windows users transitioning to Linux - I include myself in this group. My idea of a good outline for such an article is to sort of explore a Windows installation and show the potential new Linux user where/how to do in Linux what (s)he is accustomed to doing in Windows. Examples: where is the equivalent of the Device Manager? How does one install programs - particularly programs that are NOT included in the Ubuntu Software Center or Synaptic Package manager? Words like "tarball," for instance, sound pretty messy and scary. How about file extensions and what they mean? My own impression is that Ubuntu 10.04 is great, and the more I use it the more I think I'm keeping it. But it does require a psychological leap, and an article on transitioning would be wonderful.
    I realize this isn't quite central to the topic, but this seemed a good a place as any to mention this.

  3. Narnold
    June 16, 2010 at 5:27 pm

    It seems to me that by "reading between the lines" that what might be very helpful is a semi-comprehensive article written for moderately-tech-savvy (or better) Windows users transitioning to Linux - I include myself in this group. My idea of a good outline for such an article is to sort of explore a Windows installation and show the potential new Linux user where/how to do in Linux what (s)he is accustomed to doing in Windows. Examples: where is the equivalent of the Device Manager? How does one install programs - particularly programs that are NOT included in the Ubuntu Software Center or Synaptic Package manager? Words like "tarball," for instance, sound pretty messy and scary. How about file extensions and what they mean? My own impression is that Ubuntu 10.04 is great, and the more I use it the more I think I'm keeping it. But it does require a psychological leap, and an article on transitioning would be wonderful.
    I realize this isn't quite central to the topic, but this seemed a good a place as any to mention this.

  4. necropsychronautron
    May 21, 2010 at 4:05 pm

    For many it seems as much of a movement as it is a product. It is easily observed that many even refer to linux as if it were more of a philosophy.
    Naturally this makes the goal equally as much to illuminate others on the positives of this philosophy as well as "selling" a (free)product to "customers".

    Personally I started using Ubuntu because I saw how much easier it made certains aspects of development work easier to learn (that and the visual customization, automation, GUI responsiveness) and am enjoying the challenge of learning to use the Terminal more.
    I'm still running a single core on a socket 939 mobo, and it installed all drivers (even the proprietary Nvidia ones) automatically and even my old ass soundblaster surround sound card works.
    I dunno, I used to say I don't think linux (ubuntu seeming to be most newb friendly) was quite ready for "the big time" but honestly, this current run with 10.04 seems to be giving me everything I could want from both the GUI and the command line. Also with Steam coming to linux, I think it pretty much seals it, cause gamers are suckers for slick looking easy to customize GUI's.
    Sure, not all enjoy such a challenge, but there is less of a challenge now, and there are still many that do Some would even pay for it (but don't have to).

  5. necropsychronautron
    May 21, 2010 at 3:48 pm

    Okay, so it does not work for some. How is that absurd? It goes both ways...
    The author is making a point (somewhat ineffectively, but still valid) that these tasks take *fewer actions* to complete, . What would take repetitive clicking, dragging, and navigating in a GUI can be done by typing a line or two.
    Comment #4 from LinuxTutBlog explains this point a bit more effectively.
    Of course, just like in linux (if you know the syntax) in windows you can do many things equally or more efficient(if you know the right app, and where to get it(ex. Process Explorer, MP3 Tag Tools, etc).

    I'm completely used to GUI's, I've used windows exclusively until just recently. Even with my as of yet rudimentary interaction with the terminal, I'm still pretty impressed by the scope and ease of certain things Sure, it doesn't work for everyone, but for many, it does. Personally, I've come to think of terminal as a piece of software thats "one size fits all". With guis, you can only pack so much in before you have too many tabs, too many checkboxes, etc, so having a program that you could just tack on whatever function you wanted would be a bit unwieldy.
    Command line may have a steeper learning curve, and be downright unusable for some, but it's value in being capable of doing almost anything, is I think, indisputable.
    Some things are easier in linux, but the claim is not exclusive.
    The whole idea of even attempting to argue one approach as being better than the other, is really like trying to argue that a wrench is better than a screwdriver.
    I don't think it was the authors intent to argue that this works for anyone/everyone.

  6. linuxcanuck
    May 12, 2010 at 3:09 pm

    This is absurd! What works for one person may not work for another. If you can remember the command. If you know the syntax. If you like typing If you don't make typos .... then it MAY be easier. If you have to look it up. If you hate typing, then it is MORE work.

    An example:

    You say that opening a terminal and typing sudo killall firefox then giving your password is easier than opening system monitor and reading Firefox from the process list and hitting the kill button or pressing Alt+F2 and typing xkill then clicking on the offending window. I don't think so. In both cases you don't have to give a password for the GUI to work.

    As for sudo apt-get install, it is only faster if you know the name of the application and that isn't always easy to determine. For example epiphany is both a browser and a game. Or what do you type to install compiz settings manager or some library or font. If you are installing many things then it easier to choose them from a list and not risk making typos and having to guess the application names.

    This is so subjective as to make it a lame argument. Your title is misleading and you fail to make your point. It is NOT easier to do these things in the command line. It is only easier for YOU because you THINK that it is easier. For people who hate typing, are ageing or are intimidated by getting syntax errors then it is NOT easier, but an exercise in frustration.

    Many people just want to get things done and are not interested in nuts and bolts solutions. We need to remember that when we give advice and learn to provide advice that will work for the user not because of our hidden agenda to educate them about the commandline, but because it will get them up and running.

  7. linuxcanuck
    May 12, 2010 at 1:09 pm

    This is absurd! What works for one person may not work for another. If you can remember the command. If you know the syntax. If you like typing If you don't make typos .... then it MAY be easier. If you have to look it up. If you hate typing, then it is MORE work.

    An example:

    You say that opening a terminal and typing sudo killall firefox then giving your password is easier than opening system monitor and reading Firefox from the process list and hitting the kill button or pressing Alt+F2 and typing xkill then clicking on the offending window. I don't think so. In both cases you don't have to give a password for the GUI to work.

    As for sudo apt-get install, it is only faster if you know the name of the application and that isn't always easy to determine. For example epiphany is both a browser and a game. Or what do you type to install compiz settings manager or some library or font. If you are installing many things then it easier to choose them from a list and not risk making typos and having to guess the application names.

    This is so subjective as to make it a lame argument. Your title is misleading and you fail to make your point. It is NOT easier to do these things in the command line. It is only easier for YOU because you THINK that it is easier. For people who hate typing, are ageing or are intimidated by getting syntax errors then it is NOT easier, but an exercise in frustration.

    Many people just want to get things done and are not interested in nuts and bolts solutions. We need to remember that when we give advice and learn to provide advice that will work for the user not because of our hidden agenda to educate them about the commandline, but because it will get them up and running.

    • Cookie
      May 21, 2010 at 12:16 am

      you mentioned bad syntax couple of times. you are aware of the fact that you can press TAB to finish the command?

    • Anonymous
      May 21, 2010 at 1:48 pm

      Okay, so it does not work for some. How is that absurd? It goes both ways...The author is making a point (somewhat ineffectively, but still valid) that these tasks take *fewer actions* to complete, . What would take repetitive clicking, dragging, and navigating in a GUI can be done by typing a line or two.
      Comment #4 from LinuxTutBlog explains this point a bit more effectively. Of course, just like in linux (if you know the syntax) in windows you can do many things equally or more efficient(if you know the right app, and where to get it(ex. Process Explorer, MP3 Tag Tools, etc).I'm completely used to GUI's, I've used windows exclusively until just recently. Even with my as of yet rudimentary interaction with the terminal, I'm still pretty impressed by the scope and ease of certain things Sure, it doesn't work for everyone, but for many, it does. Personally, I've come to think of terminal as a piece of software thats "one size fits all". With guis, you can only pack so much in before you have too many tabs, too many checkboxes, etc, so having a program that you could just tack on whatever function you wanted would be a bit unwieldy.Command line may have a steeper learning curve, and be downright unusable for some, but it's value in being capable of doing almost anything, is I think, indisputable. Some things are easier in linux, but the claim is not exclusive.The whole idea of even attempting to argue one approach as being better than the other, is really like trying to argue that a wrench is better than a screwdriver.I don't think it was the authors intent to argue that this works for anyone/everyone.

  8. Argh
    May 11, 2010 at 12:16 am

    I have got recently to the conclusion that there are only 3 things that prevent Linux from attaining world domination :) :). One is the devotion to Terminal, one is the lack of driver support for old crappy hardware and one is the lack/inconsistency of support for base-level users.

    Now you may love the Terminal, but it is a bad policy that Linux developers (Ubuntu and Mint included) cannot get over it and need to remind us that the GUI is but a relatively shallow veil on the beauty of the command line. You cannot be right for too long in front of your customers. If there is a compulsion in the community to preach command line to noobs, then the noobs will feel they are *not* treated like customers and they will not buy. Yeah, it's free, but they will not buy it still.

    Regarding drivers for old hardware i realize it may be just too much work, but in my book software that asks me to upgrade my parents' computer does not bring freedom.

    Finally, I believe I need not insist on user support, right.

    So when I will know Linux is ready for SOHO market when I see the distribution that features an aggressively self-sufficient GUI and a huge contextual help. I am not saying that would be a great distribution, but you need to do it as if it were a "concept car".

    BTW, this was meant as a friendly critique, not sure if it is obvious.

  9. Argh
    May 10, 2010 at 10:16 pm

    I have got recently to the conclusion that there are only 3 things that prevent Linux from attaining world domination :) :). One is the devotion to Terminal, one is the lack of driver support for old crappy hardware and one is the lack/inconsistency of support for base-level users.

    Now you may love the Terminal, but it is a bad policy that Linux developers (Ubuntu and Mint included) cannot get over it and need to remind us that the GUI is but a relatively shallow veil on the beauty of the command line. You cannot be right for too long in front of your customers. If there is a compulsion in the community to preach command line to noobs, then the noobs will feel they are *not* treated like customers and they will not buy. Yeah, it's free, but they will not buy it still.

    Regarding drivers for old hardware i realize it may be just too much work, but in my book software that asks me to upgrade my parents' computer does not bring freedom.

    Finally, I believe I need not insist on user support, right.

    So when I will know Linux is ready for SOHO market when I see the distribution that features an aggressively self-sufficient GUI and a huge contextual help. I am not saying that would be a great distribution, but you need to do it as if it were a "concept car".

    BTW, this was meant as a friendly critique, not sure if it is obvious.

    • Aibek
      May 11, 2010 at 5:28 am

      thanks for the input!

    • Anonymous
      May 21, 2010 at 2:05 pm

      For many it seems as much of a movement as it is a product. It is easily observed that many even refer to linux as if it were more of a philosophy.
      Naturally this makes the goal equally as much to illuminate others on the positives of this philosophy as well as "selling" a (free)product to "customers".

      Personally I started using Ubuntu because I saw how much easier it made certains aspects of development work easier to learn (that and the visual customization, automation, GUI responsiveness) and am enjoying the challenge of learning to use the Terminal more.
      I'm still running a single core on a socket 939 mobo, and it installed all drivers (even the proprietary Nvidia ones) automatically and even my old ass soundblaster surround sound card works.
      I dunno, I used to say I don't think linux (ubuntu seeming to be most newb friendly) was quite ready for "the big time" but honestly, this current run with 10.04 seems to be giving me everything I could want from both the GUI and the command line. Also with Steam coming to linux, I think it pretty much seals it, cause gamers are suckers for slick looking easy to customize GUI's.
      Sure, not all enjoy such a challenge, but there is less of a challenge now, and there are still many that do Some would even pay for it (but don't have to).

  10. Rod
    May 10, 2010 at 11:27 am

    pskill (command line tool) which is part of the pstools suite from Sysinternals/Microsoft works nicely for killing applications on Windows. I have pstools on my machine and have the folder added to my path so I can run it easily. It works nicely for killing processes on remote machines too.

  11. LinuxTutBlog
    May 9, 2010 at 7:08 pm

    Nice article idea =), but I think you're missing the greater powers of the command line (though you say you are counting on that somehow). How about:
    - Resizing 1000 pictures with a certain name pattern
    - Recursively remove all files with a certain extension
    - Processing the output of a program to get new information from it (e.g. finding the top 10 space-consuming packages when a package manager doesn't offer such a view, comparing the running processes on different servers etc.)
    - Spending less time on relearning and more on working (the command line changes less over time)
    - Doing something again you did recently (Bash's Ctrl + r beats every 'recently opened files' menu I've ever seen)
    - Automating and/or scheduling your actions (most commands can be generalized)

  12. LinuxTutBlog
    May 9, 2010 at 5:08 pm

    Nice article idea =), but I think you're missing the greater powers of the command line (though you say you are counting on that somehow). How about:
    - Resizing 1000 pictures with a certain name pattern
    - Recursively remove all files with a certain extension
    - Processing the output of a program to get new information from it (e.g. finding the top 10 space-consuming packages when a package manager doesn't offer such a view, comparing the running processes on different servers etc.)
    - Spending less time on relearning and more on working (the command line changes less over time)
    - Doing something again you did recently (Bash's Ctrl + r beats every 'recently opened files' menu I've ever seen)
    - Automating and/or scheduling your actions (most commands can be generalized)

  13. Anonymous
    May 9, 2010 at 1:47 pm

    htop is nice but why not htop ? sudo apt-get install htop

    • Flandal
      May 14, 2010 at 10:28 pm

      yes, I use htop too....but olny because is pretty...

  14. maka
    May 9, 2010 at 2:57 pm

    When using Process Explorer under Windows you've got a "xkill"-like tool. Just drag the crosshair on the window of the program you want to kill.

  15. maka
    May 9, 2010 at 12:57 pm

    When using Process Explorer under Windows you've got a "xkill"-like tool. Just drag the crosshair on the window of the program you want to kill.

Leave a Reply

Your email address will not be published. Required fields are marked *