Académique Documents
Professionnel Documents
Culture Documents
Unix Fundamentals
Unix Fundamentals
Unix Fundamentals
Unix Fundamentals
CLI - Command Line Interface GUI - Graphical User Interface (Gooey)
Unix Fundamentals
Unix Fundamentals
CLI - Command Line Interface GUI - Graphical User Interface (Gooey)
Unix is a text-based interface between you and your computer. It is an operating system, like DOS or the MacOS, but much more capable.
Unix Fundamentals
Unix Fundamentals
Unix Fundamentals
Unix Fundamentals
Developed at Bell Laboratories in the 1970s. Derived from Multix operating system. Later changed to C-based core operating system. Portability of C caused Unixs fast spread. Multi-user, multi-tasking operating system. Network-ready operating system.
Unix Fundamentals
Logging on to Unix
Enter your user ID, press [ENTER], type in the default password (it will not display), press [ENTER].
Unix Fundamentals
Once you login correctly, Unix runs some scripts and starts your shell, or your command interpreter.
Unix Fundamentals
A prompt (plus a cursor) tells you that the system is ready for your commands. Your prompt can be changed.
Unix Fundamentals
who who is logged on whoami who am I logged on as (short form) who am I who am I logged on as (long form) w what is everyone doing?
Unix Fundamentals
Getting Help
man man - help on the man command man who - help with the who command man -k mail - checks all man pages for keyword mail
Unix Fundamentals
Unix Fundamentals
Unix Fundamentals
- Bourne Shell ksh - Korn Shell csh - C Shell tcsh - Extended C Shell
Unix Fundamentals
Unix 4.3 - popular with universities AT&T Unix System V - popular with businesses
Unix Fundamentals
Unix Fundamentals
Vendor Tools
Libraries
Kernel
HARDWARE
Calls
Unix Fundamentals
home
etc
tmp
vanhoose
henry
username
public
private
.tin
Each user can create and administer his/her own directories, subdirectories and files.
Unix Fundamentals
An
Unix Fundamentals
absolute path identifies where you or a file is located in relation to the root directory. A relative path identifies where a file is located relative to your current working directory.
means, from the root directory, this is where the file is. It is the most reliable way of identifying files.
Unix Fundamentals
means, from my current directory, this is where the file is. Can start with a directory or file name, . or .. . Is not as reliable, as your current working directory may change.
Unix Fundamentals
etc
tmp
/home/vanhoose/ is also known as ~ or ~vanhoose.
vanhoose
henry
username
public
private
.tin
/home/vanhoose/.tin/ can also be called ~/.tin. From ~henry it could also be ~vanhoose/.tin, or, using a relative path name, as ../vanhoose/.tin.
Unix Fundamentals
Pathname Examples
. - current directory
.. - parent directory (one directory up) .tin/tinrc - the tinrc file in the .tin subdirectory of the current directory /etc/passwd - the password file in the etc directory of the root directory
Unix Fundamentals
Pathname Examples
/home/henry/.cshrc - user henrys .cshrc file
../../etc/passwd - go up two directories, then find the password file in the etc directory
Unix Fundamentals
Unix Fundamentals
Changing Directories
cd cd cd cd cd cd cd change directory (home) .. go to parent directory / go to the root directory ~ go to my home directory ~user go to users home directory /etc go to the etc directory from root ../etc go to the etc directory in my parent directory
Unix Fundamentals
Unix Fundamentals
wheel
Unix Fundamentals
FILE TYPE
PERMISSIONS OWNER
MODIFY DATE
FILE NAME
The block size is the number of blocks the file takes up on the file system medium. The minimum is one.
Unix Fundamentals
FILE TYPE
PERMISSIONS OWNER
MODIFY DATE
FILE NAME
The file type can be d for a directory, - for a regular file, l for a link, etc.
Unix Fundamentals
FILE TYPE
PERMISSIONS OWNER
MODIFY DATE
FILE NAME
The permission settings show who can access the file/directory and in what ways.
Unix Fundamentals
FILE TYPE
PERMISSIONS OWNER
MODIFY DATE
FILE NAME
The number of directories entry shows how many directories exist in that particular directory or file. Files have only one (..).
Unix Fundamentals
FILE TYPE
PERMISSIONS OWNER
MODIFY DATE
FILE NAME
The owner is usually the user that created the file/directory. He/she can control the permissions for that file/directory.
Unix Fundamentals
FILE TYPE
PERMISSIONS OWNER
MODIFY DATE
FILE NAME
The group identifies the people that have priority access to a file/directory, and is usually the owners default group.
Unix Fundamentals
FILE TYPE
PERMISSIONS OWNER
MODIFY DATE
FILE NAME
Unix Fundamentals
FILE TYPE
PERMISSIONS OWNER
MODIFY DATE
FILE NAME
The modify date shows the date that this file/directory was created or last modified.
Unix Fundamentals
FILE TYPE
PERMISSIONS OWNER
MODIFY DATE
FILE NAME
The file name is the identifier of this file/directory in the current directory.
Unix Fundamentals
mkdir make new directory (md) cp copy file or directory (-r) (copy) mv move or rename file or directory (-r)
Unix Fundamentals
Unix Fundamentals
Unix Permissions
Permission Levels
User
(owner) (u) Group (wheel, staff, daemon, etc.) (g) World (guest, anonymous and all other users) (o)
Permission Settings
Read
Permission Settings
If you can read a file, you can see all of its contents.
If you can write to a file, you can change its contents. If you can execute a file, you can run it as a script or program.
Unix Fundamentals
Permission Settings
If you can read a directory, you can see the files in it.
If you can write to a directory, you can add and remove files from it (regardless of file permissions).
Unix Fundamentals
Permission Settings
Computer people love octal (base 8) numbers. Permission settings use octal numbers.
=4 w = 2 x = 1 none = 0
Unix Fundamentals
Permission Settings
= 7 (4 + 2 + 1) rx = 5 (4 + 1) r = 4 none = 0
Each permission level has an octal number that represents its access priviledges for a particular file.
Unix Fundamentals
Permission Settings
Access values for one particular file, then, can be represented by three octal numbers:
one
for the owner/user (u) one for the group (g) one for everyone else (o)
owner/user (u) can rwx (u=rwx) His/her group (g) can rx (g=rx) Anyone else (o) can x (o=x)
Unix Fundamentals
Changing Permissions
chmod chmod chmod chmod chmod chmod
755 . 541 . u=rw . u+x . o-w .
change mode (permissions) u=rwx, g=rx, o=rx u=rx, g=r, o=x u=6 (4 + 2)* add user execute permission** remove other write permission**
* u does not have x permissions ** other settings (go & ug resp.) remain unchanged
Unix Fundamentals
Listing Permissions
1 drwxr-xr-x 180 root wheel 512 2 -rw-r--r-1 vanhoose msu 1314 u g o Oct 1 Oct 3 ../ file
user has read/write permissions (u=rw); group has read-only permissions (g=r); and, others have read-only permissions (o=r).
Unix Fundamentals
Viewing Files
cat - concatenate and print more - page file to screen pr - print file to screen od - octal dump file to screen ls | more - page dir. to screen
Unix Fundamentals
system-wide
scripts your shell and shell scripts your kernel your terminal emulation
Unix Fundamentals
Shell Scripts
Unix Fundamentals
Terminal Emulation
Terminal emulation is negotiated between your client machine and the Unix server.
Your virtual terminal ID (e.g., ttyp1) and type (e.g., vt100) are negotiated when you first connect and login.
Unix Fundamentals
Terminal Emulation
who am i - identifies your terminal (a.k.a. teletype) ID. echo $TERM - identifies your login terminal type.
Unix Fundamentals
interrupt halt or EOF bell backspace redraw screen kill line kill word suspend
key is now [CTRL]-c erase key is now [CTRL]-? kill line key is now [CTRL]-u
Unix Fundamentals
Leaving Unix
To exit from Unix and/or your current shell, type exit or [CTRL]-d at the prompt. Make sure you always log completely out. Leaving yourself logged in is a serious security hole.
Unix Fundamentals
Congratulations!
Unix Fundamentals