Question:
Using the Terminal vs GUI in Ubuntu...why bother in these cases?
Some Person
2011-09-27 16:34:54 UTC
OK, I'm trying to get in the mind set of why people choose to CLI everything they do. For example, if I can double click an adobe .pdf file on my desktop that opens pronto, why would I hot key open my terminal window and type acroread and drag and past the .pdf link into the terminal to have it load? Same with hot keying terminal to open and typing vlc and dragging a video into the terminal for it to load. Who uses these functions, and why are they preferable to just GUI'ing it? What do you use CLI for personally, and do you see it as cumbersome to GUI?
Four answers:
ratter_of_the_shire
2011-09-28 02:36:27 UTC
Bash is useful because you can pipe things together and add logical controls (if, for, while, AND, OR). Bash is a Truing complete language.



The things you talk about no reason really to use a CLI. However say you have a bunch of pdf documents on the civil war and want to look at the ones that mention both Abraham Lincoln, and the Battle of Little Bighorn, and discusses monetary costs. Now that sound like a job for some command line glue and pdfgrep.



A lot of system administration is easier in CLI. I tend to use it a lot for that.



Also say you wanted to add a custom action the the context menu of your music files, but only when one of your mp3 players is mounted in the system. (Say transcode to mp3 and copy it to your player) You'd end up editing the config file for your file manager directly and would need to know the bash syntax to write the test case, and the actual command.





However it's not as bad as you might think. First becasue people who use CLI extensively tend not to touch the mouse as much and like to keep thier fingers on the keyboard. They wouldn't drag the file with the mouse. what they would do is use tab completions and thier memory of the file system.



They would type



user@home$vlc



and then start typing the path



user@home$vlc Vid



and then hit tab and it would autocomplete



user@home$vlc Video/



and then they would type the the start of the movie title



user@home$vlc Video/Harr



and hit tab to get



user@home$vlc Video/Harry\ Potter\ and\ the\



the might then double tab and it would display all the possible completions



Chamber of secrets, deathly hallows, goblet of fire and so on



so if the wanted the goblet of fire you would type Go and then tab to get



user@home$vlc Video/Harry\ Potter\ and\ the\ Goblet\ of\ Fire.mp4



and then enter to execute the command. A person oriented to the CLI tends not to rely on a file manager but keeps the file hierarchy in their head. They also don't tend to use the mouse, especially not going back and forth on a per command basis because it really interrupts the workflow as you have to take a hand off the keyboard, and because you have to take a second to switch your brain from a textual to a spatial mode. They also take advantage of all the little tricks available in the shell to reduce the time and verbosity necessary. They will often enable emacs or vi macros in the shell so they can pull out even more tricks.
Ratchetr
2011-09-27 17:37:15 UTC
The CLI power users won't start with a hot key to open a terminal window. There will already be one open, and they are probably already in it. If you start with the mindset that the user is already at a CLI, then it may very well be quicker and easier to launch a program using a command, rather than cleaning up the clutter on the desktop and so you can see the icon, then finding the 1 icon you want out of a bazzilion and 1 bits of junk, then finally double clicking. If you know the command, you type it in without thinking and run. If you are staring at a nice clean desktop with 5 icons, double clicking the 1 you want is just as easy. If the icon is buried, and you have a bazillion, it's harder.

I usually just do whatever is easier from where I am starting. What gets me there faster? Sometimes it's a GUI, sometimes it's a CLI. YMMV.
Markus
2011-09-27 16:45:20 UTC
If it's just to open a file, the GUI may be better / faster.



But the CLI puts a lot more power at your fingertips. E.g.:



find . -mtime -4 -name \*.pdf | xargs acroread



This would open all pdf files that have been modified / created in the last four days at any subdirectory level from the current directory.



The above is just one example. Once you get comfortable with the shell (bash), perl, python, ruby, etc. you will find tons of things to do in the CLI. Also CLI commands are easy to execute remotely by logging in via ssh.
?
2016-12-04 13:37:54 UTC
i do in comparison to this i think of is a stupidity i'm happy you do no longer write this i will tell you have been you incorrect human is a human i think of is a incorrect element to make writing's like this


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