Very Quick & Basic Unix Steven Newhouse Unix is user-friendly. It's just very selective about who its friends are.

Slides:



Advertisements
Similar presentations
Linux commands exercise 1. What do you need, if you try to these at home? You need to download and install Ubuntu Linux from the Internet – DVD is need.
Advertisements

Learning Unix/Linux Bioinformatics Orientation 2008 Eric Bishop.
NETW-240 Shells Last Update Copyright Kenneth M. Chipps Ph.D. 1.
Cosc 4750 Getting Started in UNIX Don’t be afraid of the prompt, in linux it can be your best friend. In some cases, the only way to do certain things.
ATS Programming Short Course I INTRODUCTORY CONCEPTS Tuesday, Jan. 27 th, 2009 Essential Unix Commands.
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+ Guide to Linux Certification, Second Edition
Lecture 01CS311 – Operating Systems 1 1 CS311 – Lecture 01 Outline Course introduction Setting up your system Logging onto the servers at OSU with ssh.
“Linux at the Command Line” Don Johnson of BU IS&T.
1 Some basic Unix commands u Understand the concept of loggin into and out of a Unix shell u Interact with the system in a basic way through keyboard and.
1 SEEM3460 Tutorial Unix Introduction. 2 Introduction What is Unix? An operation system (OS), similar to Windows, MacOS X Why learn Unix? Greatest Software.
Linux Shell. 2 Linux Command-Line Interface ■ Linux shells: A shell is a command interpreter that allows you to type commands from the keyboard to interact.
Linux Commands LINUX COMMANDS.
L INUX C OMMAND L INE I NTERFACE G UNAANBAN.G
CS 141 Labs are mandatory. Attendance will be taken in each lab. Make account on moodle. Projects will be submitted via moodle.
Using Macs and Unix Nancy Griffeth January 6, 2014 Funding for this workshop was provided by the program “Computational Modeling and Analysis of Complex.
Introduction to Linux Workshop February Introduction Rob Lane & The HPC Support Team Research Computing Services CUIT.
Brief introduction to UNIX A. Emerson CINECA, High Performance Systems.
Help session: Unix basics Keith 9/9/2011. Login in Unix lab  User name: ug0xx Password: ece321 (initial)  The password will not be displayed on the.
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.
Chapter 9 Part II Linux Command Line Access to Linux Authenticated login using a Linux account is required to access a Linux system. The Linux prompt will.
Linux environment ● Graphical interface – X-window + window manager ● Text interface – terminal + shell.
Unix Basics Chapter 4.
Carnegie Mellon Linux Boot Camp Jenna MacCarley, Peter Pearson, Shashank Goyal 9/19/2015.
System Administration Introduction to Unix Session 2 – Fri 02 Nov 2007 Reference:  chapter 1, The Unix Programming Environment, Kernighan & Pike, ISBN.
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.
Lesson 2-Touring Essential Programs. Overview Development of UNIX and Linux. Commands to execute utilities. Communicating instructions to the shell. Navigating.
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.
Introduction to UNIX Road Map: 1. UNIX Structure 2. Components of UNIX 3. Process Structure 4. Shell & Utility Programs 5. Using Files & Directories 6.
L&T Infotech1 UNIX – Getting Started - Aneesh Ramani.
BIF713 Basic Unix/Linux Commands Getting Help with Commands.
ITR3 lecture 6: intoduction to UNIX Thomas Krichel
Welcome to CS323 Operating System lab 1 TA: Nouf Al-Harbi NoufNaief.net.
Agenda Basic Unix Commands (Chapters 2 & 3) Miscellaneous Commands: whereis, which, whoami, finger, passwd, cal, date Working with Files: cat, more, less.
Unix/Linux for beginners:
Introduction to Programming Using C An Introduction to Operating Systems.
Manage Directories and Files in Linux Part 2. 2 Identify File Types in the Linux System The file types in Linux referred to as normal files and directories.
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.
Linux+ Guide to Linux Certification, Second Edition Chapter 4 Exploring Linux Filesystems.
Lecture 02 File and File system. Topics Describe the layout of a Linux file system Display and set paths Describe the most important files, including.
The Kernel At a high level, the kernel in an operating system serves as the bridge between applications and the actual data processing of the hardware.
A Brief Overview of Unix Brandon Bohrer. Topics What is Unix? – Quick introduction Documentation – Where to get it, how to use it Text Editors – Know.
 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.
Unix Fundamentals CS 127. File navigation cd - change directory cd /var/log cd /etc/apache2 cd ~/Desktop ~ is a shortcut for the home directory.
Learning basic Unix command It 325 operating system.
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.
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.
Getting started with CentOS Linux
Linux Commands Help HANDS ON TRAINING Author: Muhammad Laique
Andy Wang Object Oriented Programming in C++ COP 3330
Linux file system "On a UNIX system, everything is a file;
Some Linux Commands.
C151 Multi-User Operating Systems
The Command Prompt Commands are the way to “do things” in Unix
CSE 374 Programming Concepts & Tools
Basic UNIX OLC Training.
Introduction to UNIX.
Web Programming Essentials:
Getting started with CentOS Linux
Andy Wang Object Oriented Programming in C++ COP 3330
Linux Shell Script Programming
Yung-Hsiang Lu Purdue University
Module 6 Working with Files and Directories
Presentation transcript:

Very Quick & Basic Unix Steven Newhouse Unix is user-friendly. It's just very selective about who its friends are.

© Acknowledgements Ohio Supercomputing Centre (OSC) Basic & Intermediate UNIX courses With exercises: Further references Google

© Shells Programs Java Library Kernel UNIX and its history Its an Operating System Liaison between the user (you) and the computer Been around since the 70s Rejuvenated in the 90s with Linux Traditionally high-end machines Through Linux available nearly everywhere Programs work through a library Compositional & layered Hardware

© Everything is a process A process is the ‘unit’ of work in Unix A process is owned by a particular user Each user owns its own processes (partitioning) Cannot interfere with another user’s process ‘root’ is the admin or super user It can interfere with all processes Processes come from other processes They are ‘spawned’ or ‘forked’

© The machine in front of you It is up and running and with a login screen Login in using your username & password You will be presented with a ‘desktop’ Growing similarity to Windows desktop Usability is one of the major Linux improvements Your interaction with the machine through a terminal Start one up by navigating through the menu

© The Terminal (xterm) This window represents a ‘shell’ session What is a shell? A way of interacting with the computer Allows you to enter (& execute) commands By default you are in the Bash shell There are several different flavours of shells Over-time you may develop a preference Not a concern now

© Notation (& try out the examples) Typing a command into your terminal: $ ls $ represents the ‘prompt’ in your shell ls is the command you want to run (followed by ENTER) A command may have options prefixed by ‘ - ’ or ‘--’ $ ls –al The ls command lists directory contents Some commands have ‘arguments’ $ ls

© Self Help Unix has many different commands Different commands (applications) in a distribution Different shells have different build in commands Finding out about different commands apropos – simple search engine for manual pages man - display the command’s manual page -help or --help : show the built in help text

© What processes are running? To see the currently running processes: List the processes that you are running $ ps List the processes running on the machine $ ps –e $ ps -ef To see an updated list of processes $ top Press q to quit

© Exercise: Find out which shell you are in Get you shell to tell you about its environment $ env Displays a list of environment variables Each variable has a name & value One of these variables is the SHELL variable SHELL=/bin/bash To display a specific value use the echo command: $ echo $SHELL /bin/bash [is the screen output]

© File Hierarchy

© Useful Directory Commands pwd : Tells you where you are in the directory space cd : Change directory cd ~ : Change to your home (initial) directory cd /home/users/sn : Change to an absolute directory location cd../sn : Change to a relative directory location (up a level and then into the sn directory) You will have a different username than sn

© Other Useful Directory Commands mkdir - Create a directory rmdir - Remove a directory

© Manipulating files Copy a single file (after creating it: $ touch testfile1 ) $ cp testfile1 testfile2 Copy a directory (after creating it: $ mkdir testdir1 ) $ cp –pr testdir1 testdir2 Move a single file or directory (sort of rename) $ mv testfile2 testfile3 Delete a single file $ rm testfile1 HINT: Use ls to examine how the directory has changed after each command

© Exercise: Download a set of files Using a browser: Easy point & click – NO Using commands executed from the shell 1. Goto your home directory ( cd ) 2. Create a new sub-directory ( mkdir ) 3. Move into the subdirectory ( cd ) 4. Retrieve the file archive from the web ( wget ) 5. Expand the file archive ( tar ) 6. Look at what we’ve got ( ls )

© New Commands wget : Retrieve http or ftp based URLs into the current directory (Web Get) tar : Tape Archive (very old command!) User to build or extract file & directory hierarchy from an archive Examine the contents: $ tar --list –zvf How would you extract the contents instead of list? HINT: You may want to see what HELP you can get

© And the finally…. The file archive is: Examine the extensions:.tar – Tells you it’s a tar archive.gz – Tells you it compressed with gzip.tar.gz is frequently abbreviated to.tgz People can lie… and then the commands will normally complain

© Examine the download You have a directory ( bin ) with a file & a file bin/gridschool longfile.txt Examine the contents of the longfile.txt using various commands more : Allows you to control how much text goes past. A page at a time by pressing space, or a line at a time by pressing return. $ more longfile.txt less : Similar to more but allows you to go backward (b key) as well as forward (space) $ less longfile.txt

© Examine explicit parts of a file head : Examine the start of a text file (or just the first 5 lines) $ head longfile.txt $ head -5 longfile.txt tail : Examine the end of a text file (or just the last 5 lines) $ tail longfile.txt $ tail -5 longfile.txt grep : Look for lines with specific text $ grep HEAD logfile.txt $ grep GET longfile.txt | more $ cat longfile.txt | grep GET | more Combine commands together by ‘piping’ cat : Dumps contents to the screen

© Using your commands Recap on commands: Built in to the shell Standalone executable applications Standalone commands are in ‘well-known’ locations How do you find out where a command is located? $ which echo $ which export How does the shell know where to look…?

© Finding an executable The PATH variable tells the shell which directories to look in for an executable Directories separated by ‘:’ How do we find the value of the PATH variable $ echo $PATH $ env How do we change the value: BASH: export PATH=

© Add in our own executable Find the absolute location of the ‘bin’ directory in the download HINT: Navigate to the directory using: cd to move into and out of directories ls to examine the contents of the directory HINT: Once you are in the bin directory use the pwd command to find out its absolute path. Add this directory to the PATH variable (one line) $ export PATH=$PATH:/home/users/sn/download/bin:

© Verifying this has worked Check the executable is there $ which gridschool It will tell you the full absolute path Run the command $ gridschool Expected output: Welcome user sn to ISSGC06

© Editors Very simple: vi WYSIWYG: nedit More ‘normal’ editor

© Thank you… Questions?