Table of Contents

unix Keywords

  1. The UNIX Shell (done)
  2. Environment variable (done)
  3. $PATH (done)
  4. wildcards (done)
  5. tab completion (done)
  6. Job Control (done)
  7. The UNIX Programming Environment 9done)
  8. Compiler, Assembler, Linker, Loader (done)

unix Keyword 9

The UNIX Shell

Definition

The Unix Shell is basically a command line interpreter. This is also called a shell that gives the used and interface. The user is able to use the cell to run programs, tweak setting and many other uses. There are two main shells the Bourne shell and the C shell.

Demonstration

Example of a linux shell

unix Keyword 10

Environment variable

Definition

Environment variables are a set of named values that impact running programs and process. They set the stage for the operating environment. These variables are stored as temporary setting files. The stored values can be change but are typically established when the system starts. Tweaking these value give you control over things like your logname, mail server, pager or where your home file is.

Demonstration

lab46:~$ env EDITOR=nano
TERM=xterm
SHELL=/bin/bash
SSH_CLIENT=24.94.52.91 56204 22
SSH_TTY=/dev/pts/90
USER=skinney1
LS_COLORS=rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd                                          =40;33;01:or=40;31;01:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=0                                          1;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.lzma=01;31:*.                                          tlz=01;31:*.txz=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.lz                                          =01;31:*.xz=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.d                                          eb=01;31:*.rpm=01;31:*.jar=01;31:*.rar=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;3                                          1:*.7z=01;31:*.rz=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=0                                          1;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.t                                          iff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;                                          35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.ogm=01;35:*.mp4=01;35:*.m4                                          v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:                                          *.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;                                          35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.axv=                                          01;35:*.anx=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.                                          mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;3                                          6:*.wav=00;36:*.axa=00;36:*.oga=00;36:*.spx=00;36:*.xspf=00;36:
MAIL=/home/skinney1/Maildir
PATH=/home/skinney1/bin:/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/games
LC_COLLATE=C
PWD=/home/skinney1
LANG=en_US
HISTCONTROL=ignoreboth
SHLVL=1
HOME=/home/skinney1
LOGNAME=skinney1
SSH_CONNECTION=24.94.52.91 56204 10.80.2.38 22
_=/usr/bin/env
EDITOR=nano

unix Keyword 11

$PATH

Definition

PATH is the environmental variable that is a list of files that my shell accesses, searches through, read/writes etc.

You are able to edit your path by using a PATH= command. This is highly recommended only at the administrator level. The example i found shows PATH=$PATH\:/dir/path ; export PATH

Demonstration

lab46:~$ $PATH
-bash: /home/skinney1/bin:/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/games: No such file or directory
lab46:~$

unix Keyword 12

wildcards

Definition

A wildcard is basically a value that fills in as a include all value. The computer sees the wildcard as meaning it could be any value holding to what ever part is placed with it. For example a search for “*XYZ” will come back with all items that matches the XYZ at the end.

There are a few different types of wildacards; ? Matches any one character in a filename. * Matches any character or characters in a filename. [ ] Matches one of the characters included inside the [ ] symbols.

Demonstration

Example of a * wildcard search

 lab46:~/junk$ find de*
dem1.c
dem1.out
dem2.c
dem2.out
dem3.c
dem3.out
dem4.c
dem4.out

unix Keyword 13

Tab completion

Definition

Tab completion directs the shell to search the current directory and auto fill in the remainder of the name.

Demonstration

The example shows the contents of a file and the result of tab filling in the remainder of the content. The only trick with using tab completion is if there are multiple files that meet what you have entered then it will do nothing.

 lab46:~/src/cprog/classproject$ ls
6           char.out       encipherexample.c   hint1.out        script1.sh
7           cipher.txt     encipherexample1.c  message.in       script2.c
Suzy.c      color.sh       encipherexample2.c  ob1              test1.c
a.out       count.sh       encrpit.out         proj0.c          typec.c
age.sh      cprog2.c       enter.txt           project1.c       typec.out
backup.sh   date           excipherexample3.c  project1.c.save  typecast.c
bignum.c    encipher.c     exit.txt            rand.sh          typecast.out
bignum.out  encipher.out   func.c              range            var.c
bignum1.c   encipher1.c    hint1.c             range.c          var.out
char.c      encipher1.out  hint1.c.save        range.out
lab46:~/src/cprog/classproject$ ls cprog2.c

unix Keyword 14

Job Control

Definition

Job control is the ability to send running programs to the background within a shell. This can be beneficial when doing a large search quarry or when you need to do another element of a larger task. This is controlled by a list that the shell keeps that logs what is being done. This allows it to keep track of what processes are being run within the group. The

Demonstration

lab46:~$ top $

lab46:~$ % bg
top
top - 11:59:47 up 72 days, 19:20,  7 users,  load average: 0.00, 0.00, 0.00
Tasks: 329 total,   1 running, 328 sleeping,   0 stopped,   0 zombie
Cpu(s):  0.0%us,  0.2%sy,  0.0%ni, 99.8%id,  0.0%wa,  0.0%hi,  0.0%si,  0.0%st
Mem:   1568604k total,  1314012k used,   254592k free,   216856k buffers
Swap:   524280k total,    98664k used,   425616k free,   467392k cached

  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
17843 skinney1  38  18 11000 1432  932 R    1  0.1   0:00.08 top
    1 root      20   0  8356  700  592 S    0  0.0   0:50.92 init
    2 root      20   0     0    0    0 S    0  0.0   0:00.30 kthreadd
    3 root      RT   0     0    0    0 S    0  0.0   0:06.00 migration/0
    4 root      20   0     0    0    0 S    0  0.0   0:11.50 ksoftirqd/0
    5 root      RT   0     0    0    0 S    0  0.0   0:00.00 watchdog/0
    6 root      RT   0     0    0    0 S    0  0.0   0:05.07 migration/1
    7 root      20   0     0    0    0 S    0  0.0   0:04.58 ksoftirqd/1

unix Keyword 15

The UNIX Programming Environment

Definition

Demonstration

Demonstration of the chosen keyword.

If you wish to aid your definition with a code sample, you can do so by using a wiki code block, an example follows:

/*
 * Sample code block
 */
#include <stdio.h>
 
int main()
{
    return(0);
}

Alternatively (or additionally), if you want to demonstrate something on the command-line, you can do so as follows:

lab46:~$ cd src
lab46:~/src$ gcc -o hello hello.c
lab46:~/src$ ./hello
Hello, World!
lab46:~/src$ 

unix Keyword 16

Compiler, Assembler, Linker, Loader

Definition

Compiler The compiler translate high-level languages programs into assembly language.

Assembler

The assembler converts assembly language into object files. These contain a combination of machine instructions. They also convert decimal numbers in to programmer binary.

Linker

The linker merges the object files and creates the executable file. It has basically three tasks; searched the program to find routines, determine memory locations and resolves reference among the files.

Loader

The loader is the part of the OS that takes the executable file and brings it out in the open and starts running it.

Demonstration

Source file => Assembler => Object File \
Source file => Assembler => Object File  ---> Linker ---> Executable File
Source file => Assembler => Object File /       |
                                              library

unix Objective

unix Objective

Connect to the lab46 server via my Droid phone.

Definition & Method

Explore the options available, install and connect.

Measurement

There are many apps and programs that allow you to connect to a server. ConnectBot, Better Terminal Emulator, Irssi ConnectBot and the list goes on. I am going to attempt the connection by using a method that stays as close to the command line as i can.

Analysis

The simplest way to connect was found with Irssi's droid app. The connection is simply added as name@lab46.corning-cc.edu:22 and off you go. The method i was after was using the typically built in Unix SSH program. This was not possible to achieve. Being Unix, on a rooted droid one should be able to download the SSH program and be off and running. I left it with what worked. Connecting with other methods seemed to be and annoying task.

Resource List

Mission accomplished. I would still like to find a way to install the basic SSH program.