Introduction:
Linux you say what is Linux? Alright, I know how I will begin. A long time ago in the mid 70's at Bell Laboratories, Murry Hill, New Jersey, a two guys came up with Unix. They were: Denis Ritchie and Ken Thompson. Here is a little film which explains it.
This was the eureka moment for computing. At that time the world changed. You see everything up to then was done in what is known a fixed length records. You sat and punched you cards and then took them to the "Computer Room" and gave them your cards. Hopefully you did not have any errors, or you had to fix the problem, and then go back to the "Computer Room". Unix is device independent. You know in Dos/Windows (1983/5) you used to have to install your printer through your program? And then to print your document you first have to open the program to get to the printer. Well, that's gone!So to print a document/file pick it up and drag it to your local printer icon (should be on your desktop), and it asks how many copies and which printer to print it on. This printer could be in your office out in the hall, or on the other side of the world. The reason is Unix, programs write, read to Standard I/O. And all files are just that files there are no special files like the directories. There just normal files.
Now you may be asking; what does Unix have to do with Linux? Well, Unix came first. If you wanted it you had to go to Bell Labs and get a license sometimes in source and build it yourself. Unix was mostly in colleges and university's. Some folks like Sun Microsystems bought the source license and built SunOS (1981) and then Solaris (1993). Richard Stallman (1981-85) Created GNU. Berkley University came out with BSD. And a guy named Andrew S. Tanenbaum created MINIX at Vrije Universiteit in Amsterdam to exemplify the principles conveyed in his textbook, Operating Systems: Design and Implementation (1987). This book also contained abut 12k lines of source.
Now comes another guy (1991) a Finnish student Linus Torvalds created a new kernel and called it Linux. So in a way you could call Linux, a child and Unix the parent. This makes my head hurt, I'll let you strain you eyes and you head.
In the video, they said two things; small programs (utilities), do the work and make life easier. Since they read and write to standard input and output. This means that one program's output to another program's input, you can chain as many programs as you like to get the job done. This is called a pipe ( | [symbol]). Unix and Linux are multi-treaded out of the box, the other feature is redirection in windows you might have used dir > filename, but in Unix/Linux we have standard I/O so you could do this: filename > program > filename.
In Windows you have shortcuts.. we have something much better, we have link & ulink lets say I use a directory that is not in my home directory what you can make a "Symbolic Link": ln -s target directory local-name. So link is ln and ulink is the unlink command.
One more thing Unix/Link we think of our hard drives (/dev/sda) separately from the data. If you had a second hard drive (/dev/sdb). One more thing a hard drive has partitions they are numbered 1, 2, 3 etc. So your drive would be defined has /dev/sdb4 (second drive, fourth partition.
Now to volumes, a volume is just a logical group of files, this can be more than one partition and multiple drives. Food For Thought:
(long version with both -al options) harrison@Whirlwind ~ $ ls -al /mnt/MyData/user/harrison > /home/harrison/mnt_directory.txt total 48 | ||||||||
drwx------ | 9 | harrison | harrison | 4096 | Jul 25 21:26 | . | ||
drwxr-xr-x | 5 | root | root | 4096 | Jul 25 20:58 | .. | ||
drwx------ | 3 | harrison | harrison | 4096 | Apr 5 16:23 | export | ||
drwxr-xr-x | 4 | harrison | harrison | 4096 | Jul 26 11:52 | home | ||
drwx------ | 2 | harrison | harrison | 4096 | Jul 28 14:12 | ISO | ||
drwx------ | 2 | root | root | 16384 | Mar 14 10:00 | Lost+found | ||
drwx------ | 30 | harrison | harrison | 4096 | Jul 29 08:20 | public | ||
drwx------ | 4 | harrison | harrison | 4096 | Feb 13 2015 | SOFTWARE | ||
drwx------ | 7 | harrison | harrison | 4096 | Jun 28 2014 | Zotero_Data | ||
(short version without arguments) export home ISO lost+found public SOFTWARE Zotero_Data | ||||||||
Now after the first command was issued and you did a ls here is what you will have: export home ISO lost+found public SOFTWARE Zotero_Data mnt_directory.txt |
The alphabet soup in front of the files are as follows:
|
Now I will take apart the long command piece by piece.
- Green you have the username@machine_name.
- Blue you have the user prompt.
- The ls command with options (-al) a is all files, and l is long
- The commands target /mnt/MyData/user/harrison
- Redirect the output and create a new file.
OK, just one more thing while we are talking about the ls command. Unix/Linux always knows where the current directory is, so if you issue a ls without any options or target. It would list the current directory. So guess what when you get confused you can alway ask for it. This command is pwd or print working directory.
Stay Tuned More To Come
Top Comments