There are 4 Unix servers, fiji, sumatra, tahiti and ceylon Remote Access: telnet (bad!!!) ssh (Teraterm/putty) \\ \ (eg. \\fiji\awong) XDMCP “XWindows.

Slides:



Advertisements
Similar presentations
Learning Unix/Linux Bioinformatics Orientation 2008 Eric Bishop.
Advertisements

Introduction to Unix – CS 21 Lecture 10. Lecture Overview Midterm questions Jobs and processes description The foreground and background Controlling jobs.
1 Introduction to UNIX Ke Liu
NETW-240 Shells Last Update Copyright Kenneth M. Chipps Ph.D. 1.
Introducing the Command Line CMSC 121 Introduction to UNIX Much of the material in these slides was taken from Dan Hood’s CMSC 121 Lecture Notes.
Linux Linux File System.
Introduction to UNIX A User’s Perspective: Day 2 – Command Basics.
What is Unix? A multi-user networked operating system –“Operating System” Handles files, running other programs, input/output Just like DOS or Windows.
What is Unix? A multi-user networked operating system –“Operating System” Handles files, running other programs, input/output Looks like DOS…but more powerful.
CS 141 Labs are mandatory. Attendance will be taken in each lab. Make account on moodle. Projects will be submitted via moodle.
Introduction to Linux Workshop February Introduction Rob Lane & The HPC Support Team Research Computing Services CUIT.
COMP1070/2002/lec4/H.Melikian COMP1070 Lecture #5  Files and directories in UNIX  Various types of files  File attributes  Notion of pathname  Commands.
Unix Primer. Unix Shell The shell is a command programming language that provides an interface to the UNIX operating system. The shell is a “regular”
UNIX command line. In this module you will learn: What is the computer shell What is the command line interface (or Terminal) What is the filesystem tree.
Introduction to Unix Bent Thomsen Institut for Datalogi Aalborg Universitet.
Linux environment ● Graphical interface – X-window + window manager ● Text interface – terminal + shell.
Lesson 1. PC vs. Multi-user System  Personal Computer – each user gets his/her own processor (or multicore processor).  Multi-user system – The processor,
Essential Unix at ACEnet Joey Bernard, Computational Research Consultant.
File Processing. Introduction More UNIX commands for handling files Regular Expressions and Searching files Redirection and pipes Bash facilities.
Unix Basics Chapter 4.
Introduction to Computer Organization & Systems Topics: Intro to UNIX COMP John Barr.
UNIX command line. In this module you will learn: What is the computer shell What is the command line interface What is the directory tree Some UNIX commands.
Unix Tutorial for FreeSurfer Users. Helpful To Know FreeSurfer Tutorial Wiki:
The Shell Chapter 7. Overview The Command Line Standard IO Redirection Pipes Running a Program in the Background Killing (a process!)
PROGRAMMING PROJECT POLICIES AND UNIX INTRO Sal LaMarca CSCI 1302, Fall 2009.
Unix Tutorial for FreeSurfer Users. Helpful To Know FreeSurfer Tutorial Wiki:
Session 2 Wharton Summer Tech Camp Basic Unix. Agenda Cover basic UNIX commands and useful functions.
INTRODUCTION TO LINUX Jacob Chan. GNU/Linux Consists of Linux kernel, GNU utilities, and open source and commercial applications Works like Unix –Multi-user.
1 Operating Systems Lecture 2 UNIX and Shell Scripts.
Quiz 15 minutes Open note, open book, open computer Finding the answer – working to get it – is what helps you learn I don’t care how you find the answer,
Unix/Linux cs3353. The Shell The shell is a program that acts as the interface between the user and the kernel. –The shell is fully programmable and will.
Linux file system "On a UNIX system, everything is a file; if something is not a file, it is a process." Sorts of files (on a Linux system) Directories:
Second edition Your UNIX: The Ultimate Guide Das © 2006 The McGraw-Hill Companies, Inc. All rights reserved. UNIX Commands cal – will print a calendar.
ITR3 lecture 6: intoduction to UNIX Thomas Krichel
E X C E E D I N G E X P E C T A T I O N S Basic LINUX Linux System Administration Dr. Hoganson Kennesaw State University Operating Systems Directory structure:
Introduction to Programming Using C An Introduction to Operating Systems.
Lesson 3-Touring Utilities and System Features. Overview Employing fundamental utilities. Linux terminal sessions. Managing input and output. Using special.
CSE 374 Programming Concepts & Tools Hal Perkins Fall 2015 Lecture 2a – A Unix Command Sampler (Courtesy of David Notkin, CSE 303)
Linux Commands C151 Multi-User Operating Systems.
CS 245 – Part 1 Using Operating Systems and Networks for Programmers Jiang Guo Dept. of Computer Science California State University Los Angeles.
1 CS3695/M6-109 – Network Vulnerability Assessment & Risk Mitigation – Introduction to Unix & Linux.
UNIX filesystem CS 2204 Class meeting 2 *Notes by Doug Bowman and other members of the CS faculty at Virginia Tech. Copyright
 Last lesson, the Windows Operating System was discussed along with the Windows command shell  Unix is a computer operating system, that similarly manages.
1 CS3695 – Network Vulnerability Assessment & Risk Mitigation – Introduction to Unix & Linux.
What is Unix? A multi-user networked operating system –“Operating System” Handles files, running other programs, input/output Just like DOS or Windows.
Lecture 1: Introduction, Basic UNIX Advanced Programming Techniques.
Linux Tutorial Lesson Two *Getting Help in Linux *Data movement and manipulation *Relative and Absolute path *Processes Note: see chapter 1,2,3 from Linux.
1 CSE 390a Lecture 3 bash shell continued: processes; multi-user systems; remote login; editors slides created by Marty Stepp, modified by Jessica Miller.
Learning Unix/Linux Based on slides from: Eric Bishop.
UNIX To do work for the class, you will be using the Unix operating system. Once connected to the system, you will be presented with a login screen. Once.
Chapter 11 Command-Line Master Class
CS3695/M6-109 – Network Vulnerability Assessment & Risk Mitigation –
Linux 101 Training Module Linux Basics.
Andy Wang Object Oriented Programming in C++ COP 3330
Some Linux Commands.
C151 Multi-User Operating Systems
The Command Prompt Commands are the way to “do things” in Unix
The Linux Operating System
CSE 374 Programming Concepts & Tools
Basic UNIX OLC Training.
CSE 390a Lecture 2 Exploring Shell Commands, Streams, and Redirection
Introduction to Linux Week 0 - Thursday.
Web Programming Essentials:
CSE 390a Lecture 2 Exploring Shell Commands, Streams, and Redirection
Linux Shell Script Programming
CSE 303 Concepts and Tools for Software Development
What is Unix? A multi-user networked operating system
January 26th, 2004 Class Meeting 2
LPI Linux Certification
Presentation transcript:

There are 4 Unix servers, fiji, sumatra, tahiti and ceylon Remote Access: telnet (bad!!!) ssh (Teraterm/putty) \\ \ (eg. \\fiji\awong) XDMCP “XWindows login” Services: gcc/gdb (Linux compiler/debuggers) (pine, mutt) login from anywhere It doesn’t matter which one you log into! IWS (Instructional Work Servers) This tutorial provided by UW ACM Questions to

/ – root. The source of everything /bin – Where executables (programs) are run /sbin – executables generally of interest only to the super user /home – where your “home directories” are /tmp – same as c:\temp in windows. Just for temporary files /var – system logs and other stuff (probably not intersting) /usr – layed out like /, but with less system-critical stuff /dev – has files that represent different devices on the system /proc – has runtime system info (try: cat /proc/cpuinfo) Unix File Hierarchy

Connecting: - Connect to the Unix boxes via telnet or ssh (ssh preferred) - After connection, you have a shell (command prompt) Shells: - Instead of clicking, you type long, cryptic commands - After login, you begin in your home directory - tab completion is nice Logging in and home directories

What is a Command fiji:/u15/awong$ fiji:/u15/awong$ ls -la command flags Commands are the way to “do things” in unix (no point and click) A command consists of a program name and options called “flags” Cryptic commands are good for you; they improve typing speed Also, after you type them long enough, you get to like them! prompt

The basics: ls – lists your files cp – copies a file mv – moves (can be used to rename) a file rm – remove a file mkdir – makes a directory (synonymous to folder) rmdir – removes a directory cd – changes your directory ps – list the current processes in the shells kill – kill processes (-9 if you want to kill them violently) Commands - Basic

Commands – Less Basic less basic: ln – creating links (kind of like shortcuts, but they work right) less, more – keeps your text from scrolling off your screen man, info – gives you “help” on commands grep – search in files for a string find – search for a filename finger – get some information on other users (like last login) which – locate where a command is pwd – print the current directory diff – find the difference between two (text) files

Wildcards: ? – matches a single character * – matches any number of characters [xy] – matches either x or y (note: you can use other letters too!) Redirection: > – pipes standard output (printf, stdout, cout) to a file < – pipes a file into standard input (scanf, stdin, cin) | – connects the output of one command to the input of another Wildcards and Redirection

Groups In Unix, all users belong to at least one group. The idea is that each person in one group has a similar amount of access to the system. Permissions Files and directories all have “permissions” associated with them. Permissions tell the OS who can do what with your files and directories. Permissions can be set for three categories, the user, the group and the rest of the world. The permissions are: read, write, execute Groups and Permissions - 1

To see the permissions on a file, do a ‘ls –l’ fiji:/u15/awong$ ls –l -r--r--r-- 1 awong ugrad_ce Apr rgb.txt -rw-r--r-- 1 awong ugrad_ce Apr 5 02:57 set10.csv drwxr-xr-- 1 awong ugrad_ce 1024 Jan 19 19:39 tests Groups and Permissions - 2 Changing Permissions chmod [ugo]+[rxw] e.g. chmod u+w rgb.txt  gives me permission to change rgb.txt Changing Ownership chown. e.g. chmod awong.iuns rgb.txt  makes rgb.txt owned by iuns group

-r--r--r-- 1 awong ugrad_ce Apr rgb.txt -rw-r--r-- 1 awong ugrad_ce Apr 5 02:57 set10.csv drwxr-xr-- 1 awong ugrad_ce 1024 Jan 19 19:39 tests Groups and Permissions - 3 What they do: files: read – Allows you to read the file write – Alows you to modify the file execute – Allows you run the file as a script or binary program directories: read – lets you get a directory listing of files write – lets you add or remove files from directory execute – lets you access files in the directory user group other

What is X Windows? Xwindows is a network protocol for transferring windowing information (eg mouse clicks, keyboard events, etc). But for many purposes, you can just think of it as Unix with graphics and ignore the technical details XDMCP login – via Reflection X Currently, just think of it as a login screen to a world of pictures xterms These are shells inside windows (not MS Windows, BTW). Window Managers Window managers are the things that handle how windows respond to clicks, where they pop up, etc. Windows Explorer is a window manager (on crack). XWindows (Unix with Graphics -- kindof)

.login,.bash_login,.mylogin,.profile,.bash_profile One of these scripts get run at startup…. If you use bash, you should create a.bash_profile so that you know what is getting run..logout,.bash_logout One of these gets run when you logout or quit a shell.cshrc,.mycshrc,.bashrc One of these get run you start a new shell (as opposed to logging in. An example would be when you start a new xterm)..cshrc and.mycshrc are run if you use tcsh and.bashrc is run if you use bash..xsession This gets run if you login via xdmcp. This is the only thing that gets run. It must be set as executable (chmod u+x) to work. Login Scripts (what happens at startup)

When you run a command, it starts a new “process” Each process has a unique number called the PID (Proccess ID) Unix is a multitasking operating system, so you can run multiple processes simultaneously After you start a process, it is usually in what is called the “foreground.” That is, it takes over your shell. You can suspend processes in the foreground with Ctrl-Z The process is now frozen. You can pull it to the foreground again by typing “fg”. Alternately, you can make it keep running, but put it in the background so can still use the same shell by typing “bg”. You can also start a task in the background by putting a & at the end of the command. Processes 1: suspend, background, foreground

You can list all the processes that have been run from the current shell with “ps” To list all the processes on the system, do “ps awux” root pts/20 S 16:21 0:00 –bash awong pts/17 R :00 -bash awong pts/17 R :00 ps awux Processes 2: ps, kill, kill -9 If a process of yours freezes, you can login to the same machine again, do a “ps awux” and find the process number and then kill it. If you want to end a process, you can do “kill ” eg. kill 3724 If that doesn’t kill it, you can do the “super kill,” “kill -9 ” eg. kill –9 3724

Sometime you want to know what process is taking up the most cycles on a machine. The program that tells you this is “top” Another measurement utility for system load is “uptime.” uptime tells you how long the system has been running and how many processes are concurrently screaming for attention. The last three numbers tell you how the average number of processes screaming for attention over the last 1 minute, 5 minutes and 10 minutes, respecetively. 4:49pm up 1:15, 19 users, load average: 0.10, 0.11, 0.09 System State: uptime, top, nice If you are going to run a long, cpu intensive process, it is often a good idea to “nice” it. This puts it at a slighly lower priority so that quick, interactive tasks (like checking ) won’t get starved. To do “nice” a process, just do “nice ”

Environment Variables What are environment variables? Think of them as parameters that get passed to your programs. All operating systems have them. They give information about the context within which a program runs. The most commonly used environment variable is the PATH variable which tells the shell where to look for programs. To create an environment variable in bash, type: export VARNAME=value To create an environment variable in tcsh type: setenv VARNAME value Don’t forget the export or the setenv, otherwise you create a “Shell variable” instead of an environment variable.

/uns /uns stands for unsupported. It is a set of student maintained programs, utilities, and libraries that are meant to make your unix life more comfortable (it has things like IDEs, more window managers, some cheezy games, etc). To use /uns, you have to set up your environment correctly. It is suggested that you just run the auto-setup script /uns/examples/setup-uns However, this script is very intrusive, so if you already have a setup you like, you may want to try setting up /uns by hand. If you have questions regarding /uns, *Note: The software is unsupported, so though it is generally stable, there are no guarantees that it will always work