LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Why use command line (https://www.linuxquestions.org/questions/linux-newbie-8/why-use-command-line-937125/)

svenxix 03-29-2012 01:23 PM

Why use command line
 
My friend is just learning linux and is still struggling to understand why you would want to use a command line interface instead of a GUI (He didn't seem to like vi very much).

My main argument was that in a server environment a gui is unnecessary.

But, I'm sure there's plenty of people here that have some strong arguments in favor of a command line interface. Do you have anything I can tell my friend?

EricTRA 03-29-2012 01:26 PM

Hi,

One of the greatest advantages that pops to mind is that when you launch an application from within the GUI menu and it errors out it might hide error information from you. If you launch that same application from the command line, not putting it in the background and not redirecting anything you can see a lot more information on what's going on. That's just one, I'm sure other users will provide you with a lot more arguments.

Kind regards,

Eric

pingu 03-29-2012 01:39 PM

First of all, you don't have to like 'vi' just because you use the terminal.
Personally I love the terminal & I hate vi - probably because I never learned it!

What's good with terminal:
You do things fast & accurately, from one single place you have everything at your fingertip!
Issuing a command is so much faster than pointing & klicking through a GUI. Also you have a command-history to show what was previously done, seldom present with GUI:s.
- But of course, you must have knowledge, if you know "nothing" you need to "have a look" so to speak.
Think of a computer as a restaurant:
When you go to a restaurant, do you need a pretty menu?
- Yes, if you're seldom there and don't know what they've got.
- No, if you're often there and already know what's on the menu.

Also, consider this:
If you need to guide someone, let's say "how do I move my jpeg-files from one directory to other directory?"
* GUI-explanation:
Open konqueror ("explorer"), click yourself through the directories until you reach the target, right-click, select "*.jpg", right-klick, select "cut", move to destination, right-click, select "move here" (taken from memory this, please don't hang me!)
* Terminal:
# mv target-directory/*.jpg destination-directory/
Seems a bit easier, doesn't it?

pingu 03-29-2012 01:45 PM

And I would like to add:
When I use my computer for work or leisure I almost always use GUI:s. (After all, games like Civilization are pretty useless without GUI if you ask me, creating good looking broschures is easier with GUI-apps as you can then see what the broschure actually will look like, etc).
But when I need to configure system, when I administrate servers, or when a GUI-app doesn't work ( like EricTRA hinted ) then I use terminal. Quick -fast - informal. NOT beautiful (who cares, I am! :D

pingu 03-29-2012 01:48 PM

Oh yes, one more thing:
You can do a lot more with terminal than with GUI!
Just check out "man mplayer" - it gives you (very roughly) 2000 cli-options.
Try to put that in a GUI...

snowday 03-29-2012 01:50 PM

Command line is preferred on the forums because some of us are using Ubuntu with Unity, some of us are using Slackware with KDE, some of us are using CrunchBang with Openbox, and so forth.

Command line is the "lingua franca" for us all to communicate and help each other. :)

But you can tell your friend that in his everyday activities (web surfing, word processing, games, etc.) he probably never needs to use the CLI, and that's OK.

273 03-29-2012 01:53 PM

It seems that Microsoft have decided that the terminal is the way to go too, since their newest server offerings are geared towards the command line for configuration.

dougt 03-29-2012 01:57 PM

GUIs certainly have a place - on a single user system that needs a simple control system or where graphics are needed - as you say games, publishing etc would all be pretty tough without a GUI. Lots of people prefer GUIs as they are far more intuitive to use and provide a visual metaphor for working with files, applications and so on.

In saying that, command line certainly has a place too. I work for a very large bank and my little team (one of the smallest in the bank) manages around 1000 servers - mostly Red Hat and some legacy Solaris, and we are just a tiny percentage of the overall bank. There's just no way we'd want to try to manage that many server with GUIs. By using command line tools such as ssh, shell scripts, perl, and so on, we can successfully keep a handle on our estate, monitor for problems and perform maintenance and upgrades in a far more effective way.

Ultimately it comes down to a mixture of personal preference and need. There's no "better" choice here, what suits me in one scenario might not suit you in another.

PrinceCruise 03-29-2012 02:06 PM

Using command line is a 'part' of 'learning' GNU/Linux,BSD,UNIX.
Your friend can ignore it but can't escape it. Just my 2 cents.

Regards.

SharpyWarpy 03-29-2012 04:46 PM

When things go wrong I instinctively go to the command line. To me it is the way things get done. Of course the GUI is necessary for a lot of things but panic takes me to CLI every time. And there is a certain satisfaction knowing I can rip and burn a DVD without a GUI program. A lot of GUI programs are just frontends for using several command line programs at once without typing anything out. As EricTRA said an important advantage of the command line is if errors occur you can see immediately and that makes it a lot easier to know how to fix whatever is causing the error. Also if the GUI relies on a certain program to perform a certain task doing whatever it is doing and that program misbehaves you're out of luck, but with the command line you can usually find another program or a workaround to get that done.

anomie 03-29-2012 05:31 PM

Reasons to use the command line:
  • Command-line utilities generally expose more options in a more succinct way.
  • Automating tasks usually requires interaction with command-line interfaces.
  • Data processing is often a series of operations on textual data (not pretty images).
  • Remote administration can be performed without forwarding (larger) graphical displays across a network.

Tinkster 03-29-2012 05:57 PM

Or even simple things like a major change in ones network infrastructure. Imagine
changing IPs for 200+ clients in DNS & DHCP reservations via GUI.

Let's give you (and your OS) the benefit of the doubt and say you can do one change
in 20 seconds using the GUI.

You'd be busy for the best part of 2-3 hours.

In the CLI (assuming you use bind9 & ISC dhcpd) it would take me about 2 minutes
of contemplation, two sed commands typed up in ~ 30 seconds, and a service restart.
Saved 1:57h ... that's why CLI rocks your socks ;}

chrism01 03-29-2012 06:05 PM

I'd love to add something new to this, but all of the above pretty much covers it :)

Certainly its traditional on serious servers (not just *nix) not to have a GUI installed, and of course in the earliest days there was no GUI, much like MSDOS before MSWin.

A rough guide is:
For a home desktop - GUI; for a serious (commercial) server - CLI; for a personal server - your choice.

For all of the reasons stated above
Enjoy :)

TKH 03-29-2012 10:07 PM

For a server, you need a lot of memory. GUI is wasting your memory.

mreff555 04-14-2012 10:27 PM

1. The command line is faster.
I cringe every time I have to use windows at work. Aside from being slow as hell, it's just a pain navigating the menus. Theres nothing more frustrating than hunting through menus when you know exactly what you are looking for, you just cant find it.
It's much easier to just type the name of the file and be done with it.

2. The command line is quite complete.
I don't like having programs on my machine I don't need. Understanding how to use command line programs can eliminate a lot of unneeded software. For example the 52k program dd can take the place of gigs of software if you know how to use it.

3. The command line is extremely powerful.
There are so many things that you can do in one command line that people pay small fortunes in gui software to do.


All times are GMT -5. The time now is 03:36 PM.