Review Did you get an email from me? Last class we had an introduction to Linux and the command-line Linux: Kernel vs OS It is a kernel (brain of an OS)

Slides:



Advertisements
Similar presentations
Lab III – Linux at UMBC.
Advertisements

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.
By: Tony Andrews.  Linux directory ordering system  Navigating and creating directories ◦ Listing directories and files ◦ Creating directories ◦ Changing.
Linux, it's not Windows A short introduction to the sub-department's computer systems Gareth Thomas.
Learning Unix/Linux Bioinformatics Orientation 2008 Eric Bishop.
Chapter One The Essence of UNIX.
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.
1 CSE 390a Lecture 1 introduction to Linux/Unix environment slides created by Marty Stepp, modified by Josh Goodwin
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.
CSE 303 Lecture 2 Introduction to bash shell
CMPE 151: Network Administration Spring Class Description Focus: system and network administration. Sequence of exercises. E.g., installing/configuring.
Very Quick & Basic Unix Steven Newhouse Unix is user-friendly. It's just very selective about who its friends are.
UNIX Utilities Learning Objectives: 1. To understand the some basic utilities of UNIX File 2. To compare UNIX shell and popular shell 3. To learn Input/Output.
Virtual Machine and UNIX. What is a VM? VM stands for Virtual Machine. It is a software emulation of hardware. By using a VM, you can have the same hardware.
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.
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.
Lesson 4 Computer Software
MCB Lecture #3 Sept 2/14 Intro to UNIX terminal.
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.
IT 136 – Intro To Linux Class Details: M/W 7:15pm-9:15pm Room: 3183
Essential Unix at ACEnet Joey Bernard, Computational Research Consultant.
Module 1 Introduction to UNIX/Linux
– Introduction to the Shell 10/1/2015 Introduction to the Shell – Session Introduction to the Shell – Session 2 · Permissions · Users.
Unix Tutorial for FreeSurfer Users. Helpful To Know FreeSurfer Tutorial Wiki:
HKOI 2012 TRAINING INTRO TO LINUX /CUHK/SHB123]$ date Sat Feb 18 13:00:00 HKT 2012.
Unix Tutorial for FreeSurfer Users. Helpful To Know FreeSurfer Tutorial Wiki:
COP3502: Introduction to Computer Science Yashas Shankar.
Agenda Link of the week Use of Virtual Machine Review week one lab assignment This week’s expected outcomes Review next lab assignments Break Out Problems.
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.
Lesson 2-Touring Essential Programs. Overview Development of UNIX and Linux. Commands to execute utilities. Communicating instructions to the shell. Navigating.
Chapter Two Exploring the UNIX File System and File Security.
Welcome to CS323 Operating System lab 1 TA: Nouf Al-Harbi NoufNaief.net.
A Genomics View of Unix. General Unix Tips To use the command line start X11 and type commands into the “xterm” window A few things about unix commands:
Unix Commands PowerPoint Presentation developed for LS 560 Information Technology online class - University of Alabama by Debey Sklenar TENacious Cohort.
Agenda Basic Unix Commands (Chapters 2 & 3) Miscellaneous Commands: whereis, which, whoami, finger, passwd, cal, date Working with Files: cat, more, less.
Homework & Review Questions? Everything after this is for accuracy – “All your permanent teeth are in, okay? You’re playing for keeps now!” -Psych Review:
Homework & Practical Let’s go through it Does anyone not have access to the wiki? Questions?
Review Please hand in any homework and practicals Vim Scripting Inter-device communication.
Lab 3 + Using the Terminal 1. "Under Linux there are GUIs (graphical user interfaces). where you can point and click and drag, and hopefully get work.
1 CSE 390a Lecture 1 introduction to Linux/Unix environment slides created by Marty Stepp, modified by Jessica Miller & Ruth Anderson
Agenda Basic Unix Commands (Chapters 2 & 3) Miscellaneous Commands: which, passwd, date, ps / kill Working with Files: file, touch, cat, more, less, grep,
COP3502: Introduction to Computer Science Yashas Shankar Lecture #2.
CS 245 – Part 1 Using Operating Systems and Networks for Programmers Jiang Guo Dept. of Computer Science California State University Los Angeles.
More Unix Naomi Altman. Directories Directory = folder mkdir - makes a new directory rmdir - removes an empty directory cd mydirectory - moves you into.
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.
1 Introduction to Unix. 2 What is UNIX?  UNIX is an Operating System (OS).  An operating system is a control program that helps the user communicate.
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.
 Last lesson, the Windows Operating System was discussed along with the Windows command shell  Unix is a computer operating system, that similarly manages.
The Unix File sytem. Introduction Tree structure …
Review Please turn in your homework and practicals Packages, installation, rpm command Apache – Quick and easy way to set up a web server to play around.
Agenda The Bourne Shell – Part I Redirection ( >, >>,
Virtual Machines Module 2. Objectives Define virtual machine Define common terminology Identify advantages and disadvantages Determine what software is.
File Management commands cat Cat command cat cal.txt cat command displays the contents of a file here cal.txt on screen (or standard out).
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.
Introduction to Unix for FreeSurfer Users
Andy Wang Object Oriented Programming in C++ COP 3330
The Command Prompt Commands are the way to “do things” in Unix
The Linux Operating System
CSE 390a Lecture 1 introduction to Linux/Unix environment
Yung-Hsiang Lu Purdue University
What is Unix? A multi-user networked operating system
introduction to Linux/Unix environment
Presentation transcript:

Review Did you get an from me? Last class we had an introduction to Linux and the command-line Linux: Kernel vs OS It is a kernel (brain of an OS) It’s a reference to OS’ that use Linux kernel ‘Logical leap’ of command-line Today we are going to review all these and learn basic commands

Today The shell 3 File Channels Files Directories Moving around Looking around

A Quick Note Plagiarism is highly frowned upon, even more so in the Open Source world (which Linux is a huge part of) If I can take any four words in a row and match them to an article, you have plagiarized Don’t just copy wikipedia or a manpage Rewrite it in your own words You’ll get a 0 for that assignment and have to take plagiarism training

First – Please Log In Ensure VM’s are on your systems: C:\Users\Public\Documents\Shared Virtual Machines If not, we have to add them from \\srv12\FileShare\Instructor Images\Nathaniel Dillon

VM’s Are Now Available While it copies, we’re going to go on, however once it’s complete: Open VMWare Double-click VMWare icon on desktop VMWare will open, so click ‘Open a Virtual Machine’ Scroll to your VM’s folder, click our vm file Click this, click okay, then, the green arrow starts it up

Linux – What is it? Like Windows, but better It’s what you see when you boot the computer and are ready to tell it to do stuff (can be GUI, can be command line) The kernel is like the brain of what you see when you boot up – it tells everything else how to behave (Windows has a kernel too) The “bodies” (flavors) are as diverse as people – RedHat (CentOS) is for business, Ubuntu is the “popular” one, Slackware is the jerk I don’t like Like using Mozilla web browser vs Opera vs Chrome vs IE

Why is it Good? Linux allows the admins more power and more control over everything Commands came first – the GUI maps to the command Windows is the opposite Linux is free You can modify it and see what it's doing – all source code is out there A bunch of really smart people add to it

Equivalencies Linux has everything Windows has (almost) What it doesn't have –.NET (Eclipse?) What it does have – everything else Word processor – Open Office looks exactly like MS Office; Libre is getting more popular Mail – Evolution; Media Players – Brasero, VLC Photoshop – GIMP; Eclipse – Eclipse Backups - tar/gzip/bz2 What is does better – Security Tools – Backtraq (metasploit, sniffers, aircrack, etc...) - Cloud – Hadoop, OpenStack – Monitoring/Automation

Directory Structure In a ‘hierarchical’ file structure, you care about two things: 1) Where you want to go 2) Where you are right now You can get these things two ways: 1) Starting at the root or ‘top-level’ directory 2) Moving up levels from where you are In the next slide, there is no direct connection between C:\Windows and E:\Jack You have to go back up to My Computer

Directory Structure Windows

Directory Structure Linux is also a ‘tree’ or ‘hierarchical’ directory structure cture.png

First Login When you log in, you will be taken to the home directory of the user you logged in as Windows Vista/7/8 has this at C:\Users\ Linux is /home/ We use the student user /home/student Any other user: /home/anyotheruser Previous slide had: /home/tom This is a ‘path’ or a ‘file path’

First Login, pt 2 The only thing displayed will be this funky thing: ~]$ That is our shell The shell (command prompt/command line) is how we will interact with the system This is the default look for the BASH shell Tells us our current username (student) Hostname (it136centos65vm) Directory (~) And we can type in commands after the $

A note on commands We will be talking about many different commands We looked at the command prompt ~]$ ls This is an example of a command ready at the command prompt, to see the result of the command, press enter We have a model for commands command Does the ls command above fit or break our model?

Inside Tom’s Home Folder ~]$ ls documents Notice we don’t see inside documents, nor do we see /home/tom Our VMs: ~]$ ls pslistteams.txtteams2.txtscript.sh

$PATH ~]$ ls pslistteams.txt teams2.txt script.sh So what just happened? The BASH shell took our ‘standard input’ We provided two letters (not a file path), so the BASH shell looked in something called the PATH variable to see if it knew what to do with those letters It found a program called /bin/ls (which is our ls command), and ran it This ‘listed’ the items in our directory

Standard Input/Output/Error The Shell classifies three file channels STDIN – standard input STDOUT – standard output STDERR – standard error Standard input is what you type into the shell (commands) Standard output is what the shell outputs if the command (STDIN) works Standard error is what the shell outputs if the command (STDIN) doesn’t work

Command, Flag, Argument So we have the command, flag, argument model What is what? Command: anything we type into the system to get it to do something useful (ls, cd) Argument: usually a path to what we want to work on (/home/tom) Flag: symbol that modifies how a command is run (-l, -cvf)

Command, Flag, Argument, ex Running ls -l command ~]$ ls -l total 12 -rw-rw-r-- 1 student student 0 Jan 24 00:34 mytest -rw-rw-r-- 1 student student 0 Jan 24 00:34 pslist -rw-rw-r-- 1 student student 0 Jan 24 00:34 teams.txt -rw-rw-r-- 1 student student 0 Jan 24 00:34 teams2.txt permissions userdatefilename The -l changed the way ls showed the information

Flags Are Very Useful Flags allow us to do more specific stuff Show more data about a file/directory Add arguments (to make commands more specific, or more general) In useradd command, we add arguments to tell the system to not use its own defaults, but the values we give it In the grep command we add arguments to tell the system to not worry about capitalization, but to look for upper and lower case How do you find them? Remember our best friends?

Flags 2 Flags change the output of a given command, but are different per command command ~]$ rm –f The rm command removes or deletes a file, the –f flag is ‘force’ and will remove without asking When run as the root user this will kill an entire system ~]$ tail –f messages The tail command shows the last 10 lines of a file, the –f flag is persistent follow so it will show updates to the file as they occur

Arguments cmd ~]$ ls –l /home/student ls is the command, -l is the flag, and /home/student/ is the argument In this case the argument is a directory path The argument could also be something we want to create ~]$ useradd ndillon This would add a new user (named ndillon) to the system

Commands So we have ls to ‘list’ what files are in our folder We can use cp to ‘copy’ files from one place to another cp teams.txt newfile cmd We can use rm to ‘remove’ our extra file rm newfile We can use less to look through files without changing them less teams.txt

More Commands We can use hostname to determine the name of the system we are on hostname We can use head and tail to look at the beginning/end of a file head pslist tail pslist We can get info on a file with the file command file script.sh We can show the differences between files with diff diff teams.txt teams2.txt

Even More Commands We can use echo to print things out to the command line echo “Hello!” echo $PATH We can print the system’s date with date We can use whereis and find to locate things on the system whereis ifconfig find / -name authlog

Final Group of Commands We can list users on a system with w, who, or finger w who finger We can display memory useage info with free We can make/restore backups of things with the tar command tar -cvf scratchspace.tar /tmp /home tar -xvvf scratchspace.tar

Command Flag Argument When typing on the shell, commands are always required Most other stuff will depend on what you want to do cmd tar -cvf backup.tar /home /tmp tar is the command, -cvf are flags (3), and the arguments (3) are the new file to create, as well as the two directories to back up

I Lied (One More Command) cmd useradd will allow us to add/change accounts and account details on a system useradd -d /home/newuser -s /bin/zsh newuser Cannot do useradd -ds /home/newuser /bin/zsh newuser Order matters with the useradd command! So what tells you the order, what is/isn’t required?

Practicals and Homework Questions on anything up to this point? Practicals Today and Monday everything will be for a completion grade (homework & practicals) After that, grades will be for accuracy

Topics For Own Study Keywords: Command, flag, argument Commands: ls, rm, tail, echo, diff, whereis, copy, cat Chapter 3 of Sobell Online Surrey Unix Tutorial for Beginners tutorials one and two Online Stanford tutorial – First two under intro section and first two under search section

VMWare You can get it for free! Go to: Click on the VMWare link Register with your SID as the username and fill out the remaining info Download/order software of your choosing