The best thing for CLI?

Chat about Linux in general
Forum rules
Do not post support questions here. Before you post read the forum rules. Topics in this forum are automatically closed 6 months after creation.
Cammo

The best thing for CLI?

Post by Cammo »

Hi all,

As you're all undoubtedly aware, Linux based systems aren't anywhere near as popular as Windows. I'm thinking a big part has been due to the GUI based framework of Win - it makes transitioning to CLI terrifying, even for experienced Win users.

As you can probably tell, I'm a relative newbie to Unix systems in general. I thought I'd ask what people think could popularise the CLI side of Mint too for Win refugees.

As a recent convert myself, I tried to stay out of the terminal for as long as I could, using it only when absolutely necessary. However, it was inescapable - anything I searched on the internet said "enter this into the terminal" etc. So, I'd copy paste the command in and BAM! something cool happened in a few lines of code. However, the power of CLI became apparent when I started using apt-get install x. It dawned on me that what would be a lot of clicks and a fair amount of waiting if done through GUI could be done in a single line in the terminal.

What's your experiences been with CLI in general - how do you think we could improve it, popularise it, etc?
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
wayne128

Re: The best thing for CLI?

Post by wayne128 »

What's your experiences been with CLI in general - how do you think we could improve it, popularise it, etc?
Improve? Popularise?
I think you cannot change that ..it is trend that is hard to change

all people around me.. they do not use terminal for anything WinXP/vista/7/9, apple mac, iphone, android. ipad ..
they do not need to use terminal at all for decades.


My experience:
1. Must overcome the fear of using terminal.
2. Must psychologically?? sorry cannot type the right word :mrgreen:, remove the 'hate of using terminal'..often codes found on internet are very cryptic to people.

3. Must be able to cope with at time, being playful and test on someone codes posted on internet, then found that it will make the Linux OS unbootable..
the two command examples here

dd
rm -r


4. Should understand one important aspect of terminal,
root is very powerful.. power come with 'responsibility'.


It took me many months to overcome item1.
and first ever terminal command I learned was with the help of a person over internet:
apt-get install ttf-xyz....
it took me more than one month to try all sorts of method to install a font and really it was next to impossible for many linux oses at that time..click until my right hand hurt!.

If you wish to proceed a little further, here is just one quiz.. for you. haha,
don't worry, I am responsible :lol: :mrgreen:

Please answer this question..

What is the output of "date -u +%V$(uname)|sha256sum|sed 's/\W//g'"?(Required)
Cammo

Re: The best thing for CLI?

Post by Cammo »

wayne128 wrote: What is the output of "date -u +%V$(uname)|sha256sum|sed 's/\W//g'"?(Required)
9a93b71d5b2841e649195bc81f8e38600860a040bc368cdbd0cde346b73248a1

Point proven. Honestly, just looking at that command made my eyes hurt. I figured out parts of it - I knew it was doing something with turning the date into an sha checksum, and piping the result into something else. Certainly not the whole lot! For my info, what does piping something into sed 's/\W//g' do?

Also with your power/responsibility thing - I tried the old fork bomb out as well, just to see if Mint had a counter like Mac and Arch apparently have. It didn't, and I had to reset (no biggie, I shut everything down before fork-bombing). When I looked up an explanation for how it worked, I was amazed at how versatile bash is. I had no idea you could recursively call a function that pipes its own output into another instance of itself.

Anyway, back to your original point - long winded commands terrify people. I guess that's what scripts are for (and so on, building up the layers of complexity). But there are some terrific terminal based commands out there, like wget and another one that I can't quite remember (it performs a trace route function for where your packets go between here and another IP address). Do you think a layered approach would help, eg a gui with optional command switches? Or do you think it's time to put CLI to rest as outdated and error prone? It is quite easy to accidentally wreck a command with a typo, especially when using sudo!
wayne128

Re: The best thing for CLI?

Post by wayne128 »

Oh, that is perfect..
No I am not the one come out with that quiz.
I tried at one time, reading many people got stuck.. I did solve it myself.

Here I tell you where it is used.
https://bbs.archlinux.org/register.php
wayne128

Re: The best thing for CLI?

Post by wayne128 »

like wget


I often use wget to download iso from website.

wget -c <website address on that iso>

good thing is, if internet breaks, or relogin.... it will continue and I do not need to start fresh.
and another one that I can't quite remember (it performs a trace route function for where your packets go between here and another IP address).
traceroute is common for network troubleshooting.
it is not unique to Linux
Win also use traceroute, almost the same command

it trace your computer to the website you wish to connect and print out ALL traces.
you will often be surprise the website is in your country but traceroute show you it travel across the globe to many countries before getting to the destination.


Do you think a layered approach would help, eg a gui with optional command switches? Or do you think it's time to put CLI to rest as outdated and error prone?
oh i m not knowledgeable on this so no comment
It is quite easy to accidentally wreck a command with a typo, especially when using sudo!
I started learning the phrase su to root..
I meant I use distros that is su
so much less time for sudo.

and I was a bit accustomed to how internet and forums works.
hmm, sorry to point this out, at time some one can 'scold' just because you use su instead of sudo... or sudo instead of su.. I was scolded for using apt-get instead of aptitude :evil:

typo is very common...
like
mount /dev/sda /mnt
people might do without a space..

umount /dev/sda5
people might , because of the proper english spelling, type
unmount /dev/sda5

well. those are what a person will find out sooner or later..
part of learning curve.
xerion567

Re: The best thing for CLI?

Post by xerion567 »

I think it comes down to the limitations of human memory. Computer systems are becoming more complex all the time, but our ability to memorize those systems has remained the same. So to compensate we need to come up with better schemes to organize that complexity into something we can more easily absorb.

Think about the DOS environment- sure it was CLI only but it was simple. There were only a handful of things you really needed to know to get around, and not very many options to configure either. The filesystem was small enough that you could reasonably understand the purpose of each file, and memorize the directory hierarchy. Naturally there is a cost to such simplicity- limitations.

Now we want our computers to network. We want to listen to music, and surf the net, and talk to our friends- all at the same time. The computers come with specialized graphics display hardware, and sophisticated memory protection schemes. They come in all sorts of different configurations with all sorts of different ways to get data from point A to point B. And on top of all that, we've got so many different programs that do this that and the other! Complexity, here we come!

I now have literally millions of files on my machine, scattered in all sorts of arrangements of folders. There are so many different programs for so many different purposes, there's no way I can remember all of them- let alone what sort of options are available on each one. Sometimes, you just need the computer to narrow down your choices to a reasonable amount and present them so you can make a decision; that's what a GUI is for.

The GUI is the best way we've come up with to try and organize the mess of complexity that our computers have become so far. The CLI may be fast and powerful, but it exceeds our human limitations. Especially if that human isn't particularly interested in memorizing the inner workings of their computer. Oh yes, what we humans need now is a DBI (direct brain interface). :twisted:
Cammo

Re: The best thing for CLI?

Post by Cammo »

xerion567 wrote:Sometimes, you just need the computer to narrow down your choices to a reasonable amount and present them so you can make a decision; that's what a GUI is for
Please don't think I'm maligning GUI in any way - I'd be mincemeat without it. I'm simply asking for thoughts on how to spread the power of the console to the masses. Or otherwise opining on possibilities to combine the power of CLI with the speed of GUI. Then again, I guess that might be what you'd call keyboard shortcuts.

It's such a shame that learning the commands is such an exercise these days - I found an online encyclopedia of bash commands and it went for pages. No chance. But then again, scripting or aliasing commonly used commands to something else might reduce the complexity of commands. I'm thinking maybe something thing that extracts tarballs, compiles/installs source code and adds uninstall info. That would be awesome! Similar to apt-get install for stuff from the repos in that regard.
xerion567 wrote:Oh yes, what we humans need now is a DBI (direct brain interface). :twisted:
Haha, and that way you think twice about fiddling around with config files. Computer goes down -> brain goes down -> you go down.
killer de bug

Re: The best thing for CLI?

Post by killer de bug »

Cammo wrote:Or do you think it's time to put CLI to rest as outdated and error prone? It is quite easy to accidentally wreck a command with a typo, especially when using sudo!
If you don't want to use CLI under Linux you can. It's up to you. But one day you will understand that you lose time with GUI for simple operations.

And please be aware that low level command will always be here as a part of your system. GUI is only a layer on top of them. So people will always be able to use them, and that's way better like this.

Why would we remove something reliable, fast, and powerful? :roll:
InkKnife
Level 5
Level 5
Posts: 741
Joined: Mon Apr 30, 2012 5:24 pm

Re: The best thing for CLI?

Post by InkKnife »

Distros like Mint are at the point that you don't ever really need to use the terminal and that is a good thing. What we want is to have a rich and easy to use graphical interface and all the power of the cli tool chain at the same time.
I understand the impulse to want to get people more interested in the terminal but that just ain't gonna happen. People learn to use the terminal when they run into a need that the terminal can solve, regular people, not us weirdo nerds who love digging in and learning new things about technology.
i7 3770, 12GB of ram, 256GB SSD, 64GB SSD, 750GB HDD, 1TB HDD, Cinnamon.
killer de bug

Re: The best thing for CLI?

Post by killer de bug »

InkKnife wrote:Distros like Mint are at the point that you don't ever really need to use the terminal and that is a good thing. What we want is to have a rich and easy to use graphical interface and all the power of the cli tool chain at the same time.
I agree! But the terminal will still always be here for the ones who want to use it :)
Habitual

Re: The best thing for CLI?

Post by Habitual »

xerion567 wrote:I think it comes down to the limitations of human memory. Computer systems are becoming more complex all the time, but our ability to memorize those systems has remained the same.
...
The GUI is the best way we've come up with to try and organize the mess of complexity that our computers have become so far.
Great Answer!
You are very Wise.
User avatar
Flemur
Level 20
Level 20
Posts: 10096
Joined: Mon Aug 20, 2012 9:41 pm
Location: Potemkin Village

Re: The best thing for CLI?

Post by Flemur »

For my info, what does piping something into sed 's/\W//g' do?

In the given example, it does nothing. As a 'vi' user, I know it's supposed to remove 'W' characters, and the "\" is extraneous.

Back when I programmed in Unix, IIRC we used the 'k' (korn) shell; I disliked it, so rather than writing scripts I'd write a little C program with 'system' calls.
Please edit your original post title to include [SOLVED] if/when it is solved!
Your data and OS are backed up....right?
User avatar
xenopeek
Level 25
Level 25
Posts: 29607
Joined: Wed Jul 06, 2011 3:58 am

Re: The best thing for CLI?

Post by xenopeek »

Cammo wrote:What's your experiences been with CLI in general - how do you think we could improve it, popularise it, etc?
I'm not a good one to ask... I started my career working on UNIX machines. I've been on the terminal a long time, so the Linux terminal felt right at home. I don't know that an average user (those that see computers as appliances) would ever need to go to the terminal or have the interest to spend time learning something new. All that they need on daily basis can be done with GUI programs. The reasons you see so many posts on the Internet referring you to the terminal (I do this here also) are:
  • It is one of the few common factors on Linux. The terminal works, regardless of which desktop environment and GUI programs you are using. Most things can be done also through GUI programs, but from one desktop environment to another, and from one distro to another, or even from one version to the next of the GUI program, it might be radically different how you do that. Sure, there are differences on the terminal also, but if you exclude package managers I think the variants are much smaller.
  • It's much harder to explain over the Internet how to do something using GUI programs, step by step, as compared to ask to run a few commands on the terminal and share the output.
  • And finally, I don't trust somebody using a GUI program to have done what I put in a solution as there are just to many buttons, check boxes, and whatnot that could have been set incorrectly. Compare that to copying & pasting the command I made sure is the right one...
Anyway, whenever somebody shows interest in the terminal and wants to learn more I point them here: http://flossmanuals.net/command-line/

For those new to the terminal and that want more, look to using a different shell. On Linux Mint you will be using bash by default. zsh or fish have much more extensive auto-complete functions. fish pulls parameters and definitions from manpages, so when you <tab> while typing a command it will show you matching parameters and their definitions.
Image
InkKnife
Level 5
Level 5
Posts: 741
Joined: Mon Apr 30, 2012 5:24 pm

Re: The best thing for CLI?

Post by InkKnife »

I totally understand about how much easier it is to provide code to paste into a terminal window than to explain a GUI interface to someone. That is an easy way to solve someone’s problem. The thing is though, if you are dealing with a non-technical user, you have solved their problem but taught them nothing. If you take the time to explain how the GUI tool works that person will never have to ask about tasks like that again.
The functionality of a GUI application is discoverable so usually once someone gets a basic intro to a GUI tool they can figure it out from there, but the cli is absolutely non-discoverible. You can learn a GUI tool just by fiddling around with it, the same cannot be said of the command line.
I see the dependence on the terminal for support as a very real impediment to more people adopting Linux. The Mint team devotes a lot of time and effort into building and including a very powerful suite of GUI tools and utilities but you would never know these tools existed from reading the help threads here.
When you or I see a terminal window we see a powerful, open ended tool. When a non-technical person sees a terminal window they see a sign that reads "Go Away, Too Complicated For You".
i7 3770, 12GB of ram, 256GB SSD, 64GB SSD, 750GB HDD, 1TB HDD, Cinnamon.
xerion567

Re: The best thing for CLI?

Post by xerion567 »

InkKnife wrote:I see the dependence on the terminal for support as a very real impediment to more people adopting Linux. The Mint team devotes a lot of time and effort into building and including a very powerful suite of GUI tools and utilities but you would never know these tools existed from reading the help threads here.
Along those lines, one of the things that makes the terminal imperative for troubleshooting is feedback. Most GUI apps will discard messages sent to stderr, and instead present the user with vague or incomplete error messages, or even worse, they don't indicate that there was a problem at all and simply go on misbehaving (software manager I'm looking at YOU here! :evil: .)

Something to consider which might go a long way for troubleshooting would be a "debug/troubleshoot application launcher"- essentially an app launcher which runs something from the menu with the stderr output captured.
InkKnife
Level 5
Level 5
Posts: 741
Joined: Mon Apr 30, 2012 5:24 pm

Re: The best thing for CLI?

Post by InkKnife »

xerion567 wrote:
InkKnife wrote:I see the dependence on the terminal for support as a very real impediment to more people adopting Linux. The Mint team devotes a lot of time and effort into building and including a very powerful suite of GUI tools and utilities but you would never know these tools existed from reading the help threads here.
Along those lines, one of the things that makes the terminal imperative for troubleshooting is feedback. Most GUI apps will discard messages sent to stderr, and instead present the user with vague or incomplete error messages, or even worse, they don't indicate that there was a problem at all and simply go on misbehaving (software manager I'm looking at YOU here! :evil: .)

Something to consider which might go a long way for troubleshooting would be a "debug/troubleshoot application launcher"- essentially an app launcher which runs something from the menu with the stderr output captured.
I agree that there are some problems that are going to require using the terminal but most of the time the problem can be solved in the GUI and I think it would be better to help a newb learn about availible gui tools than to send him to the terminal.
For instance, say someone has downloaded an archive containing an icon set they found somewhere. They ask how to install the icons so he can use them. One way would be to give him the code to copy into the terminal to extract the archive and place the contents in the correct locations, bing, boom, done. Fast, easy and a month from now they will be back asking how to install another set of icons because they cannot remember the command.
Or, you could tell them to locate the archive, tell them how to extract it in place and then show them where it goes, and how to use the open as root context command to place the icon set in the correct place using the file manager. Not as fast, not as easy but it is something a newb can remember.
i7 3770, 12GB of ram, 256GB SSD, 64GB SSD, 750GB HDD, 1TB HDD, Cinnamon.
User avatar
Pilosopong Tasyo
Level 6
Level 6
Posts: 1432
Joined: Mon Jun 22, 2009 3:26 am
Location: Philippines

Re: The best thing for CLI?

Post by Pilosopong Tasyo »

<Off Topic>
Flemur wrote:
For my info, what does piping something into sed 's/\W//g' do?

In the given example, it does nothing. As a 'vi' user, I know it's supposed to remove 'W' characters, and the "\" is extraneous.

The \W is a regex escape sequence/metacharacter, which matches any "non-word" character. And in the context of the sed command above, it deletes the space and hyphen characters at the end of the sha256sum output.
o Give a man a fish and he will eat for a day. Teach him how to fish and he will eat for a lifetime!
o If an issue has been fixed, please edit your first post and add the word [SOLVED].
Cammo

Re: The best thing for CLI?

Post by Cammo »

[quote="Pilosopong Tasyo" <Off topic> (Explains command) [/quote]
Cheers for that.
InkKnife wrote:it would be better to help a newb learn about availible gui tools than to send him to the terminal.
Agreed, especially If you're dealing with a noob migrating from Windows who's used to seeing GUI, GUI everywhere (such as myself). It's not easy to learn new software, especially if you're also trying to use it productively at the same time. Consider the case of an office that suddenly buys everyone laptops with Mint instead of Win7 (hopefully they'd be smart enough to avoid Win8). They expect to be able to perform basic tasks like word processing, internet exploring, networking etc etc straight out of the box. Imagine the pain for the poor network engineer (or more likely, secretary) trying to figure out the proper CLI for each system under time and money pressure?

By the same token, I also see xenopeek's point about it making troubleshooting easier. So much varies across distros and even DEs that only seeking a GUI solution could be counter-productive. The terminal is the only real common denominator. Also, extending your line of reasoning, xenopeek, if we made a particular DE the common denominator, we'd lose the beauty of Linux. IMHO, the motto for Linux should be something along the lines of "make your computer YOUR computer". Thus, a rather circuitous way of saying it, but I also agree with you, xenopeek.


However, I disagree with InkKnife's point about CLI solutions not teaching noobs anything. I've been fortunate enough to have had lots of help with my teething problems in Mint from the community, and most times when somebody asks me to put something into the terminal, they explain what it's intended to do (or otherwise adding --help in the console clarifies it). While most people (including me) will probably find it easier to learn how a GUI works, a good community like this one can make it easier to learn how commands work. For example - I've been looking into backup solutions, and have found a wealth of info about using rsync. Without the clearly documented tutorials, I'd be very vary of trying to backup important files via CLI.

<Off topic>
InkKnife wrote:When you or I see a terminal window we see a powerful, open ended tool. When a non-technical person sees a terminal window they see a sign that reads "Go Away, Too Complicated For You".
Haha, I love it! Do you mind if I use this in my sig?

PS - thanks for the link, xenopeek.
</off topic>
User avatar
xenopeek
Level 25
Level 25
Posts: 29607
Joined: Wed Jul 06, 2011 3:58 am

Re: The best thing for CLI?

Post by xenopeek »

I really don't agree with what InkKnife wrote. With none of it actually...
InkKnife wrote:If you take the time to explain how the GUI tool works that person will never have to ask about tasks like that again.
The functionality of a GUI application is discoverable so usually once someone gets a basic intro to a GUI tool they can figure it out from there
The amount of questions I see about GUI programs make evident that most people don't discover anything on their own in GUI programs. Yes, GUI programs should be considered self-discoverable. You can just browse all the menus to try and find what you need and you can consult the help. From the questions I see that is even a bridge too far for most...
InkKnife wrote:You can learn a GUI tool just by fiddling around with it, the same cannot be said of the command line.
Again, most people asking questions don't fiddle around with the GUI. apropos, whatis, and man let you discover things all on your own on the terminal. You only need to know "man man" to get started. Sure, there is a lot of reading to do when you are new to the terminal. The fact is most people don't ready any help documentation anyway--whether it is a manpage or the GUI program's help. It didn't really help Linux Mint users that for so long Linux Mint came with built-in help disabled on all editions except KDE. I don't know if that was finally fixed in Linux Mint 16, though I doubt availability of help would make much of a difference to most.
Image
pgmer6809
Level 4
Level 4
Posts: 228
Joined: Sun Mar 04, 2012 9:06 pm

Re: The best thing for CLI?

Post by pgmer6809 »

Pilosopong Tasyo wrote:<Off Topic>
Flemur wrote:
For my info, what does piping something into sed 's/\W//g' do?

In the given example, it does nothing. As a 'vi' user, I know it's supposed to remove 'W' characters, and the "\" is extraneous.

The \W is a regex escape sequence/metacharacter, which matches any "non-word" character. And in the context of the sed command above, it deletes the space and hyphen characters at the end of the sha256sum output.
Exactlly. And it does not take much to test this. Look here:

Code: Select all

echo "%abc 123 xyz ,p,q-+mOP" | sed 's/\W//g'
gives this result:

Code: Select all

abc123xyzpqmOP
The above cmd deletes any characters that are NOT "word" characters. Typically \W matches punctuation and special characters. The sed cmd substitutes a null for any character that matches one of these, leaving only the others.
Now look at the opposite cmd below where we have sed matching \w (i.e. lower case w). Here sed is substituting a null for any chararcter that IS a "word" character, leaving only the special characters. Note the spaces between the % sign and the others. Spaces are NOT word characters.

Code: Select all

echo "%abc 123 xyz ,p,q-+mOP" | sed 's/\w//g'
gives a different result:

Code: Select all

%   ,,-+
Locked

Return to “Chat about Linux”