27
“Dilbert” by, Scott Adams, Sep 30, 1994.

“Dilbert” by, Scott Adams, Sep 30, 1994

  • Upload
    bond

  • View
    35

  • Download
    5

Embed Size (px)

DESCRIPTION

“Dilbert” by, Scott Adams, Sep 30, 1994. Basics of the Unix/Linux Environment. Unix Philosophy and Account Information. Unix Philosophy. According to Doug McIlroy Make each program do one thing well. - PowerPoint PPT Presentation

Citation preview

Page 1: “Dilbert” by, Scott Adams, Sep 30, 1994

“Dilbert” by, Scott Adams, Sep 30, 1994.

Page 2: “Dilbert” by, Scott Adams, Sep 30, 1994

Basics of the Unix/Linux

EnvironmentUnix Philosophy and Account Information

Page 3: “Dilbert” by, Scott Adams, Sep 30, 1994

Unix PhilosophyAccording to Doug McIlroy

Make each program do one thing well.

So, to do a new job, build afresh rather than complicate old programs by adding new features (otherwise known as

“bells and whistles”).

Machine shop vs. appliance (gives you the tools and you to make appliance)

Page 4: “Dilbert” by, Scott Adams, Sep 30, 1994

implications Typical question from you all:

Can UNIX do this?

Typical answer from a professor: NO, but YOU can write a program!

Unix enthusiasts think this is the answer the average user wants to hear!

Page 5: “Dilbert” by, Scott Adams, Sep 30, 1994

Unix put lots of single minded programs in a row (with pipes “|” ) to do what you need.

Don’t use temporary/intermediate files – use pipe

In other words, Unix prefers to take input from previous program and send output to next

program

Page 6: “Dilbert” by, Scott Adams, Sep 30, 1994

Write programs that do one thing and do it well. (lean and mean)

Write programs to work together. (pipes)

Page 7: “Dilbert” by, Scott Adams, Sep 30, 1994

Accessing unix from Sun lab

Sit downIf the screen is dark – hit any key (the shift key is

the “safest” as it does not actually send anything to the computer) or move the mouse to “wake it up”.

Type your CERI/UoM user id (uuid)Type your CERI unix password*Note that unix machines are case sensitive

Page 8: “Dilbert” by, Scott Adams, Sep 30, 1994

The % is the “prompt” from the shell that says it is ready read input. There is also usually a flashing cursor after the prompt.

Commands we will enter are shown in italics.

<CR> is Carriage Return/Enter.

This activity occurs in the terminal window

Page 9: “Dilbert” by, Scott Adams, Sep 30, 1994

User IDUser ID: usually a short derivative of your

name and the beginning of your email. Your CERI and UoM user ids are the same

User ID’s on the UM system can only be a maximum of 8 characters due to the limitations of early computers. Unix is full of such anachronisms.

User ID’s are formed using an algorithm. Take first initial (and maybe middle) and full last name, if that is more than 8 characters, start removing vowels from the back, if still longer than 8 characters, start removing consonants from the back.

Page 10: “Dilbert” by, Scott Adams, Sep 30, 1994

User PasswordsPassword: a complicated combination of upper

and lower case characters, symbols, and numbers that allows access to the account.

Your CERI Unix password is unique to the Sun system

Your UoM Outlook email, Spectrum, Tiger labs, and CERI PC lab password is the same because it is all accessing your primary UoM account.

If you need/use the non-Sun systems (Unix machines in the GPS lab, a faculty member’s Apple, etc.) you will have a unique username/password for each of them.

Page 11: “Dilbert” by, Scott Adams, Sep 30, 1994

PasswordsDo not share your password!!!! Do not leave your password sitting around on

a post-it note.Do not email your password.

If you forget your password, you have to visit the system administrator and (humbly) ask for a new one. There is no way for anyone (except hackers) to figure it out.

Page 12: “Dilbert” by, Scott Adams, Sep 30, 1994

Changing your password Unix passwords can be easily changed using the passwd

command

%passwd

for CERI password changes

%passwd –r nis

Changing password for hdeshonOld password: type in old password

New password: type in new password

Re-type new password: type in new password again

Page 13: “Dilbert” by, Scott Adams, Sep 30, 1994

What not to use for your password:

- Your name, address, phone number, or anything that is common knowledge, or can be easily guessed, about you.

- Common words.

Password guessing programs don’t get tired and can try 1000’s of permutations of passwords based on the above.

Page 14: “Dilbert” by, Scott Adams, Sep 30, 1994

What to use for your password:

- Something you will not forget.- Mix in numbers and special characters (1,

2, 3 , !, @, #, $, %, etc.).- Should be at least 6 characters long (some

systems require longer ones).- (don’t use items from “do not use” list

with “1” substituted for “i”, “0” substituted or “o”, etc., the password guessers will try these.)

Page 15: “Dilbert” by, Scott Adams, Sep 30, 1994

Accessing unix via SSHSSH: secure shell login is the preferred way to

remotely log on to the CERI unix system; do not use telnet

SSH is secure, easy and with X-tunneling enabled, you can view graphics just as if you were sitting at the remote machine

Machines at CERI accept ssh access from all local Internet providers and other CERI and UoM addresses

If you want access from out of town, you will have to send Bob Debula the IP address of the out-of-Memphis computer

Page 16: “Dilbert” by, Scott Adams, Sep 30, 1994

Accessing Suns via SSHMac or Sun machine1: open an X11 or Terminal window2a: mac% ssh -Y [email protected]: sun% ssh -X [email protected]: type CERI unix password at prompt

PC1: open the SSH application from the desktop or applications folder2: enable X11 tunneling via the Settings menu (only do once)3: click on Quick Connect 4: type in CERI host name and uuid, then password at prompt

Page 17: “Dilbert” by, Scott Adams, Sep 30, 1994

Accessing Suns via ExceedThe PCs in the long building have a special

terminal emulator program, called Exceed, for remote ssh access to the unix machines.

Once you choose a unix machine via Exceed, the PC screen looks like the unix terminal and regular unix log-in applies

Directions for Exceed setup can be found at http://www.ceri.memphis.edu/people/mwithers/CERIComputing/Exceed/ss

hexceed.html

Page 18: “Dilbert” by, Scott Adams, Sep 30, 1994

Hierarchical file system which looks like upside down tree

Starts at top with “/”, called “root”.

Uses “/” to separate directories (known as folders on

Apple/Windows)Top Level Directories

Directories

Page 19: “Dilbert” by, Scott Adams, Sep 30, 1994

Home directories

Page 20: “Dilbert” by, Scott Adams, Sep 30, 1994

Up the directory structure or moving backward through the path

Down the directory structure or moving forward in the path

Page 21: “Dilbert” by, Scott Adams, Sep 30, 1994

Moving around directoriespwd: prints path name of current directory

% pwd

%/gaia/home/hdeshon [this is what would appear if I had just logged on]

cd: change directory% cd Projects% cd automatically cd into your home directory% cd ~/bin cd into your-home-directory/bin

Page 22: “Dilbert” by, Scott Adams, Sep 30, 1994

. and ..The “.” signifies the current or working directory

% cd . No change in location

The “..” signifies the directory directly above you (up) in the directory structure (tree)

% cd .. cd back one directory% cd ../../scratch/200GB/hdeshon

cd back two directories then forward three into scratch subdirectory hdeshon

Page 23: “Dilbert” by, Scott Adams, Sep 30, 1994

Listing directory contentsls: lists files and subdirectories of the specified

path% ls /gaia/home/hdeshonbin src suma.new.res% ls list everything in the current directory% ls ~/bin list your-home-directory/bin

Page 24: “Dilbert” by, Scott Adams, Sep 30, 1994

Flags & manual pagesAlmost all unix commands have a list of flags

that can be specified to modify the default behavior

% ls –F -F in this case is one flag option for ls

The potential flags are listed within each command’s manual page

To view a manual page, use the man command% man pwd

Page 25: “Dilbert” by, Scott Adams, Sep 30, 1994

PWD(1) BSD General Commands Manual PWD(1)

NAME

pwd -- return working directory name

SYNOPSIS

pwd [-LP]

DESCRIPTION

pwd writes the absolute pathname of the current working directory to the standard output.

The pwd utility exits 0 on success, and >0 if an error occurs.

The following options are available:

-L Print the logical path to the current working directory, as defined by the shell in the environment vari-

able PWD.

-P Print the physical path to the current working directory, with symbolic links in the path resolved. This is

the default.

STANDARDS

The pwd utility is expected to be IEEE Std 1003.2 (``POSIX.2'') compatible.

SEE ALSO

cd(1), csh(1), getcwd(3)

BUGS

In csh(1) the command dirs is always faster (although it can give a different answer in the rare case that the current directory or a containing directory was moved after the shell descended into it).

4th Berkeley Distribution November 2, 1998 4th Berkeley Distribution

Page 26: “Dilbert” by, Scott Adams, Sep 30, 1994

ls continued% ls -F list directories with ‘/’ & executables with ‘*’

% ls –alF list entries beginning with ‘.’ & show in long format

-rwx------ 1 hdeshon hdeshon 1201 Jul 10 15:03 .tcshrc*drwx------ 1 hdeshon hdeshon 16384 Aug 1 13:50 bin/-rw------- 1 hdeshon hdeshon 186668405 Jul 31 2007

suma.new.res

From my mac….%cd /Applications%ls -FAbsoft10/Adobe Acrobat 8 Professional/ Macs have many directories with

spaces in the name

Page 27: “Dilbert” by, Scott Adams, Sep 30, 1994

Spaces on Unix are somewhat of a problem as Unix does not handle spaces and special characters well because they mean something special in the shell.

!@#$%^&*()_+|?><`[]{}\’”:;

The problem with spaces is that the command interpreter of the shell parses (breaks) the command line up into tokens (individual items) based on the spaces. So our file name gets broken into 4 small distinct character strings (“Adobe”, “SVG”, “3.0”, and “Installer”) which causes confusion.

So we have to “protect” the spaces from the interpreter. This is done with quotes. We refer to this file using

%ls “Adobe SVG 3.0 Installer”

or

%ls ‘Adobe SVG 3.0 Installer‘