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

0 Members and 1 Guest are viewing this topic.

Offline GlennSpriggTopic starter

  • Super Contributor
  • ***
  • Posts: 1259
  • Country: au
  • Medically retired Tech. Old School / re-learning !
'Linux'... First Introduction !!
« on: December 17, 2019, 01:32:29 pm »
I've been a 'DOS/Windows' man all my life! However, I've decided to be a bit more 'edurmecated'
and so I'm playing around with 'Linux' as a Virtual-Machine first, within a Windows PC.

Now obviously, GUI's make the learning relatively typical, (but different), than Windows or a Mac.
However, most online 'tuition's' seem to start with the CLI (Command Line Interpreter), as so much
seems to be done with that, for most users, although it seems daunting at first. And that's OK.

But why did they seemingly have to "re-invent the wheel" ?  Basically, it's like going back to 'DOS',
which I'm very familiar with, although I can understand that for a lot of young people today is foreign.
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.

I don't understand why they didn't standardize the names, even though it is a different O.S.   :phew:
« Last Edit: December 17, 2019, 02:54:42 pm by gnif »
Diagonal of 1x1 square = Root-2. Ok.
Diagonal of 1x1x1 cube = Root-3 !!!  Beautiful !!
 

Offline hazeanderson

  • Newbie
  • Posts: 9
  • Country: us
Re: 'Linux'... First Introduction !!
« Reply #1 on: December 17, 2019, 01:41:37 pm »
DOS is a watered-down version of UNIX. Linux is a proper UNIX implementation. Linux may have come after DOS, but UNIX was first. DOS is the "wheel reinventer" here.  :popcorn:

So things like ls, cp, mv and xargs (good luck doing that on DOS) were first.

Learning the cli in UNIX (Linux) is pure power. I recommend it.
« Last Edit: December 17, 2019, 01:43:58 pm by hazeanderson »
 
The following users thanked this post: rx8pilot, GlennSprigg

Offline NiHaoMike

  • Super Contributor
  • ***
  • Posts: 9159
  • Country: us
  • "Don't turn it on - Take it apart!"
    • Facebook Page
Re: 'Linux'... First Introduction !!
« Reply #2 on: December 17, 2019, 01:48:11 pm »
If you haven't noticed, the Powershell in Windows supports many common Linux commands. And Windows 10 has WSL...
Cryptocurrency has taught me to love math and at the same time be baffled by it.

Cryptocurrency lesson 0: Altcoins and Bitcoin are not the same thing.
 
The following users thanked this post: GlennSprigg

Offline GlennSpriggTopic starter

  • Super Contributor
  • ***
  • Posts: 1259
  • Country: au
  • Medically retired Tech. Old School / re-learning !
Re: 'Linux'... First Introduction !!
« Reply #3 on: December 17, 2019, 02:07:38 pm »
DOS is a watered-down version of UNIX. Linux is a proper UNIX implementation. Linux may have come after DOS, but UNIX was first. DOS is the "wheel reinventer" here.  :popcorn:

So things like ls, cp, mv and xargs (good luck doing that on DOS) were first.

Learning the cli in UNIX (Linux) is pure power. I recommend it.

FIRSTLY, congratulations on your very first Post/Comment !!  And thanks  8)
Yea, but I keep seeing on 'YouTube' that the first thing to learn is that 'Linux' is not 'Unix'  :(
Obviously though, at some original point, their boundaries cross !!   ;D
Diagonal of 1x1 square = Root-2. Ok.
Diagonal of 1x1x1 cube = Root-3 !!!  Beautiful !!
 
The following users thanked this post: hazeanderson

Offline hazeanderson

  • Newbie
  • Posts: 9
  • Country: us
Re: 'Linux'... First Introduction !!
« Reply #4 on: December 17, 2019, 02:24:40 pm »
Thank you. I first learned UNIX and Linux back in 1996, when I was studying Computer Science. Wikipedia is actually decent for learning the history of topics such as this: https://en.wikipedia.org/wiki/History_of_Linux

For all in tents, and porpoises ... Linux is UNIX.
 
The following users thanked this post: GlennSprigg

Offline gnif

  • Administrator
  • *****
  • Posts: 1691
  • Country: au
Re: 'Linux'... First Introduction !!
« Reply #5 on: December 17, 2019, 02:46:06 pm »
DOS is a toy compared to the Unix terminal. Congratulations on the leap to Linux, while the learning may be slow at first, once you get comfortable with the shell you will start to love it more and more each day. I use a GUI for my web browser, and photo editing... outside of that, I never work outside of a terminal.
 
The following users thanked this post: Ed.Kloonk, GlennSprigg

Offline eugenenine

  • Frequent Contributor
  • **
  • Posts: 865
  • Country: us
Re: 'Linux'... First Introduction !!
« Reply #6 on: December 17, 2019, 02:46:48 pm »
I've been a 'DOS/Windows' man all my life! However, I've decided to be a bit more 'edurmecated'
and so I'm playing around with 'Linux' as a Virtual-Machine first, within a Windows PC.

Now obviously, GUI's make the learning relatively typical, (but different), than Windows or a Mac.
However, most online 'tuition's' seem to start with the CLI (Command Line Interpreter), as so much
seems to be done with that, for most users, although it seems daunting at first. And that's OK.

But why did they seemingly have to "re-invent the wheel" ?  Basically, it's like going back to 'DOS',
which I'm very familiar with, although I can understand that for a lot of young people today is foreign.
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.

I don't understand why they didn't standardize the names, even though it is a different O.S.   :phew:

You have it backwards though.  Linux is an open source clone of unix and unix came before DOS.  Dos is what re-invented the wheel and only implemented a subset of familiar unix commands.
If you check an ascii chart you'll notice that dos/microsoft re-arranged a few characters as well and our current keyboard config isn't quite as standard as it should have been.

There have been several packages that could add the missing commands/windows to dos over the years.

I have often found myself typing ls or cp or passwd or ifconfig (or even show running-config) or shift 2 to get " over the years.  I made the linux switch around 2002-2003 when windowsXP was a big let down after windows 2000
« Last Edit: December 17, 2019, 02:52:37 pm by eugenenine »
 
The following users thanked this post: GlennSprigg

Offline gnif

  • Administrator
  • *****
  • Posts: 1691
  • Country: au
Re: 'Linux'... First Introduction !!
« Reply #7 on: December 17, 2019, 02:50:13 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.

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.
« Last Edit: December 17, 2019, 02:56:16 pm by gnif »
 
The following users thanked this post: GlennSprigg

Offline bitwelder

  • Frequent Contributor
  • **
  • Posts: 970
  • Country: fi
Re: 'Linux'... First Introduction !!
« Reply #8 on: December 17, 2019, 03:28:59 pm »
On the why Linux has so many short commands... because it derives from Unix and in the old times the typical Unix input device was a teletype, which had keys hard to press, so less keys pressed for each command were a good thing!

 
The following users thanked this post: GlennSprigg

Offline SiliconWizard

  • Super Contributor
  • ***
  • Posts: 14932
  • Country: fr
Re: 'Linux'... First Introduction !!
« Reply #9 on: December 17, 2019, 03:29:25 pm »
As said above, you have it completely backwards. The CLI and the typical Unix-like commands existed way before DOS, and will continue to exist way after Windows ceases to be an OS IMO.
 
The following users thanked this post: GlennSprigg

Offline hazeanderson

  • Newbie
  • Posts: 9
  • Country: us
(Advanced Programming in the UNIX Env.) Re: 'Linux'... First Introduction !!
« Reply #10 on: December 17, 2019, 04:44:26 pm »
For what it is worth I am currently learning Electrical Engineering and one of my main sources is the ubiquitous Art of Electronics. If I could recommend a comparable book for learning *NIX it would be "Advanced Programming in the UNIX Environment" (APUE) by the late and great W. Richard Stevens. I even recommend sticking with the 1st edition from 1992 simply because it was a MAGICAL time for this stuff. http://www.kohala.com/start/apue.html (You can get a used hardback copy for under $10!)

And just like AoE, this book is not designed to be "easy to comprehend" -- conversely, just like AoE, everything in the book is spot on, well covered and everything you need to start your experiments with. If you can make it through this book you will understand: file systems, managing user accounts, managing processes, signal handling, everything about I/O, IPC, and terminals. And at the end you will have inadvertently become an expert C programmer.

This is a serious book for those who are serious about learning this stuff.
« Last Edit: December 17, 2019, 04:46:25 pm by hazeanderson »
 

Online T3sl4co1l

  • Super Contributor
  • ***
  • Posts: 22022
  • Country: us
  • Expert, Analog Electronics, PCB Layout, EMC
    • Seven Transistor Labs
Re: 'Linux'... First Introduction !!
« Reply #11 on: December 17, 2019, 05:55:22 pm »
Point of trivia, "dir" works in cygwin.  This is an open source Linux-compatible environment (I suppose the aforementioned WSL serves much the same purpose in W10).

Tim
Seven Transistor Labs, LLC
Electronic design, from concept to prototype.
Bringing a project to life?  Send me a message!
 

Offline Simon

  • Global Moderator
  • *****
  • Posts: 17884
  • Country: gb
  • Did that just blow up? No? might work after all !!
    • Simon's Electronics
Re: 'Linux'... First Introduction !!
« Reply #12 on: December 17, 2019, 06:25:16 pm »
I also suspect there is an amount of snobbery wit the developers about not having graphical settings. The settings in the GUI have increased but it would seem that to use linux to the full you need to commit a load of stuff to memory which is perhaps why windows drew ahead as it always strived to be idiot proof.
 
The following users thanked this post: GlennSprigg

Offline ebclr

  • Super Contributor
  • ***
  • Posts: 2329
  • Country: 00
Re: 'Linux'... First Introduction !!
« Reply #13 on: December 17, 2019, 07:06:25 pm »
You don't need a virtual machine, just  install Microsoft free windows subsystem for Linux, and you have a ready Linux very easy, just type bash on the command com and you are there
 

Offline eugenenine

  • Frequent Contributor
  • **
  • Posts: 865
  • Country: us
Re: 'Linux'... First Introduction !!
« Reply #14 on: December 18, 2019, 12:27:26 am »
I also suspect there is an amount of snobbery wit the developers about not having graphical settings. The settings in the GUI have increased but it would seem that to use linux to the full you need to commit a load of stuff to memory which is perhaps why windows drew ahead as it always strived to be idiot proof.

You can do pretty much anything in the GUI in a modern Linux DE, its just faster to do things on the command line, as well as easier to repeat things or automate things.
 

Offline rx8pilot

  • Super Contributor
  • ***
  • Posts: 3639
  • Country: us
  • If you want more money, be more valuable.
Re: 'Linux'... First Introduction !!
« Reply #15 on: December 18, 2019, 01:25:40 am »
This is a fun thread.

I grew up in the pre-DOS era so I have experienced quite a few OS's over the decades. Because of the work I do, my professional experience has been dominated by MACOS and WINDOWS where I have been forced to learn and function at fairly low levels - lots of command line.

Until recently, I had little need for Linux. That changed dramatically with my latest endeavors in industrial automation. All of a sudden, I find myself playing ultra-rapid-catch-up in Linux :-)

I knew the learning curve would be something like drinking from a fire hose, but so far I LOVE LINUX. I love it at the low gritty levels running headless SBC's all the way to the consumer oriented Linux Mint. Translating my DOS and Windows skills is a major punch in the gut, but I believe it is worth it.

The most fun so far are my growing Pi based projects that definitely put Linux front and center. I have converted a lot of older PC hardware to Linux machines that breathed all sorts of new life into them. Those exercises forced me to learn a lot about industrial level file sharing and networking. Fun stuff. Windows ALWAYS needs heavy hardware. Linux can run on nearly anything and do it well.
Factory400 - the worlds smallest factory. https://www.youtube.com/c/Factory400
 
The following users thanked this post: Zucca, GlennSprigg

Offline Nusa

  • Super Contributor
  • ***
  • Posts: 2417
  • Country: us
Re: 'Linux'... First Introduction !!
« Reply #16 on: December 18, 2019, 01:33:00 am »
Point of trivia, "dir" works in cygwin.  This is an open source Linux-compatible environment (I suppose the aforementioned WSL serves much the same purpose in W10).

Tim

True, but it's just an alternate name copy of "ls". None of the windows / options work with it, but all of the ls - or -- options do.
 

Offline Leiothrix

  • Regular Contributor
  • *
  • Posts: 105
  • Country: au
Re: 'Linux'... First Introduction !!
« Reply #17 on: December 18, 2019, 02:40:59 am »
True, but it's just an alternate name copy of "ls". None of the windows / options work with it, but all of the ls - or -- options do.

On the other hand "ls" works just fine from powershell.  It is an alias of Get-ChildItem, so none of the standard Windows or Linux options work with it.

 

Offline hazeanderson

  • Newbie
  • Posts: 9
  • Country: us
Re: 'Linux'... First Introduction !!
« Reply #18 on: December 18, 2019, 04:33:13 am »
consider this bare bones C implementation of ls  :popcorn:


#include   <sys/types.h>
#include   <dirent.h>
#include   "ourhdr.h"

int
main(int argc, char *argv[])
{
   DIR            *dp;
   struct dirent   *dirp;

   if (argc != 2)
      err_quit("a single argument (the directory name) is required");

   if ( (dp = opendir(argv[1])) == NULL)
      err_sys("can't open %s", argv[1]);

   while ( (dirp = readdir(dp)) != NULL)
      printf("%s\n", dirp->d_name);

   closedir(dp);
   exit(0);
}
 

Offline bsfeechannel

  • Super Contributor
  • ***
  • Posts: 1667
  • Country: 00
Re: 'Linux'... First Introduction !!
« Reply #19 on: December 18, 2019, 04:37:10 am »

$ whereis dir
dir: /bin/dir /usr/share/man/man1/dir.1.gz /usr/share/info/dir.old /usr/share/info/dir
$ mkdir somedir
$ cd somedir
$ touch file1 file2 file3
$ dir
file1  file2  file3
$ ls
file1  file2  file3

 

Online BravoV

  • Super Contributor
  • ***
  • Posts: 7549
  • Country: 00
  • +++ ATH1
Re: 'Linux'... First Introduction !!
« Reply #20 on: December 18, 2019, 04:49:05 am »
I've been a 'DOS/Windows' man all my life! ....

But why did they seemingly have to "re-invent the wheel" ?  Basically, it's like going back to 'DOS',
which I'm very familiar with, although I can understand that for a lot of young people today is foreign.
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 set your knowledge of history right, Unix was invented and released at early 70s, while DOS was introduced in 1981, almost 2 decades later.

Hence the command "ls" as in "list" is older than the "dir" and others that you're familiar with, not the other way around you're believing.

Regarding shorten word command, why not use complete word of "directory" instead of "dir", its much more human readable right ?

I bet you will agree based on your own argument.

Online T3sl4co1l

  • Super Contributor
  • ***
  • Posts: 22022
  • Country: us
  • Expert, Analog Electronics, PCB Layout, EMC
    • Seven Transistor Labs
Re: 'Linux'... First Introduction !!
« Reply #21 on: December 18, 2019, 06:11:15 am »
DOS came from a CP/M background, which in turn came from a Digital Research background (e.g. on the PDP machines).

Microsoft also dabbled in *nix at the time (Xenix) so adopted some conventions but didn't take the full stack.  Hence(?) the more limited form of shell syntax (limited piping) and commands (MORE is less, but, well, less).  Probably partly by necessity, as DOS ran on much more limited systems, too (8086, no MMU, some down to 64k RAM).

Tim
Seven Transistor Labs, LLC
Electronic design, from concept to prototype.
Bringing a project to life?  Send me a message!
 

Offline Jeroen3

  • Super Contributor
  • ***
  • Posts: 4092
  • Country: nl
  • Embedded Engineer
    • jeroen3.nl
Re: 'Linux'... First Introduction !!
« Reply #22 on: December 18, 2019, 07:08: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.
 

Offline blacksheeplogic

  • Frequent Contributor
  • **
  • Posts: 532
  • Country: nz
Re: 'Linux'... First Introduction !!
« Reply #23 on: December 18, 2019, 07:10:16 am »
I've been a 'DOS/Windows' man all my life! ....

But why did they seemingly have to "re-invent the wheel" ?  Basically, it's like going back to 'DOS',
which I'm very familiar with, although I can understand that for a lot of young people today is foreign.
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 set your knowledge of history right, Unix was invented and released at early 70s, while DOS was introduced in 1981, almost 2 decades later.

Operating systems are complex
Computers need an operating system
DOS is an operating system
Therefore computers were invented to run DOS


But, I think it could also be reasoned from the OP's point of view:
I only know DOS, therefore DOS.

Either way, the moon landings never happened.

 

Offline blacksheeplogic

  • Frequent Contributor
  • **
  • Posts: 532
  • Country: nz
Re: 'Linux'... First Introduction !!
« Reply #24 on: December 18, 2019, 07:14:52 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.
« Last Edit: December 18, 2019, 07:18:45 am by blacksheeplogic »
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf