Intro. To Unix commands For those who’ve never used Unix before Quick tutorial to let you move around your Unix Accounts No discussion of inner workings.

Slides:



Advertisements
Similar presentations
A Guide to Unix Using Linux Fourth Edition
Advertisements

Learning Unix/Linux Bioinformatics Orientation 2008 Eric Bishop.
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.
Dayu Zhang 9/8/2014 Lab02. Example of Commands pwd --- show your current directory This is home of venus, not your home directory Tilde: means you are.
CSCI 1411 FUNDAMENTALS OF COMPUTING LAB Lab Introduction 1 Shane Transue MSCS.
ECT 250: Survey of e-commerce technology Publishing pages on a Unix system.
Working Environment - - Linux - -.
Vi Editor TA for ITIS3100: Xu Fei
Chapter 5 Editing Text Files
CS 202 Computer Science II Lab Fall 2009 September 3.
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.
Starting Vi Opening an existing file vi filename Creating a new file vi filename In your workshop directory, create a new file called mysong vi mysong.
The Unix Environment and Compiling. Getting Set Up Your programs will be compiled and tested on the Departmental server ‘linprog’ The linprog servers.
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.
Using Linux Text Editors. Use Non-Graphical Linux Text Editors Graphical Text Editor.
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.
CHAPTER 1 UNIX FOR NONPROGRAMMERS By U ğ ur Halıcı.
1 Unix Text Editors Creating files on the Unix system.
Linux environment ● Graphical interface – X-window + window manager ● Text interface – terminal + shell.
Chapter 3 Mastering Editors
Unix Basics Chapter 4.
Chapter Three The UNIX Editors. 2 Lesson A The vi Editor.
AN INTRO TO UNIX/LINUX COMMANDS BY: JIAYANG WANG.
The UNIX development environment CS 400/600 – Data Structures.
Vim Editor and Unix Command gcc compiler Computer Networks.
UNIX Intro vi  vi is the standard UNIX text editor v Contents 1.Why use vi ? 2. vi Basics 3.Moving Around 4.Inserting Text.
COP3502: Introduction to Computer Science Yashas Shankar.
Next Unix Topics Tuesday, 2/11 & 18/2014. Change Password (by 2/14/14) ssh to account on – faclinux.cse.ohio-state.edu – stdlinux.cse.ohio-state.edu passwd.
Second edition Your UNIX: The Ultimate Guide Das © 2006 The McGraw-Hill Companies, Inc. All rights reserved. UNIX Commands cal – will print a calendar.
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 Editors. u Editors in Unix come in two general flavours: –modal editors have "modes" v generally input mode and command mode –input mode allows entry.
Tony Kombol.  Why text edit?  Many programs and features require configuration ▪ Configuration is kept in files ▪ Usually in the /etc directory  Changes.
Unix Session IV.
Basic Unix Commands CGS 3460, Lecture 6 Jan 23, 2006 Zhen Yang.
Unix and Samba By: IC Labs (Raj Kidambi). What is Unix?  Unix stands for UNiplexed Information and Computing System. (It was originally spelled "Unics.")
1 Remote Access Telnet Telnet FTP FTP. 2 Applications and Communications Telnet Telnet  Program for accessing systems remotely.  Available on Windows.
Text Editing February 2 nd, 2004 Class Meeting 3.
Chapter Three Text Editing1 System Programming Text Editing.
VI EDITOR University of Mississippi. Vi Editor What is Vi ? ▫Vi is a screen based editor. ▫The screen of your terminal will act as a window into the file.
Chapter 9 Using Text Editors. vi Editor visual Editor, ASCII text editor, no formatting capabilities almost as powerful as MS Word, has 26 clipboards.
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.
Chapter Three The UNIX Editors.
Linux Class #03. File Access Permissions Types of users in Linux: Local User (u) Group User (g) Other User (o) Each User can have 3 types of permissions:
Text editing and more basic commands CS 2204 Class meeting 3 *Notes by Doug Bowman and other members of the CS faculty at Virginia Tech. Copyright
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.
PTA Linux Series Copyright Professional Training Academy, CSIS, University of Limerick, 2006 © Workshop III - Part A Shell Commands Professional Training.
Intro. To Unix commands For those who’ve never used Unix before Quick tutorial to let you move around your Unix Accounts No discussion of inner workings.
Unix Servers Used in This Class  Two Unix servers set up in CS department will be used for some programming projects  Machine name: eustis.eecs.ucf.edu.
AN INTRO TO UNIX/LINUX COMMANDS BY: JIAYANG WANG.
 Last lesson, the Windows Operating System was discussed along with the Windows command shell  Unix is a computer operating system, that similarly manages.
ICE UNIX TUTORIAL. File System Commands cd – change directory cd – change directory ls – list contents ls – list contents rm – remove/delete rm – remove/delete.
Intro. To Unix commands For those who’ve never used Unix before Quick tutorial to let you move around your Unix Accounts No discussion of inner workings.
BIF703 FTP (File Transfer Protocol) Utility vi editor Utility.
By Justin Higgins. What is a text editor? If you’ve ever used Microsoft word you know what a text editor is (albeit a bloated one). When you write a program.
Assignprelim.1 Assignment Preliminaries © 2012 B. Wilkinson/Clayton Ferner. Modification date: Jan 16a, 2014.
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
Development Environment Basics
Vim basics Vi IMproved.
Web Programming Essentials:
Guide To UNIX Using Linux Third Edition
Nassau Community College
Vi Introduction Tony Kombol.
Lecture 3 More on editors: emacs and vi COP 3344 Introduction to UNIX.
Tutorial of Unix Command & shell scriptS 5027
Tutorial of Unix Command & shell scriptS 5027
Web Programming Essentials:
Tutorial of Unix Command & shell scriptS 5027
CSCI The UNIX System Editing files
Presentation transcript:

Intro. To Unix commands For those who’ve never used Unix before Quick tutorial to let you move around your Unix Accounts No discussion of inner workings of Unix –Take Operating Systems – CSCI-4210 Comparisons to Windows/DOS commands

What are the machines? rcs.rpi.edu – takes you to a random OS rcs-sun4.rpi.edu – takes you to a Sun machine –This is the machine to use for HW and ICA submissions, until we get CS accounts set up. rcs-ibm1.rpi.edu – takes you to an IBM machine You should have SecureCRT installed on your RPI laptop by default. If you don't, see the Helpdesk, or download puTTY (Google for it).

Very basics ‘ls’ - get directory listing –DOS: ‘dir’ ‘ls –l’ – get long file listing ‘cd ' – change directory ‘mkdir ’ – make directory –DOS: md ‘rm ’ – remove a file –DOS: ‘del’ ‘rmdir ’ – remove directory

More basics ‘more ’ – contents of a file –DOS: ‘type’ ‘cp ’ – copy a file –DOS: ‘copy’ ‘mv ’ – move a file –DOS: ‘move’

chmod Change mode (permissions) of file/directory using ‘ls –l’, 10 fields of information are shown ex: drwxrw-r— first position: ‘d’ (directory) or ‘-’ (file) next three: user permissions: –‘r’ – Read permissions –‘w’ – Write permissions –‘x’ – eXecute permissions next three: group permissions last three: world permissions

chmod continued permissions are represented as octal numbers rwxrwxrwx = = 777 rwxrw-r-- = = 764 rw = = 600 etc. chmod ex: chmod 755 script.plx –Give yourself all permissions, group and world read and execute permissions

User Friendly chmod Can specify modes without using octal representations. Still a 3 character code. –First char: u (user), g (group), o (other) –Second: + (add permissions) or - (remove permissions) –Third: r (read), w (write), x (execute) chmod u+x file.pl –give yourself execute permissions on file.pl chmod o+r file.pl –give others (ie, world) read permissions on file.pl

Windows vs Unix They don’t like each other. Many problems can (and will) arise due to difference in end-of-line character. –Unix: \n –Windows: \r\n –In Unix, a Windows \r can show up as ^M –In Windows, a Unix \n (missing the \r) can show up as a □ and no newline (at least in Notepad – Wordpad is mildly smarter) To change a file from Windows to Unix, use the command: –dos2unix –Ex: dos2unix oldfile > newfile –unix2dos also exists If you *ever* save a file in Windows and then transfer it to Unix, you should run dos2unix

Transferring files To get a file from your Windows PC to your Unix RCS account: Use an ftp client (ex: CuteFTP) or the default Windows ftp program –Ask Paul for help with this if you don’t know ftp –ftp address of RCS is ftp.rpi.eduftp.rpi.edu –Make sure you transfer in ASCII mode, not Binary!! Or use an SCP client (ex: WinSCP) –Download from –Connect to rcs.rpi.edu Avoid simply connecting to your network drive via Samba – this automatically transfers in binary mode, and you will need to run dos2unix

Creating a file in Unix Many options. Two most common: emacs and vi (“vee- eye”, not “vye” or “six”) –Which is ‘better’ is a cause of online holy wars Many many tutorials online to help you with either program There is an emacs reference card on the Definitions & Links page A third possibility is pico. This may be significantly easier for you if you've never edited a file on unix before. –All commands are shown on bottom of pico window To start a new file or edit an existing file, type name of editor followed by filename: –emacs file.pl –vi file.pl –pico file.pl

Beginning emacs shortcuts CTRL-X CTRL-F – open new or existing file CTRL-X S – prompt to save file CTRL-X CTRL-S – save file without prompt CTRL-X W – save file as CTRL-A – beginning of line CTRL-E – end of line CTRL-X CTRL-J – jump to line #.... CTRL-K – Cut to end of line CTRL-Y – Paste most recent cut ESC-X – many mini-buffer commands (replace, undo, search, etc (tab-complete for list) ) ESC-> – end of file ESC-< – beginning of file CTRL-G – quit mini-buffer (if you typo when typing a command) CTRL-X CTRL-C – Exit emacs

vi Commands ESC - leave insert/append/replace mode i - enter Insert mode at current position I - enter Insert mode line start a - enter Append mode at current position A - enter Append mode at line end r - replace single character at current position R - enter Replace mode at current position /foo - search forwards for "foo" ?foo - search backwards for "foo" w - move cursor to next word $ - move cursor to end of line ^ - move cursor to start of line x - delete current character dw - delete to end of word d$ - delete to end of line :w - write (save) file :wq - save file and quit :q - quit :q! - quit without saving changes

backspace If as you are editing your files, you find that your backspace key doesn't seem to work –either prints ^H or ^?, or emacs reacts as though you'd pressed CTRL-H edit your.bashrc file in your home directory to include this line: –stty erase ^H

For more help… If you find yourself unable to do something in this class because of a lack of familiarity with Unix, ask Paul. He’ll be happy to help.