Question:
Command Line Interface?
?
2013-08-27 07:55:41 UTC
Why command line interface in use still , even though graphical user interface is there
Three answers:
Robert J
2013-08-27 08:07:28 UTC
Many systems simply do not need graphics.



A GUI takes a lot of memory and CPU power to run, which could often be better used by whatever the machine is built for (eg. with servers).





Most often, it's convenience. Most server machines are 'headless' setups that do not have keyboards and monitors connected once installed.



They are administered using an SSH terminal (eg. Putty). Anything and everything that could be done using a remote GUI can be done easily via command line.



You can also control or monitor any number of machines from your own desk or laptop with instant response. Remote graphics setups like VNC can be painfully slow by comparison due to the volume of data they need to transfer to do screen updates.





Another thing with GUI tools is that sometimes it's not clear what config files they change and how. Making changes explicitly with a text editor allows you to ensure the setup is exactly how you want it.



[Electronics designer & programmer for 30+ years, also commercial system builder & own a small ISP.]
Unca Alby
2013-08-27 08:13:23 UTC
Many programs are for use other than interfacing with the user.



For example, you may need an independent program to be kicked off to do a bunch of calculations for you, and all you need is the end result. You don't need pretty boxes or buttons or bells and whistles. Just kick off the program and let it do its thing. Then when it's finished, maybe then you can have a GUI program take over and display the results. Depending on the situation, you may not care about the results, so even there you don't have a GUI program. But perhaps the rest of your application needs those results to operate, or to print reports, etc. etc.



There are thousands of examples. Your Mail Service that runs on your machine is command line. It never talks to a human, it just receives and delivers email. What does it need with GUI? The Web Service, same thing. A lot of the security programs are command line based, where they run in the background to verify that attempted access has the correct credentials. Etc. etc.



Very often you need to "filter" the output of a program, or "filter" the input before it gets to a program, or both at the same time. Commands like "grep", "sed", "awk", etc. are all command-line filters. For example, you could use "sed" to change every instance of the word "Ford" to the words "Henry Ford". Attempts to "GUI-fy" these tools have not been very successful.



Further, experts often prefer the command line tools. Someone will attempt to "GUI-fy" a tool so that noobs can use it, but then the GUI version will only work in the simplest cases. That's great for the noob, but the expert soon finds himself needing to go back to the more powerful command line version. And once you start using the powerful version for power uses, you soon find yourself using it for the simple cases also.



GUI is nice and all, but the command line isn't going away any time soon.
anonymous
2013-08-27 14:10:06 UTC
5 Reasons to Use CLI Over GUI :-



1. Complete control over the system. This may vary. What I'm trying to say is that I got used to do some task using some CLI tools instead of a graphical application. Now using that application makes me wonder whether it will pass exactly the arguments I wanted to the command line tool or use some defaults which I don't want. Not once I saw a graphical application based on some CLI tool which only implemented half of its options, so I wasn't able to make it what I actually wanted.



2. Powerful for many tasks. CLI is often more powerful than GUI applications for specific tasks. For example, consider having a directory with hundreds of different file types in it. Moving, copying, eventually renaming them would be very hard in a GUI file browser. Selecting almost each of them with the mouse while pressing CTRL is not easy for such a big number of files and it also takes up more time. While on CLI, you can use one single command in order to perform whatever task and it's done.



3. Ability to use scripts. I have several small scripts in my ~/bin/ directory, which in Debian is detected and included by default in the $PATH. So I can run specific commands over some files in just one command and a parameter. This is very useful if you have some specific need or want a specific behaviour with some tool, which is not implemented in any graphical application.



4. Less memory. For whom it matters, using command line won't make the system load additional libraries which are not already loaded for some GUI application.



5. Ability to use aliases. Aliases are a great feature implemented by shell applications which allow a user to perform one or more commands using one simple, easy to write command, called an alias. The ability to use those often makes work easier.


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...