500 likes | 593 Vues
Dive into UNIX basics with this tutorial covering file systems, command-line maneuvers, shells, and system access. Learn essential commands, ownership, and permissions for efficient navigation and management. Discover the fundamental aspects of UNIX distributions and their capabilities for networking and portability. Gain insights into different shell types, their features, and functionalities for system operation. Explore file system structures and creation methods while understanding different file types and paths traversal in UNIX environments.
E N D
Introduction to UNIX A User’s Perspective: Day 1 – The File System
Requirements for System Access • Authentication • User account • Password
Connecting to the System • Telnet & FTP • Insecure • Clear-Text Transfer of ALL data • Resident on most systems • SSH & SFTP • Secure • Encrypted transfer of ALL data • Free download from ftp://ftp.ssh.com/pub/ssh/ • SSHSecureShellClient-3.2.2.exe
Let’s Log On! • Hand out Account Sheets • Logon to the System
Maneuvering on the Command-Line • Esc – k • First enter in command history • k to move UP through history • j = Down • l = Left • h = Right • i = Insert • x = Delete • Shift-U = Undo • ESC when in trouble ;)
The Windows/UNIX difference • Capable of getting under the hood • Windows – Difficult • The Registry – Nuff said! • UNIX – Manageable • Configuration files • Fundamental knowledge expandable
What we will Cover Today • Definition of UNIX (2 slides!) • UNIX File System • Basic Commands • Ownership & Permissions • Shells
UNIX What is it? • Multi-user System • File based system • Extensible • Honed for networking • Portable – runs on anything
UNIX Distributions • Linux • Redhat, Mandrake, SuSe, etc. • AIX • IBM • Solaris • SUN • HP-UX • HP
What Should You Know? • How to Log on and off of a UNIX system • How the process works
Question? • Anyone… anyone?
Now that you are logged in… • Account Shells • csh – C-Shell • % • ksh – Korn • $ • bsh – Bourne Shell • $ • Bash – Bourne Again Shell • #
C-Shell – csh • Interactive command interpreter • Command programming language • Syntax similar to the C programming language • /bin/csh or /usr/bin/csh • Executes • /etc/profile OR /etc/login • $HOME/.login OR $HOME/.cshrc
The Korn Shell – ksh • Interactive command interpreter • Command programming language • Backwards compatible with the Bourne Shell • Many C-shell features • /bin/ksh or /usr/bin/ksh • Executes • /etc/profile • $HOME/.profile
Bourne Shell – bsh • Interactive command interpreter • Command programming language • Allows for a restricted shell • /bin/bsh or /usr/bin/bsh • Executes • /etc/profile • $HOME/.profile
Bourne Again SHell – bash • Compatible with Bourne shell • Enhanced feature set • Command-line editing • Line completion, etc. • FREE! • /bin/bash or /usr/bin/bash • Executes • /etc/profile or /etc/bashrc • $HOME/.bash_profile or $HOME/.bashrc • $HOME/.bash_logout
Shells, Why Do I Care? • Dictates mode of operation • Allow for individual system customization
Your Ambassador • Interface to the Kernel • Command Interpreter • Abstracts system level details • What does this mean?
What Should You Know? • How to Log on and off of a UNIX system • How the process works • What UNIX shells are • How they function in relation to the system • Some of their features
Question? • Anyone… anyone?
The File System • It’s a Directory Tree • / = root directory • Windows Equivalent = C:\ • The / serves as a directory delimiter • Can be mounted from anywhere • Everything is a file!
File System Commands • ls • LiSt current directory • cd • Change Directory • pwd • Present Working Directory • rm • ReMove = DELETE
File Types • Regular Files • Any file that can hold data, source code, binaries… • Directory Files • Special files that contain information about other files (location). • Soft/Symbolic Link “Files” • Contains a path to another file • Hard Link “Files” • Creates a link to the files inode
Special Function File Types • Device Files • Character Devices • Block Devices • Unix-Domain Sockets
Regular File Creation • FTP (get) • touch • Editor (vi, pico, etc.) • cat • echo
Directory File Creation • mkdir • mv • cp
Soft/Symbolic Link File Creation • ln –s • $ ln -s out.echo echo.out • lrwxrwxrwx msaba user echo.out -> out.echo • -rw------- msaba user out.echo • Can be made across file systems
Hard Link File Creation • ln • $ ln echo.out out.echo • -rw------- 2 msaba user 12 Dec 10 09:04 echo.out • -rw------- 2 msaba user 12 Dec 10 09:04 out.echo • $ ls -ial • 952410 echo.out • 952410 out.echo • Can not be made across file systems
What Should You Know? • How to Log on and off of a UNIX system • How the process works • What UNIX shells are • How they function in relation to the system • Some of their features • The different UNIX file types • The structure of the UNIX file system
Question? • Anyone… anyone?
Traversing the PATH • Hierarchical – Directory Tree • Parent/Child Nodes • Absolute • The full PATH /usr/local/ssh2/bin/ssh • Relative • pwd = /usr/local/bin • ../local/ssh2/bin/ssh • Simple • ssh
PATH • UNIX PATHs • A colon delimited list of directories the shell uses when finding a command issued with a simple PATH. • echo $PATH • Lists all of the directories the system will “look” in when a command is issued • which “command-name” • Outputs the absolute PATH of the command if known
PATH Shortcuts • Shortcuts to your Home Directory root • cd ~ • cd ~user-name • cd $HOME • Absolute Path Shortcuts • * • A wildcard that matches any character • cd /usr/l*/ss*
What Have We Covered? • What UNIX is • Logging onto UNIX • UNIX Shells • File Types • Structure of the File System • PATH
What Should You Know? • How to Log on and off of a UNIX system • How the process works • What UNIX shells are • How they function in relation to the system • Some of their features • The different UNIX file types • The structure of the UNIX file system • UNIX PATHS • How to navigate around the UNIX file system
Question? • Anyone… anyone?
Permissions – Power in Play • Everything in UNIX is a File • Every file in UNIX has associated permissions • Ownership • Three Ownership Tiers • User • Group • “The World” • Controls • Three Control Tiers per Ownership • Read • Write • Execute
Master of Your Domain • Viewing Permissions • ls –al • drwx------ 4 msaba user 512 Dec 10 09:55 . • drwxr-xr-x 27 msaba user 4096 Dec 10 09:04 .. • drwx------ 2 msaba user 512 Dec 10 09:07 dir-test • lrwxrwxrwx 1 msaba user 8 Dec 10 09:18 echo.out -> out.echo • -rw------- 2 msaba user 12 Dec 10 09:04 out.echo
A Closer Look • Example Data • drwxr-xr-x .. • drwx------ dir-test • lrwxrwxrwx echo.out -> out.echo • First column • File type • Next three sets of three columns…?! • Permission definitions for different ownerships
Binary Versus Alpha Thinkers • Binary Thinkers & Permissions • Think in terms of 0s and 1s • 0 = off/false • 1 = on/true • Convert it to decimal…Easy!! • Alpha Thinkers & Permissions • Think in terms of u,g,o,a and r,w,x • Add permissions with a + • Remove permissions with a –
Actually Making a Change • Grant/Change permissions • chmod • http://sp.uconn.edu/~msaba/sysadmin/Fpermissionstable.html • http://sp.uconn.edu/~msaba/sysadmin/FilePermissions.html • Changing ownership • chown user:group file
What Should You Know? • How to Log on and off of a UNIX system • How the process works • What UNIX shells are • How they function in relation to the system • Some of their features • The different UNIX file types • The structure of the UNIX file system • UNIX PATHS • How to navigate around the UNIX file system • UNIX ownership and permissions
Question? • Anyone… anyone?
THANK YOU FOR ATTENDING Please fill out the Evaluation Form before leaving.