www.RogerWendell.com
Roger J. Wendell
Defending 3.8 Billion Years of Organic EvolutionSM
Line

 

Unix Logo UNIX, Linux,
and Raspberry Pi

 

 

Arrow Pointing Right Click Here for my main computer page...
Arrow Pointing Right Click Here for my PERL page...

 

Wirth's Law:    "Software is getting slower more rapidly than hardware becomes faster."

 

Line

 

UNIX
(UNiplexed Information and Computing System - originally spelled "Unics")

"When Ken Thompson and Dennis Ritchie first wrote Unix at AT&T Bell Labs [1969], it was for their own use and for their friends and coworkers. Utility programs were added by various people as they had problems to solve. Because Bell Labs wasn't in the computer business, source code was given out to universities for a nominal fee. brilliant reserachers wrote their own software and added it to Unix in a spree of creative anarchy, which has been equaled only with Linus, in the introduction of the W Widnow System, and especially the blend of Mac and Unix with Darwin included in Mac OS X."

- Shelley Powers, Jerry Peek and Mike Loukides in O'Reilly's UNIX Power Tools, 3rd ed., p.3.

 

Open Source and Linux

"If you haven't heard of Linux yet, you need to read the newspaper a little more often! Linus Torvalds, while a student, expressed his frustration over the high cost of most versions of UNIX by building his own. What makes this story special is that Torvalds licensed his UNIX clone, dubbed Linux, in a unique way. Linux is an open source operating system, distributed under the terms of the GNU General Public License (GPL), which means (among other things) that anyone who purchases a copy receives full access to it source code, the building blocks of the operating system. Free access to the source code gives software developers the power to modify the operating system to meet their needs. This has led to the rapid development of a wide variety of applications, including some of the most commonly used web and e-mail servers on the Internet. In most cases, both the Linux operating system and Linux applications are available for free download from the Internt, although vendors like SuSE and Caldera sell boxed versions, and charge for support services. For all intents and purposes, Linux is a full featured clone of UNIX."

- Mike Meyers (2004)
Managing and Troubleshooting Networks, p. 303

 

Some basic UNIX Commands and Definitions:

  • . = current directory
  • . = hides file when in front of file name
  • * = substitution - matches zero or more characters
  • # = remark line
  • ? = matches exactly one character
  • / = Root Directory
  • | = pipe = connects two commands together
  • > = redirection
  • >> = causes standard output to be appended to the specified file
  • ^ = caret
  • = Escape
  • = End of File
  • bash = Bourne Again Shell
  • bg = run in background
  • cat = concatenate = displays contents of a file
  • cd = change your current directory
  • cd .. = Move Back One Directory
  • cd / = Change Directory to Root
  • chmod = change permissions:
    • owner/group/others
    • -rwxrwxrwx = all three can read, write and execute
    • example = chmod 700 test.txt = -rwx------ test.txt
  • cp = to make a copy of a file
  • cut = used to extract data from a file (kind of opposite "paste")
  • date = diplays date and time
  • diff = finds differences between files
  • echo = prints whatever you happen to type on the line
  • ed - editor with similar commands to "sed" and "vi"
  • find = descends the directory tree and locates files
  • fg = run in background
  • ftp = file transfer protocal
  • grep = searches files for various patterns:
    • grep -l = lists file names without data
    • grep -n = line number
    • grep -v = invert
    • example = grep ^-v[0-9][0-9]-[0-9] file.txt
    • !grep = re execute most recent grep command
  • history = most recently run commands
  • ln = linking a file so that it has more than one name
  • ls = Directory Contents
  • ls -a = also shows hidden files
  • ls -l = shows permissions
  • man = format and display the on-line manual pages
  • manpath = determine user's search path for man pages
  • Metacharacters = are a group of characters that have special meanings to the UNIX operating system:
    • * = A wild card character that matches any group of characters of any length
    • ? = A wild card character that matches any single character
    • [ab] = match a or b
    • $ = inidcates the following text is the name of a shell variable
    • \ = Used to "quote" the following metacharacter so it is treated as a plain character, as in \*
    • mkdir = Make Directory
    • mv = renaming a file - also used to move a file
  • paste = can bring two files together (kind of opposite "cut" command)
  • ps = processes running on the system:
    • PID = the process
    • TTY = terminal number
    • TIME = Amount of computer time
    • COMMAND = the name of the process
  • pico = UNIX text editor
  • ping = talk to another machine
  • pine = Program for Internet News & Email
  • pipe = the "|" symbol, allows you to take the output of one command and feed it directly into the input of another command
  • PuTTy = Telnet/SSH Client
  • pwd = present working directory (where am I?)
  • Regular Expressions = provide a consistent way of specifying patterns:
    • . = any character - example "a.."
    • ^ = beginning of line - example "^fred"
    • $ = end of line
    • * = zero or more occurrences
  • rm = remove a file
  • rmdir = remove directory (doesn't work if there are files in directory)
  • rm -r = removes directory and all its files - BE CAREFUL!
  • Script is a file with an execution capability
  • sed = stream editor (commands similar to "ed" and "vi")
  • sh = Shell - the program to talk to UNIX
  • sort = sort lines of file
  • ssh - Secure Shell (because Telnet is unsecure)
  • Standard Input = the place commands normally read their input from (usually your terminal/keyborad by default)
  • Standard Output = the place commands normally write their outputs (usually your terminal/monitor by default)
  • Standard Error = the place most UNIX commands write their error messages
  • TAB once = completes file name
  • TAB twice = completes extension
  • TCP/IP = Transmission Control Protocol/Internet Protocol (it's built into UNIX and is the standard data transmission method for networks and the Internet)
  • Telnet = Terminal Emulation - It's not secure, see ssh
  • touch = creates a file
  • tr = translate or character for character exchange (uses "<" to bring data into it)
  • tty = port
  • u = UNIX
  • UNIX Kernel = Operating System
  • vi = UNIX editor (commands similar to "ed" and "sed")
  • wc = word count
  • who = users currently logged on
  • xv = view

 

RAW's COmputer Foot in Japan Some UNIX related links:

 

USE THE BEST

Linux for servers

Macintosh for graphics

Palm for mobility

Windows for solitaire

 

Some vi Commands:

  • $vi filename = starts the editing session
  • i = Insert - gets you into the editor
  • = back to command line
  • ZZ = Exits vi and saves changes
  • :w = writes current file
  • :wq = Writes changes to current file and quits edit session
  • :q! = Quits edit session (no changes made)
  • h = back
  • j = down
  • k = up
  • l = right
  • <number> = goes to that line
  • $ = End of file
  • a = append
  • x = Deletes current character
  • dd = Deletes current line
  • dw = Deletes the current word
  • d) = Deletes the rest of the current sentence
  • D, d$ = Deletes from cursor to end of line
  • P = Puts back text from the previous delete
  • yy = Puts the current line in a buffer. Does not delete the line from its current position.
  • p = Places the line in the buffer after the current position of the cursor.
  • $ = End of file
  • u = undo last command
  • x = Deletes current character
  • YY = Puts the current line in a buffer. Does not delete the line from its current position.

 

Other Reference Materials:

 

Line

 

Unix Permissions


Once you've logged into your Unix account, and are at the Unix prompt,
you can enter the command ls -l to see a list of the files in your home
directory. The directory listing will look something like this:
total 3960
-rw-r--r--   1 e-zeek   usr       123339 Jun  8 10:41 getstats_12.c
-rwx------   1 e-zeek   usr       103316 Jul 16 00:04 hexpert
-rw-------   1 e-zeek   usr        32768 Jul 16 00:03 hexpert.tar
-rwx------   1 e-zeek   usr        10056 Sep 26 18:46 htpasswd
drwx------   6 e-zeek   usr          512 May  4 12:31 java
-rw-------   1 e-zeek   usr        22768 Oct  4 17:32 siggraph.jpg
-rw-------   1 e-zeek   usr      1312180 Sep 28 11:53 siggraph.tiff
-rw-------   1 e-zeek   usr       373760 Aug 30 20:27 unz512x.tar
Here's a breakdown of what the information in these lines mean.
The part on the left looks like this:

The character at the far left tells you what kind of file this item is. If it is a dash "-" then that means it is a normal file. If it is a "d" that that means it is a directory (folder). There are other characters but those are the two most important ones.

After the character on the far left there are three groups of three characters. These groups indicate the permissions of the file or directory. Permissions determine who can read from the file or write to the file. The "r" means read permission, the "w" means write permission, and the "x" means execute permission. A dash "-" means that that permission is not granted.

The first group of the permission bits corresponds to the user's permission i.e., the owner or person who created the file. The second group of permission bits corresponds to the group's permissions. Each file or directory belongs to a group which could be students or usr as in my example above. Anyone who belongs to this group has these permissions for the file. If you'd like to see what groups you belong to, type the command groups.The third group of permission bits corresponds to the world permissions, which are permissions that are granted to everyone.

Continuing on down the line of items, in the above example you'll see e-zeek. This is the username of the owner of the file. This is normally the person who created the file.

Next is the group the file belongs to. In the above example, the files belong to the group usr. After that you'll see the size of the file in bytes. Next is the date and time the file was last modified, and finally the name of the file.

 

Line

 

Unix Commands

There are several Unix commands that you will need to become familiar with.

chmod permissions filename

chmod will change the permission bits of the file or directory.
There are two ways to use chmod. One way is to give it the exact permissions
with the absolute mode. This is essentially a three digit number with the
first digit corresponding to the user's permissions, the second digit is the
group permissions, and the last digit is the world permissions. The values of
the digit correspond in the following way:
0 ---
1 --x
2 -w-
3 -wx
4 r--
5 r-x
6 rw-
7 rwx
So for example, the command:
chmod 664 test.html
would change the permissions of the file test.html to be rw-rw-r--.

The second method of changing permissions is using the symbolic mode. The general format for the symbolic mode is:
who <operator> permission

So, here's some examples:
If the permissions are currently rwx------, then the command:
chmod a+r example.html
will change it so everyone (all) can read it (add). The result would then be rwxr--r--.

If the permissions are currently rwx------, then the command:
chmod u=r another_example.html
will change it so the user can only read it (exact set). The result would then be r--------.

 


 

mkdir

mkdir will make a new directory. The command:
mkdir public_html
will make a new directory public_html as long as you have write access in the current directory.

rm

rm will remove a file. The command:
rm test.html
will remove the file test.html

rmdir

rmdir will remove a directory as long as it is empty. Example:
rmdir test_dir
will remove the directory test_dir

man

man will become your friend. It will grab the manual page for a given command. So for instance:
man ls
will give you the manual page for the command ls. You can use it to learn a lot of advanced information
about a command. Note that some systems do not have all the manual pages installed. You can ask the
administrator to install them, or use another system.

 


 

Permissions for the Web

Now we'll take a look at how permissions affect us on the Web. The first step is understanding the public_html directory. If you are creating a home page, and wish to put it in your home directory, you first need to make a public_html directory in your home directory. For instance, if I wish to access my own home page, whenever I access http://www.rogerwendell.com/unix/~e-zeek/ this will look in my public_html directory for the files. This is a bit of a security feature so that people can look at the other files in your home directory. The command will look like this:
mkdir public_html
The permissions for the public_html should be something like rwx-----x. You can have other permission bits, but this is the minimum that you will need. The command
chmod 701 public_html
will do the trick. It is a popular misconception that you need to change the permissions of your actual home directory, this is not ture!

Another thing to mention is that if you want people to browse through the directory, then you should also make it world readable. The permissions will be rwx---r-x. When I say browse the directory, I mean something like this: Browse. If you click on that link, then you can see what I mean. When you do not have an index.html file, you can browse the directory.

Now you need to regard yourself with the permissions of an HTML document. The only requirement for an HTML document is that the web server can read it. This means that you need to make your file world readable. After changing into your public_html directory like this:
cd public_html
and you create an HTML document with your favorite editor, you can use the command
chmod o+r some_document.html
to set the permissions correctly. Another way to do it is:
chmod 604 some_document.html
This sets it to rw----r--. This is so you can still read and write to the file, and the web server can get the document. We could ramble on this subject for a much longer time, but let's get on to making some HTML documents. If you have more problems or you need some more specific information, don't hesitate to ask someone..

 

Line

 

RSX-11M

Okay, RSX-11M doesn't have much to do with UNIX but I mention it here because it was my first real experience with an operating system not related to Microsoft. In the late 80s I was an Electronics Technician where we were using RSX-11M for process control. I don't remember much about it now, two decades later as I'm adding this entry in 2008, but have fond memories of the huge PDP-11 computers, stacks of platters (discs) and other related equipment that'll be fun to encounter in a museum somewhere!

- Roger J. Wendell

 

Raspberry Pi

In early 2014 I purchased (and experimented with!) my first Raspberry Pi (The Model "B" that you see in these photos).The Raspberry Pi is a series of credit card-sized single-board computers developed in the United Kingdom by the Raspberry Pi Foundation with the intention of promoting the teaching of basic computer science in schools and developing countries. The price, at the time of my purchase, was $35.00 USD for the basic board and model. The original Raspberry Pi and Raspberry Pi 2 were manufactured in several board configurations through licensed manufacturing agreements with Newark element14 (Premier Farnell), RS Components and Egoman. The hardware is the same across all manufacturers. In short, although not nearly as powerful as a "regular" computer, laptop, or smartphone the Raspberry Pi remains a ton of fun that has also had a lot of practical applications in my personal office space and amateur radio shack.
Raspberry Pi B by Roger J. Wendell - 04-11-2014 Raspian install by Roger J. Wendell - 04-11-2014 Raspberry Pi B by Roger J. Wendell - 12-25-2015 Raspberry Pi B by Roger J. Wendell - 12-25-2015

 

Line

 

Links:

  1. 0Spam (Zero Spam)
  2. Annoyances Fixing problems with Microsoft Windows
  3. Anti-Phishing
  4. Arachnophilia - the Paul Lutus CareWare page
  5. Avast - free Anti-Virus
  6. AVG Anti-Virus
  7. Bitmek "Let the power of the Internet work for you!"
  8. Button generator
  9. Button maker by Cool Archive
  10. Central Ops - Free online network utilities
  11. CGI Scripts
  12. Colors in HTML - 16 million of 'em!
  13. Computer History Museum
  14. Computer Stuff - by me!
  15. CrackSpider
  16. Debian - free operating system
  17. Dillo - speedy, small footprint web browser (free!)
  18. DMOZ - Open Directory Project
  19. Drupal
  20. Entity References
  21. Eprompter Free Email Retrieval and Notification
  22. Flaming Text
  23. Foxit - Free pdf viewer
  24. Ghostscript, Gohstview, and GSview
  25. GNOME Project - Free desktop environment
  26. GNU Project - Free Unix-like operating system
  27. HTML Character Reference
  28. HTML Character Set by Walter Ian Kaye
  29. HTML Ordered Lists
  30. Infinite Monkeys Eclectic Software
  31. JavaScript Source - "...an excellent JavaScript resource"
  32. K7 Net Unified Messaging
  33. Keir.net - Robin Keir's software utilites page
  34. Kephyr - Nice software for nice people
  35. Launchpad - services for projects in the open source universe
  36. Libre Office - free office software by the Document Foundation
  37. Lynx text browser
  38. Memory Hole Resucing knowledge, freeing information
  1. Mozilla Foxfire webrowswer (free!)
  2. My Memorizer - A free reminder service!
  3. Nyx - Spirit of the Night (free Unix shell accounts)
  4. Old Version - Because newer is not always better
  5. Open Office
  6. Open Source Initiative
  7. PC Hell
  8. PC Pitstop free automated tests...
  9. Perl - by me!
  10. Perl - The source for Perl
  11. Perl Directory
  12. Pic Search
  13. PGP by me!
  14. Protonic "free fast technical support"
  15. PuTTY - a client program for the SSH, Telnet and Rlogin network protocols
  16. Python programming language
  17. Raspberry Pi - tiny and affordable computers...
  18. RoundCube - open source webmail software
  19. SDF - Super Dimension Fortress (a networked community of free software authors...)
  20. Save This
  21. SD Card Formatter
  22. Softpedia The encyclopedia of free software downloads!
  23. Source Forge - Find and Develop Open Source Software
  24. Special Alt Characters
  25. Spell Checker (Online)
  26. SpyBot Search and Destroy!
  27. TechDirt - government policy, technology and legal issues
  28. Test Page that allows me to test stuff!
  29. Toast Net Connection Performance Test
  30. Unicode Consortium
  31. Ubuntu - UNIX for Humans!
  32. Unix, Linux, and Raspberry Pi - by me!
  33. Validome HTML / XHTML / WML / XML Validator
  34. VideoLAN - a great media player!
  35. W3 World Wide Web Consortium
  36. Wayback Machine - Internet Archive
  37. What's My DNS? - DNS Server Testing Tool
  38. ZamZar - Free online File Conversion

 

Line

 

Back Back to Roger J. Wendell's Home Page...

Web Counter Logo

 

Abbey | About | Blog | Contacting Me | Copyright | Disclaimer | Donate | Guest Book | Home | Links | Site Index | Solutions | Terms, Conditions and Fair Use | What's Changed or New?
Copyright © 1955 -