MSDOS Vs. Unix/Posix
M kids11 here. Today, this is going to be a brief Das vers Unix video. Um, let's get started by showing you a few DOS things.
Right now, I have my Windows ME box right here. Its screen is displayed on my screen. Windows ME happens to be based on DOS, and right now I am running a DOS prompt. So, the DOS prompt is DOS.
Okay, so DOS is, uh, a Microsoft operating system. Um, that Microsoft worked very hard on, that um, is pretty simple. You can only really have one program running at once, and the, uh, file system and the boot scripts and everything are pretty simple.
So, um, first of all, the DOS prompt has a CD by default. So you can CD the backslash, um, and that'll take me to my C drive. Um, if you have another drive, um, instead of um, everything being in slash, everything is in either C colon or any other letter colon. Um, so you can type like H colon to go to an H drive, like, then hit enter. Of course, I don't have an H drive, um, but you can do whatever you really want to with that.
Um, so I'm just going to type um, a few commands and show you how to do stuff. Um, the dir
is the equivalent of ls
. It will display everything. d/s
is the equivalent of ls -lR
or just ls -lR
. And then I'm already in C, so it'll display everything on my C drive.
Um, this is a pretty slow connection to my computer, so you might not see anything really, really decent. So that's a nice thing, like I've just done. You type cls
to clear the screen. Um, of course, it's still CD
. Um, you can make DIR
instead of CP
or MV
to move or copy. It spells it out okay.
So I'll just show you one more thing. There's a word processor called EDIT
which can edit text files. So I can edit, um, let's edit autoexec.bat
. autoexec.bat
gets run when the computer starts up, so anything in there gets run right away.
So, um, here you see, um, my autoexec.bat
file is empty. You have to use the normal keys to do this; you can use the arrow keys to go down to exit. EDIT
is a nice little text editor, just click X.
Okay, um, so you can also pipe. There is a way to pipe, um, I'll just pipe this into more
. There is no grep
. The only real pipy thing I know is, um, more
. So you can edit. It's actually autoexec.bat
. Oh, and the um, file system in DOS is not case sensitive. So, um, anything you type, like any files you type, any commands are not case sensitive. No files are case sensitive. Um, nothing's really case sensitive.
You do need file extensions. This is based on file extensions, so you can see, um, this, uh, starts up command. So this is my autoexec.bat
. You can add stuff to there like I can add rm -rf /sl
, except that's not a command. And DEL
is the equivalent of um, RM
in Windows.
So, um, you can go to any other drive by typing, you know, the letter in a colon. Um, in DOS you can just, um, let me just show you everything's pretty much the same, otherwise. Um, so one program running at once, um, no exceptions. Ctrl+C
normally closes a program; if it doesn't, you're screwed.
Um, back when they had DOS, there was no real command to shut down because DOS was around before Unix was DOS. Um, you just basically, um, uh, basically just quit out of the program you were running and then plug the computer or flip the switch off. Depends how old the computer is. Um, whether it has a nice switch or if it's so old you just have to unplug it.
Um, but anyway, so that's um, nice convenience of um, DOS. So, like I said, nothing's case sensitive, file extensions are everything. Can't go without file extensions like you need file extensions; they're what tells the computer how a file is unlike in Unix.
Um, you have different types of files like executables, directories, regular files, streams, uh, sticky bit, all the other types of files. Um, so that's a little DOS for you. Um, so now I'll go into the Unix side. I'll just open Terminal, the access point through a Mac to Unix.
On Unix, of course, ls
works, um, and un next all the commands instead of just being in C. Back SL wrong in your path. So if you type um, echo $
left curly brace PATH
right curly brace, it'll show you everywhere it looks for commands: /usr/bin /usr/sbin /sbin /usr/local/bin /usr/X11/bin
.
You can also, um, add stuff to your path if you would like, um, but I'm going to Windows, it's just one specific place. Okay, so we can um, CD
to /
. Everything comes off of /
. That's what everyone loves about Unix, that I know who everyone, who loves Unix, loves it and enjoys this sensation: everything's on /
.
If you plug in another hard drive like say I have a thumb drive and I plug it in, it'll get mounted to somewhere. Um, when it gets mounted, it looks like a directory on the computer just like I mounted macad101.com
. I can see what's on the website.
So I mounted this on Unix. Startup files can be anywhere in /etc
, in /etc/init.d
. Like, I can go to /etc/init.d
. Like, there are a bunch of startup files that get run on the computer when you start up. And you can have as many as you want. It's not just one file that executes line by line; you can have as many shell scripts as you want because much more happens on Unix since you can have as many processes running as you want.
Of course, on Unix there are also users, so there's a password file and everything. The users are nice — nice, great thing. I'm sure most of you know what users are. Um, on DOS there are no users; DOS is one user. It's really into here.
Yeah, with Unix, each user, there's a config file that says all the user's home folders, everything on a user. Um, and you can have groups and certain groups can have certain permissions. Oh, file permissions on Unix, of course, you can set file permissions so that specific people can read, write, execute it. And the user owns a file, and files are either executable, regular files, or directories.
Um, okay, so that's just um, another security thing. I'll have to say the thing with that is even if you set file permission, someone can just steal your hard drive and read your files, but whatever. There are a lot more things that automatically come with it like all, most of the home directories are in one place like /users
or wherever.
Um, you can um, do ls -lR
. ls
comes with it. Um, there, instead of um, a command being like um, d/s
, it's ds -r
. So, um, like instead of slashes it's dashes. Um, because slashes make up the file system on Unix.
It's always /something
. sl
something on DOS, it's Drive: \
and then all the crud. And that's kind of annoying. Whenever you plug in a device, it goes to another drive letter, and you can't have more than, you know, 26 devices plugged into your computer. That's too bad.
So, yeah, um, you can do a lot of things on this Unix. Like, there are just a lot more options. It's um, it's more modern. Like, there's a shutdown command, a halt command which just literally dumps everything. It just goes to hell, so that might not be the best idea, but whatever.
So that, that's just um, Unix versus DOS. Of course, with Unix, the file system is um, case sensitive. I'd say say you can't really compare these two against each other because one of them's from long before the um, Unix, like DOS came way before Unix, and DOS left.
Um, DOS has already left; I think that Unix will end up taking over the world. There's one DOS; there are hundreds of Unix's out there: Linux, you know, any Unix thing. And of course, DOS made by Microsoft.
And, yeah, so um, anyway, that's um, like a brief um, insight of DOS versus Unix. Um, nothing really, um, bad about either of them. It's just that DOS is less modern and less secure. That was really before people worried about security.
Um, but anyway, thank you for watching, M kids. Um, and goodbye.