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.

Slides:



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

Introduction of Unix/Linux Compiled by Anant Vishnoi.
NETW-240 Shells Last Update Copyright Kenneth M. Chipps Ph.D. 1.
Working with Files How to create, view, copy, rename and print files.
CIS 240 Introduction to UNIX Instructor: Sue Sampson.
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
1 Using Editors Editors let you create and edit ASCII files UNIX normally includes two editors: vi and Emacs Vi and Emacs are screen editors: they display.
T UTORIAL OF U NIX C OMMAND & SHELL SCRIPT S 5027 Professor: Dr. Shu-Ching Chen TA: Samira Pouyanfar Spring 2015.
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.
7/17/2009 rwjBROOKDALE COMMUNITY COLLEGE1 Unix Comp-145 C HAPTER 2.
A Mini UNIX Tutorial. What’s UNIX?  An operating system run on many servers/workstations  Invented by AT&T Bell Labs in late 60’s  Currently there.
CS 141 Labs are mandatory. Attendance will be taken in each lab. Make account on moodle. Projects will be submitted via moodle.
CSCI 330 T HE UNIX S YSTEM Editing files. E DITOR C ONCEPTS Editing a file is to modify the content of a file Text editor: Enter and modify text in a.
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”
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.
Working with Files Chapter 5. Display a Calendar Display a calendar for a specific month – cal Display a calendar for a specific year – cal 2000.
Linux environment ● Graphical interface – X-window + window manager ● Text interface – terminal + shell.
Unix Basics Chapter 4.
Cmsc 312 Operating Systems. UNIX? DOS – PC? VAX/VMS - mainframe Unix – PC, workstation, mainframe 1970 bell Lab For computer scientist? Why popular? Free.
CENT 305 Information Systems Security Linux Introduction.
The UNIX development environment CS 400/600 – Data Structures.
Vim Editor and Unix Command gcc compiler Computer Networks.
1 Editing a C Program 01/16/15. 2 Objective Use Linux to edit, compile and execute a C program.
Session 2 Wharton Summer Tech Camp Basic Unix. Agenda Cover basic UNIX commands and useful functions.
1 Operating Systems and Using Linux Topics What is an Operating System? Linux Overview Frequently Used Linux Commands Reading None.
BIF713 Basic Unix/Linux Commands Getting Help with Commands.
November 5, 2015CIS 118 Intro to UNIX What’s a Unix? Unix is an Operating System Designed for high-traffic usage Many variants –Linux, BSD: free versions.
Introduction to UNIX Geraint Vaughan. What is UNIX? Command-line operating system (not point- and click) Designed for ‘experts’ Lots of different variants.
Text editors Why should I use an editor ? It is very important to able to use at least one text mode editor a text mode editor is so useful on remote machines.
Unix and Samba By: IC Labs (Raj Kidambi). What is Unix?  Unix stands for UNiplexed Information and Computing System. (It was originally spelled "Unics.")
Text Editing February 2 nd, 2004 Class Meeting 3.
Chapter Three Text Editing1 System Programming Text Editing.
Linux and Java Basics. What is Linux? Operating system by Linus Torvalds that was a clone of Unix (thus Linux) Free and open source – this is the reason.
1May 16, 2005 Week 2 Lab Agenda Command Line FTP Commands Review More UNIX commands to learn File name expansion - * Introduction of vi.
Introduction to Unix (CA263) File Editing By Tariq Ibn Aziz.
Introduction to Programming Using C An Introduction to Operating Systems.
CS 245 – Part 1 Using Operating Systems and Networks for Programmers Jiang Guo Dept. of Computer Science California State University Los Angeles.
Vi editor Pronounced: `vee eye‘’. Agenda Describe the background of vi Editor Use vi editor to: create text files edit text files Our Goal is to create.
More on Using onyx 8/28/13. Program 1 Due a week from today. See website for details.
Linux+ Guide to Linux Certification, Second Edition Chapter 4 Exploring Linux Filesystems.
1 CS3695 – Network Vulnerability Assessment & Risk Mitigation – Introduction to Unix & Linux.
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.
CMSC 104, Version 8/061L03OperatingSystems.ppt Operating Systems and Using Linux Topics What is an Operating System? Linux Overview Frequently Used Linux.
CS 120 Extra: The CS1 Server Tarik Booker CS 120.
Learning Unix/Linux Based on slides from: Eric Bishop.
CMSC 104, Version 9/011 Operating Systems and Using Linux Topics What is an Operating System? Linux Overview Frequently Used Linux Commands Reading None.
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.
Tutorial of Unix Command & shell scriptS 5027
Getting started with CentOS Linux
Chapter 11 Command-Line Master Class
UNIX The Basics Source:
Andy Wang Object Oriented Programming in C++ COP 3330
Some Linux Commands.
The Command Prompt Commands are the way to “do things” in Unix
Tutorial of Unix Command & shell scriptS 5027
Tutorial of Unix Command & shell scriptS 5027
Operating Systems and Using Linux
Operating Systems and Using Linux
Tutorial of Unix Command & shell scriptS 5027
A Brief Overview of Unix
Getting started with CentOS Linux
Andy Wang Object Oriented Programming in C++ COP 3330
UNIX/LINUX Commands Using BASH Copyright © 2017 – Curt Hill.
Tutorial Unix Command & Makefile CIS 5027
Operating Systems and Using Linux
Operating Systems and Using Linux
Operating Systems and Using Linux
Presentation transcript:

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.

Interesting Note With MS Windows Server 2008 –One install option installs minimal GUI interface and no GUI applications/controls. DOS only, similar to SafeMode. –Everything is supposed to be able to done with the command line and scripting.

Login You can use ssh from the open labs –On IT labs and cosc labs, you can use the windows ssh X-terms: Log directly into the UNIX system using their windowing system. Linux: Gnome/KDE SUN: Common Desktop Environment (CDE) Changing your password –Frontier: passwd –Hive/cosc linux systems: yppasswd

Editors GUI editors –Emacs, Nedit –Many others. Non-GUI –vi (vim) The only editor a sys admin needs Simple yet very powerful, very little setup, works in a remote session. –pico The editor used by pine.

vi Operates in two modes –Command mode (default) When in input mode, press ESC key to get to command mode –Input mode When in command mode, press i key to get to input mode (several other ways as well) Defaults to full screen mode, but when not able it functions as a line editor If arrow keys don’t work, use h(left), l (right), j (down), k (up) in command mode Insert mode, keys act like normal. –press i, then type normally. When finished press ESC key.

Command mode commands (case sensitive) –x deletes current character –r replace current letter, R replace until ESC is pressed –dw deletes from current position to end of word –dd deletes current line –You can only exit vi from command mode –:wq or ZZ save the file and exit –:q! exit without saving. Also has cut and past, search and replace, and “wild card” search and replace The just enough UNIX book has lot of the commands –Chapter 14 has an great tutorial for vi. as well as man pages. man vi

File Management Remember UNIX is hierarchical –ls  lists contents of current directory –cat  lists contents of a file –more or less  same as cat, only 1 page at a time –rm  deletes a file from the directory Directories are just special files Can be edited, but DON’T do it. –mkdir  create a directory specified directory –rmdir  removes the specified directory –cd  change directory –pwd  tells you what your current working directory is

. represents the current directory.. represents the parent directory./x same as x../x not the same as x../x same as cd..;./x cd.. changes to the parent directory You can always specify the path in UNIX –/a/d/mx.exe is an absolute pathname –../a/d/mx.exe is a relative pathname

Other File commands cp a b  copy file a to b mv a b  renames file a to b mv a../b  moves file a to the parent directory as b You can use wildcards to specify multiple files –* matches 0 or more characters in the filename –cp *.exe../. cp a*.exe cp add.*../. –? matches a single character, so –cp ?dd.exe../. but not dd.exe

Other commands finger talk write –mesg n –mesg y w whereis which grep X head tail

Printing lpr prints file to default printer lpr –Pen4059 prints to laser printer in 4059 lpq lists the queue of files to be printed (default printer) lpq –Pen4059 lists files to be printed to 4059 lprm –Pen4059 # removes print # from queue lprm –Pen4059 removes first job from queue lpc status lists the status of all printers lpc status en4059 lists only the 4059 printer

Pipes and redirection cat x.txt >y.txt copies x.txt into y.txt cat x.txt >>y.txt appends x.txt into y.txt ls >y.txt lists directory info into y.txt cat <x.txt works like cat x.txt mail bozo <x.txt mails the file x.txt to bozo cat >new.txt control-D or sometimes. and return puts all the text into the file

Getting help On-line documentation –man (stands for manual) –man man (help on using help) –man ls (help on the ls command) Man pages can be cryptic at times, but very useful.

Other commands UNIX has dozen of commands, I haven’t covered. –Some we will cover as part of the system admin and learn in labs. –You can always look through the Sobell book for more commands. –Some commands don’t work on all UNIX flavors. –vi commands are standard but there are “extra” commands with vim, which may not work on other UNIX/Linux versions.

Q A &