Author Topic: 'Linux'... First Introduction !!  (Read 12484 times)

0 Members and 1 Guest are viewing this topic.

Offline andersm

  • Super Contributor
  • ***
  • Posts: 1198
  • Country: fi
Re: 'Linux'... First Introduction !!
« Reply #25 on: December 18, 2019, 07:41:24 am »
(MORE is less, but, well, less)
"more" is the original command, less came later. (A quick google says that MORE was first included in MS-DOS 2.0, released in 1983, the same year less was developed.)

Offline blacksheeplogic

  • Frequent Contributor
  • **
  • Posts: 532
  • Country: nz
Re: 'Linux'... First Introduction !!
« Reply #26 on: December 18, 2019, 07:45:36 am »
(MORE is less, but, well, less)
"more" is the original command, less came later. (A quick google says that MORE was first included in MS-DOS 2.0, released in 1983, the same year less was developed.)

I'm pretty sure pg predates more.
 

Offline brucehoult

  • Super Contributor
  • ***
  • Posts: 4046
  • Country: nz
Re: 'Linux'... First Introduction !!
« Reply #27 on: December 18, 2019, 09:36:39 am »
ls, mv, cp, cd, du are nice and short for commands you will be typing a lot.
You can get all up your high horse on how correct they are in DOS or not, they are not as short.

On Data Generals AOS/VS, only the beginning unique characters were require so f (filestatus) and that's even shorter than ls.

Don't forget "speed", the teco work-alike was was even *more* restricted and more cryptic. I actually managed to do useful things with it.
 

Online PA0PBZ

  • Super Contributor
  • ***
  • Posts: 5138
  • Country: nl
Re: 'Linux'... First Introduction !!
« Reply #28 on: December 18, 2019, 10:39:08 am »
Unix was invented and released at early 70s, while DOS was introduced in 1981, almost 2 decades later.

Show me your Calendar  :-//
Keyboard error: Press F1 to continue.
 

Offline andersm

  • Super Contributor
  • ***
  • Posts: 1198
  • Country: fi
Re: 'Linux'... First Introduction !!
« Reply #29 on: December 18, 2019, 01:24:13 pm »
I'm pretty sure pg predates more.
Sure, but it's neither more nor less.

Offline bsfeechannel

  • Super Contributor
  • ***
  • Posts: 1667
  • Country: 00
Re: 'Linux'... First Introduction !!
« Reply #30 on: December 19, 2019, 03:12:23 am »
OK, so why use a new command like 'ls' instead of 'dir' which is world known for a Directory listing?
Or, using 'cp' instead of the universally understood 'copy' as in DOS ? And numerous more changes.

Wait until you discover that there is no ren. Or that you can't quit vi.

 
The following users thanked this post: GlennSprigg

Offline blacksheeplogic

  • Frequent Contributor
  • **
  • Posts: 532
  • Country: nz
Re: 'Linux'... First Introduction !!
« Reply #31 on: December 19, 2019, 03:54:42 am »
OK, so why use a new command like 'ls' instead of 'dir' which is world known for a Directory listing?
Or, using 'cp' instead of the universally understood 'copy' as in DOS ? And numerous more changes.

Wait until you discover that there is no ren. Or that you can't quit vi.

I don't understand why anyone struggles with vi, It's those other editors that use obtuse and non-intuitive commands.


 

Offline CatalinaWOW

  • Super Contributor
  • ***
  • Posts: 5252
  • Country: us
Re: 'Linux'... First Introduction !!
« Reply #32 on: December 19, 2019, 04:49:27 am »
I will bow to the wisdom of those who are programmers and systems administrators and use this stuff everyday.  But GUIs took over from CLIs in most places.  How can this be when the CLI is so superior?  Well it is because all of those short commands and shortcuts have to be memorized to be efficient.  And if you don't do it everyday you forget.  And then you are searching help and FAQs and all that to get the job done and it is far less efficient. 

The doctors and lawyers and yes the electrical engineers who use these computers as a tool to do their real job value the crutch that is a GUI.  And snicker at the snobbery of those who recommend the CLI for everyone. 

That is not to say that there aren't uses for everyone in the CLI.  But it is hard to put to work on an occasional basis.  The person who does a good GUI version of grep will be very popular.  All the versions I have seen quickly lose generality in order to be "easier to use".  Which strikes me as bad UI design rather than too much complexity, but then I haven't been able to come up with that magic version either.
 
The following users thanked this post: Electro Detective, GlennSprigg

Offline Whales

  • Super Contributor
  • ***
  • Posts: 1902
  • Country: au
    • Halestrom
Re: 'Linux'... First Introduction !!
« Reply #33 on: December 19, 2019, 04:51:43 am »
N.B. you can use dir instead of ls if it's your preferred muscle memory:

Code: [Select]
alias dir=ls
Typing this in will only temporarily make it an alias (until you close the shell or logout).  Add it to your login scripts (either .bashrc or .profile depending on your setup; think of them like user-specific AUTOEXEC.BAT) and it will become a default.

Make your computer your own and tell everyone else to stuff it! :D  You should have seen my old windows installs.  It's a shame bb4win no longer works properly (Win10).
 
The following users thanked this post: GlennSprigg

Offline Ed.Kloonk

  • Super Contributor
  • ***
  • Posts: 4000
  • Country: au
  • Cat video aficionado
Re: 'Linux'... First Introduction !!
« Reply #34 on: December 19, 2019, 04:58:28 am »
OK, so why use a new command like 'ls' instead of 'dir' which is world known for a Directory listing?
Or, using 'cp' instead of the universally understood 'copy' as in DOS ? And numerous more changes.

Just to answer these, `ls` is short for `list`, while you say `dir` might be a more correct name for this command, it's actually not, as `dir` implies directories, not files.
`cp` is just `copy`, but shorter. When you type commands for a living, removing those extra characters for very very common commands is a real time saver, such as `rm` for remove.

The shell is so powerful, proper input/output redirection, pipes, fifos, remote low latency low bandwidth consoles via ssh, etc... I even write software in `vim`, a command line editor with full syntax highlighting that I can use from anywhere in the world remotely on a slow dial-up connection. I even write and cross compile applications for Windows on Linux in a Linux shell. Really, the command line is king, and it's why the tutorials all start there.

After cp came scp and I don't even know what Microsoft forces their users to type for that one..  securecopy?  :o But that would break the 8 char limit for filenames so they would prolly wanna chuck in some underscore luvliness. sec_copy? Perfect.


Welcome to the Linux community, GlennSprigg.

It's nice to hear a new user ask 'why is it done this way?' instead of the ranty 'Linux is dumb. It didn't do what I expected. Giving up.'

 :)
iratus parum formica
 
The following users thanked this post: GlennSprigg

Offline Ed.Kloonk

  • Super Contributor
  • ***
  • Posts: 4000
  • Country: au
  • Cat video aficionado
Re: 'Linux'... First Introduction !!
« Reply #35 on: December 19, 2019, 05:07:19 am »
I will bow to the wisdom of those who are programmers and systems administrators and use this stuff everyday.  But GUIs took over from CLIs in most places.  How can this be when the CLI is so superior?  Well it is because all of those short commands and shortcuts have to be memorized to be efficient.  And if you don't do it everyday you forget.  And then you are searching help and FAQs and all that to get the job done and it is far less efficient. 

The doctors and lawyers and yes the electrical engineers who use these computers as a tool to do their real job value the crutch that is a GUI.  And snicker at the snobbery of those who recommend the CLI for everyone. 

That is not to say that there aren't uses for everyone in the CLI.  But it is hard to put to work on an occasional basis.  The person who does a good GUI version of grep will be very popular.  All the versions I have seen quickly lose generality in order to be "easier to use".  Which strikes me as bad UI design rather than too much complexity, but then I haven't been able to come up with that magic version either.

The thing is.. as time goes on, the GUI changes and always changes when the user least needs it to. As gnif pointed out, the terminal is always there and works as expected and nobody would be so silly to mess around by daring to change it.
iratus parum formica
 
The following users thanked this post: GlennSprigg

Offline blacksheeplogic

  • Frequent Contributor
  • **
  • Posts: 532
  • Country: nz
Re: 'Linux'... First Introduction !!
« Reply #36 on: December 19, 2019, 05:18:29 am »
And snicker at the snobbery of those who recommend the CLI for everyone. 

I don't think I've ever seen someone snicker because CLI was used instead of the GUI but I have seen the CLI users snicker at the GUI users. It's unprofessional and the few that do give the impression that it's a general user trait, reality though there are always a few aholes in every group.

That is not to say that there aren't uses for everyone in the CLI.  But it is hard to put to work on an occasional basis.
??
I feel a lot of the CLI is better just comes down to it being easier to instruct on and it's also often more consistent.  Run this command rather than:
what GUI are you using, what version, do you have a icon that looks like a bird, yea, click the little arrow, what just came up etc...  WTF did you just click on??? Ummmm, was OK the ONLY button.... No I did not tell you to click on that.... WTF are you talking about, you click the button not me, next time 'Warning' appears don't click the Freakin OK button unless I tell you too...
 
The following users thanked this post: GlennSprigg

Offline Jeroen3

  • Super Contributor
  • ***
  • Posts: 4078
  • Country: nl
  • Embedded Engineer
    • jeroen3.nl
Re: 'Linux'... First Introduction !!
« Reply #37 on: December 19, 2019, 12:11:07 pm »
CLI and GUI have different use cases.
While the CLI can do anything, you also must remember everything and read manuals  :o.
A GUI often displays all available program paths, with it you can choose if what you want to do matches with what you read on the screen.

You can explore a GUI. You can read a man. Not the other way.
 
The following users thanked this post: GlennSprigg

Offline hazeanderson

  • Newbie
  • Posts: 9
  • Country: us
Re: 'Linux'... First Introduction !!
« Reply #38 on: December 19, 2019, 02:46:11 pm »
I don't understand why anyone struggles with vi, It's those other editors that use obtuse and non-intuitive commands.

I believe it is because not all computer users have learned "proper" touch typing. (I myself took a whole year of typing class.) vim is designed for touch typists and the others are not. vim is also associative in that you can figure out commands on your own -- as if you are literally creating them on the spot -- once you understand the workflow. ce2/ anyone?  :-+
 
The following users thanked this post: GlennSprigg

Offline hazeanderson

  • Newbie
  • Posts: 9
  • Country: us
Re: 'Linux'... First Introduction !!
« Reply #39 on: December 19, 2019, 02:57:02 pm »
The person who does a good GUI version of grep will be very popular.

grep is intended for processing text and subsequently doing stuff with that text -- within the context that grep is being used in (AKA a shell). Why would I want a GUI to run privileged commands and how would I tell it take action on the results?

If Google Chrome wants to hog my MacBook Pro I will just pop on over to a shell and issue:

ps aux | grep Chrome | perl -nle'/(\d+)/;print$1' | xargs -n1 kill -9

I did not take the time to learn to be lawyer or a doctor but if I wanted to do as they did .... well ... let's keep things in proper perspective here please. GUIs are fine but the command line is never going to go away, no matter how many times it is "replaced."
« Last Edit: December 19, 2019, 02:59:02 pm by hazeanderson »
 
The following users thanked this post: GlennSprigg

Offline Ed.Kloonk

  • Super Contributor
  • ***
  • Posts: 4000
  • Country: au
  • Cat video aficionado
Re: 'Linux'... First Introduction !!
« Reply #40 on: December 19, 2019, 03:25:01 pm »
The person who does a good GUI version of grep will be very popular.

grep is intended for processing text and subsequently doing stuff with that text -- within the context that grep is being used in (AKA a shell). Why would I want a GUI to run privileged commands and how would I tell it take action on the results?

If Google Chrome wants to hog my MacBook Pro I will just pop on over to a shell and issue:

ps aux | grep Chrome | perl -nle'/(\d+)/;print$1' | xargs -n1 kill -9

I did not take the time to learn to be lawyer or a doctor but if I wanted to do as they did .... well ... let's keep things in proper perspective here please. GUIs are fine but the command line is never going to go away, no matter how many times it is "replaced."

Luke and Derek recently butted heads about grep..



« Last Edit: December 19, 2019, 03:26:32 pm by Ed.Kloonk »
iratus parum formica
 
The following users thanked this post: GlennSprigg

Offline hazeanderson

  • Newbie
  • Posts: 9
  • Country: us
Re: 'Linux'... First Introduction !!
« Reply #41 on: December 19, 2019, 03:45:11 pm »
I can't take the video titles seriously enough to watch. The first one says I am George Castanza and shallow women are laughing at me. 
:-// :-DD  :-DD

The second says I will be strong and bald if I stop using cat and grep and only use awk. :box: |O

I hope my point was not overlooked however. My point was that when you use something like grep you are generally not even in the realm of being in a GUI in the first place ... other than to draw the window for your shell.

This is not about "my way is better than your way" ... there are always ways to reduce the amount of characters you type (a sport known as golfing amongst hardcore hobbyist) ... the point is that the "UNIX shell way" allows you express yourself in a way that makes sense to you, or more importantly, your organization.
« Last Edit: December 19, 2019, 03:50:37 pm by hazeanderson »
 
The following users thanked this post: Ed.Kloonk, GlennSprigg

Offline brucehoult

  • Super Contributor
  • ***
  • Posts: 4046
  • Country: nz
Re: 'Linux'... First Introduction !!
« Reply #42 on: December 19, 2019, 03:55:53 pm »
The person who does a good GUI version of grep will be very popular.

grep is intended for processing text and subsequently doing stuff with that text -- within the context that grep is being used in (AKA a shell). Why would I want a GUI to run privileged commands and how would I tell it take action on the results?

If Google Chrome wants to hog my MacBook Pro I will just pop on over to a shell and issue:

ps aux | grep Chrome | perl -nle'/(\d+)/;print$1' | xargs -n1 kill -9

I did not take the time to learn to be lawyer or a doctor but if I wanted to do as they did .... well ... let's keep things in proper perspective here please. GUIs are fine but the command line is never going to go away, no matter how many times it is "replaced."

Try...

Code: [Select]
pgrep Chrome

Works on both Mac and Linux.

kill doesn't need the -n1 on xargs.

Not to mention pkill, but I like to check the results first e.g. "pgrep Chrome | xargs ps"
« Last Edit: December 19, 2019, 03:58:22 pm by brucehoult »
 

Offline gnif

  • Administrator
  • *****
  • Posts: 1682
  • Country: au
Re: 'Linux'... First Introduction !!
« Reply #43 on: December 19, 2019, 03:58:15 pm »
The person who does a good GUI version of grep will be very popular.

grep is intended for processing text and subsequently doing stuff with that text -- within the context that grep is being used in (AKA a shell). Why would I want a GUI to run privileged commands and how would I tell it take action on the results?

If Google Chrome wants to hog my MacBook Pro I will just pop on over to a shell and issue:

ps aux | grep Chrome | perl -nle'/(\d+)/;print$1' | xargs -n1 kill -9

I did not take the time to learn to be lawyer or a doctor but if I wanted to do as they did .... well ... let's keep things in proper perspective here please. GUIs are fine but the command line is never going to go away, no matter how many times it is "replaced."

Try...

Code: [Select]
pgrep Chrome

Works on both Mac and Linux.

kill doesn't need the -n1 on xargs.

Or, even easier:

Code: [Select]
pkill -9 chrome
 

Offline brucehoult

  • Super Contributor
  • ***
  • Posts: 4046
  • Country: nz
Re: 'Linux'... First Introduction !!
« Reply #44 on: December 19, 2019, 03:59:41 pm »
You posted as I was editing my message to include pkill and explain it's maybe a little tooo dangerous
 

Offline Ed.Kloonk

  • Super Contributor
  • ***
  • Posts: 4000
  • Country: au
  • Cat video aficionado
Re: 'Linux'... First Introduction !!
« Reply #45 on: December 19, 2019, 04:02:36 pm »
$ kill_all_humans

iratus parum formica
 

Offline brucehoult

  • Super Contributor
  • ***
  • Posts: 4046
  • Country: nz
Re: 'Linux'... First Introduction !!
« Reply #46 on: December 19, 2019, 04:13:35 pm »
$ kill_all_humans

Affirmative - I poked one, it was dead.
 
The following users thanked this post: Ed.Kloonk, hazeanderson

Offline magic

  • Super Contributor
  • ***
  • Posts: 6807
  • Country: pl
Re: 'Linux'... First Introduction !!
« Reply #47 on: December 19, 2019, 06:10:53 pm »
The thing is.. as time goes on, the GUI changes and always changes when the user least needs it to. As gnif pointed out, the terminal is always there and works as expected and nobody would be so silly to mess around by daring to change it.
Except for GNU and their ls printing "" around filenames which contain spaces ::)

And then of course people flood their mailing list calling them the worst names and they go like "look, we did nothing wrong, there was a beta release, you could have tested it and reported your concerns earlier" |O
 

Offline Ed.Kloonk

  • Super Contributor
  • ***
  • Posts: 4000
  • Country: au
  • Cat video aficionado
Re: 'Linux'... First Introduction !!
« Reply #48 on: December 19, 2019, 09:56:53 pm »
The thing is.. as time goes on, the GUI changes and always changes when the user least needs it to. As gnif pointed out, the terminal is always there and works as expected and nobody would be so silly to mess around by daring to change it.
Except for GNU and their ls printing "" around filenames which contain spaces ::)

And then of course people flood their mailing list calling them the worst names and they go like "look, we did nothing wrong, there was a beta release, you could have tested it and reported your concerns earlier" |O

Release early and release often. For every one that bitches about what it doesn't do for them there are 9 more that are very happy they got in at the ground floor.
iratus parum formica
 

Offline jmelson

  • Super Contributor
  • ***
  • Posts: 2767
  • Country: us
Re: 'Linux'... First Introduction !!
« Reply #49 on: December 19, 2019, 11:02:39 pm »
OK, so why use a new command like 'ls' instead of 'dir' which is world known for a Directory listing?
Or, using 'cp' instead of the universally understood 'copy' as in DOS ? And numerous more changes.

You have to realize these commands were written about 1970 (maybe earlier) when Unix was born, and have just persisted.
So, ls came WAY before DOS, way before CP/M, and so on.

Jon
 
The following users thanked this post: Ed.Kloonk, GlennSprigg


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf