Introduction of Unix/Linux Compiled by Neeraj Goel Sonali Chouhan.

Slides:



Advertisements
Similar presentations
Linux, it's not Windows A short introduction to the sub-department's computer systems Gareth Thomas.
Advertisements

Learning Unix/Linux Bioinformatics Orientation 2008 Eric Bishop.
Introduction of Unix/Linux Compiled by Anant Vishnoi.
1 Introduction to UNIX Ke Liu
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.
Lecture 02CS311 – Operating Systems 1 1 CS311 – Lecture 02 Outline UNIX/Linux features – Redirection – pipes – Terminating a command – Running program.
Unix Workshop Aug What is Unix Multitasking, multiuser operating system Often the OS of choice for large servers, large clusters.
Introduction to Linux/UNIX. History UNIX beginnings in 1969 (Linus Torvalds is born!) AT & T Bell Laboratories (Ken Thompson & Dennis Richie) Working.
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.
Overview of Linux CS3530 Spring 2014 Dr. José M. Garrido Department of Computer Science.
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”
1 Intro to Linux - getting around HPC systems Himanshu Chhetri.
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.
Unix Basics Chapter 4.
CENT 305 Information Systems Security Linux Introduction.
Basic unix commands that everyone should know (Even if you have a mac) Slightly more advanced:
New Employee Indoctrination Chris Biddick Paul Grenz Jan 30, cjb, pg.
Introduction to Unix – CS 21 Lecture 9. Lecture Overview Shell description Shell choices History Aliases Topic review.
Carnegie Mellon Linux Boot Camp Jenna MacCarley, Peter Pearson, Shashank Goyal 9/19/2015.
PROGRAMMING PROJECT POLICIES AND UNIX INTRO Sal LaMarca CSCI 1302, Fall 2009.
Session 2 Wharton Summer Tech Camp Basic Unix. Agenda Cover basic UNIX commands and useful functions.
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.
Lesson 2-Touring Essential Programs. Overview Development of UNIX and Linux. Commands to execute utilities. Communicating instructions to the shell. Navigating.
Introduction to Programming Using C An Introduction to Operating Systems.
Basic of UNIX For fresh members of SPARCS
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.
More Unix Naomi Altman. Directories Directory = folder mkdir - makes a new directory rmdir - removes an empty directory cd mydirectory - moves you into.
1 CS3695/M6-109 – Network Vulnerability Assessment & Risk Mitigation – Introduction to Unix & Linux.
Linux A practical introduction. 1)Background and Getting Started Linux is an operating system with multiple providers Red Hat/CentOS (our version) Ubuntu.
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.
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.
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.
Using UNIX Charles Duan FAS Computer Services June 12, 2016.
INTRODUCTION TO SHELL SCRIPTING By Byamukama Frank
Using Linux Kaya Oğuz Room: 310.
Overview of Linux Fall 2016 Dr. Donghyun Kim
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.
EE516: Embedded Software Project 1
Development Environment Basics
slides created by Marty Stepp, modified by Josh Goodwin
Andy Wang Object Oriented Programming in C++ COP 3330
CSE 391 Lecture 3 bash shell continued: processes; multi-user systems; remote login; editors slides created by Marty Stepp, modified by Jessica Miller.
C151 Multi-User Operating Systems
Basic UNIX OLC Training.
Introduction to UNIX.
CSE 390a Lecture 3 bash shell continued: processes; multi-user systems; remote login; editors slides created by Marty Stepp, modified by Jessica Miller.
CSE 391 Lecture 3 bash shell continued: processes; multi-user systems; remote login; editors slides created by Marty Stepp, modified by Jessica Miller.
slides created by Marty Stepp, modified by Jessica Miller
Web Programming Essentials:
Introduction to Linux/UNIX
Andy Wang Object Oriented Programming in C++ COP 3330
CSE 390a Lecture 3 bash shell continued: processes; multi-user systems; remote login; editors slides created by Marty Stepp, modified by Jessica Miller.
slides created by Marty Stepp, modified by Jessica Miller
CSE 391 Lecture 3 bash shell continued: processes; multi-user systems; remote login; editors slides created by Marty Stepp, modified by Jessica Miller.
CSE 390a Lecture 3 bash shell continued: processes; multi-user systems; remote login; editors slides created by Marty Stepp, modified by Jessica Miller.
CSE 390a Lecture 3 bash shell continued: processes; multi-user systems; remote login; editors slides created by Marty Stepp, modified by Jessica Miller.
CSE 390a Lecture 3 bash shell continued: processes; multi-user systems; remote login; editors slides created by Marty Stepp, modified by Jessica Miller.
CSE 391 Lecture 3 bash shell continued: processes; multi-user systems; remote login; editors slides created by Marty Stepp, modified by Jessica Miller.
Linux Commands LINUX COMMANDS.
Presentation transcript:

Introduction of Unix/Linux Compiled by Neeraj Goel Sonali Chouhan

Plan Introduction to Unix/Linux Basic Utilities and Commands Programming in Unix/Linux Text formatting

Why another tutorial on Linux? To give you brief and quick introduction Motivations for new Linux users Something which is more specific to our department and labs Not a detailed description of commands, you have to relay on “man” pages Can be served as a quick reference material

Introduction to Unix/Linux as OS Kernel and shell –Kernel is one who all the job and shell is one with whome you interface. Better known as 'Command Line Interface' Multi-user –Each shell is a user for linux –You can open a shell from any other computer also – remote login

Introduction to Unix/Linux as OS Multi-tasking Linux directory structure »\ - Root directory »\home - Home directory »\usr\bin - Most commanly used binaries »\usr\local - Tools those are installed specifically in the machines, »better to have a look to see what is there in machine on which you are sitting Versions of linux –Fedora Core 2.0 – One of the stable linux –Fedora Core 7.0 – One of the latest version –Latest version doesn't means better!

Basic Commands and Utilities File Commands Home settings Network logins Backups Internet Miscellaneous

File Commands Unix directory structure revisited –'cd ~' change directory to your home –'cd ~sonali' change directory to sonali's home –'cd..' change directory to upper directory –'cd / ' change directory to root –Use tabs to complete the file name (write partial file name and then use tab)

File Commands Some other general commands –ls, list the files, –'-a' option means 'list all', will show hidden files as well –all filenames starting with. are hidden file –Other options you can try is '-l', '--color' –mkdir, making new directories –rm, removing a file –BEWARE!! There is no recycle bin in Unix –'rm -i' will ask “are you sure that you want to delete” –'rm -r' will do everything recursivily, '-f' force –rmdir, remove directory –'cp', means copy 'mv', means rename or move

File Commands Permissions – important for sharing your files and restricting access on your work –'chmod 755' => rwx rwx rwx (user group all) –'chmod a+r' => (u/g/a) ( +/ -) (r/w/x) ‘file’ utility tells type of file like text, word or pdf Helpful when extension is not given Important filters- (Best way to learn is use commands) –'grep word path/filename', grep find a word in a file –pipes ' | ' : redirect output of one command to other command –'more' or 'less' shows files pagewise ‘find’ and ‘locate’ utility help to find a file by filename –‘find –r path –name filename’ will find the location of file in given path. Useful command as we can use wild card pattern

Setting your home Different shells – sh, csh, bash, tcsh, ksh –‘csh’ more programmer friendly- default in Philips lab Different desktops – gnome, kde, windows-maker –Gnome or Kde more user friendly –Windows-maker – fast and simple Setting environment variables –alias, alias any command –setenv, sets the variable name –PATH, is a environment variable that is searched when you type a command. –MAN PATH –LD_LIBRARY_PATH, library search path –umask, default set the permissions of a new created file by you Your cshrc/bashrc – these files are executed when you open a new shell –For Philips Lab users: Copy ~neeraj/.cshrc to your home. Disk space limitation – quota, du –‘quota –v username’ will tell your status of quota –‘du –sh filename’ tells disk usage of a file

Using Network Unix to Unix- ssh, telnet ‘ssh’ is a secure shall, X-settings are default “ssh ‘su username’ switch user command used for switching user on same machine Unix to Winodws- rdesktop Rdesktop enables you to use windows terminal sitting on your linux system Windows to Unix – Xmanager, putty Tools like Xmanager help you to easily access linux from your hostel PCs Using ftp and ncftp ‘ftp machine’ then use ‘get’ or ‘put’ to get the file from machine or put the file one machine ‘ncftp –u user machine’ more interactive Using startx for new X terminal Cntrl + alt + (f1/f2/f3/f4), for new window in text mode For GUI desktop mode use ‘startx -- : 2’ (any number instead of 2) Cntrl + alt + f7 for previous locked window ‘wine’ and cygwin, wine is used for executing windows command on linux terminal and cygwin is a software windows software to execute most common linux commands on windows terminal

Backups Zip and Tar, gzip, gunzip Various extentions – Z, bz2, zip, gzip, tgz, tar.gz Tar oprtions c,x,z,v,f ‘c’ for compress, ‘x’ for expend, ‘z’ for zip, ‘v’ for verbose, ‘f’ force For compression ‘tar –czvf file.tar.gz./dirname For Decompression ‘tar –xzvf file.tar.gz’

Internet Tools- netscape, mozilla, firefox –Use tabs in mozilla –Proxy settings Edit -> preference -> advance -> proxy OR Tools -> Options -> Connection Settings Server name: pushpa( ), port: 8080 Use pine for mails: fast and easy for local mails –Configuring pine, »copy ~neeraj/.pinerc to your home and change to your login name replacing ‘neeraj’ in.pinerc file –In pine, all commands are given on bottom of editor

Miscellaneous Unix process – ps, fg, bg, kill, & ‘ps’ gives the list of processes ‘kill’ can kill a process, you have to write pid given by ps Writing ‘&’ in and of a command will force process to run in background ‘ctrl z’ for suspending a process, ‘ctrl c’ to kill a process ‘bg’ running a process in background ‘fg’ bringing a process in foreground Finger, who, rwho ‘finger’ gives list of user on a machine ‘finger username’ will give some details about user – name shell etc ‘finger will tell when user has last checked his mails ‘who’ gives all users on a macine ‘rwho’ gives all users on all the machines

Miscellaneous Use man and man –k Help for using any command Change password- ‘passwd’, ‘yppasswd’, ‘kpasswd’ ‘talk Try this when one of your friend is login on another machine. This you will feel better than yahoo or msn messenger Printing- lp, lpr ‘lpq’ for checking request queue on printer ‘ruptime’ gives list of all the machines and their load and number of users on each Help you in selecting machine on which you should login

LDAP, NIS, NFS NIS and LDAP –All user accounts are created and maintained on one machine (NIS server), other machines use this info. By creating account on NIS server you can login anywhere NFS –All HOME’s are on NFS server, all other machines “mount” it from there. Wherever you login, you see same files Know your servers –Intel Lab cluster servers: LDAP: bhairav, NFS: hpnas –Philips Lab cluster server: NIS and NFS: virat

Important Utilities ooffice: OpenOffice, for word, presentation, spreadsheets xfig, for drawing figures. Can be exported to eps, jpeg, gif or any format gimp - Viewing and editing images eog – (Eye of Gnome) for viewing images acroread – Acrobat reader for PDF files gnumeric - Spreadsheet viewer and editor in Linux Editors: vi, emacs, pico, gedit

Vi Editor Why vi, fast and easy Basic modes- edit and command, ‘esc’ for command mode ‘i, a’ for edit mode (insert or append mode) Other commands using colon- :q,:w,:q!,:e :q for quit, :w for write, :q! quit without save :e open another file for editing, :wq write and quit Searching using ‘/’ In command mode use ‘/’ then write the word you want to search ‘n’ for forward search, ‘N’ for backward search Search and replace :s/ram/mohan - will search string “ram” and replace with “mohan” Advanced vi – vim(vi improve) and gvim(gnu vim)

Programming in Unix Unix made by programmer for programming Gcc compiler – for ‘c’, g++ for ‘c++’ Various options, -O,-c,-g,-I ‘-O’ sets optimization level ‘-c’ only compile not link ‘-g’ for debug ‘-I’ for pre-processing only Linking with –l All the files are previously compiled and then linked by giving library information Debugger- gdb Use ‘gdb a.out’ for debugging

Other tools for programmers Kdevelope, glade – gui based C/C++ programming environment (like VC++ development environment) ‘ddd’ debugger. Makefile Makefile will have targets, prerequisite and commands Left of colon is target, right of colon is prerequisite, line next to target line is command Command line should be tabbed ‘make’ will execute target given by ‘all’ or first target, else specify your target in command line Make will resolve the dependencies recursively »All dependencies of a target should be resolved before executing its command

Example of a makefile CC=gcc COPTS= -g -Wall TARGET=run.x SRCS=hello.c junk.c OBJS=$(SRCS:.c=.o) all:$(OBJS) $(CC) $(COPTS) $(OBJS) -o $(TARGET) clean: rm -f $(OBJS) core %.o:%.c $(CC) $(COPTS) -c $<

Text formatting Using Latex –Text formatting in Linux –Advantage of latex Automated formatting in standard form Generation of index and cross-references Figures and mathematical formulas Bibliography –A latex template document given in my homepage:

Lab rules Keys issues If you have student keys of the lab then it must be returned next day in morning Lab timings Lab is open for you most of the time. But due to one key you have to coordinate in yourself to keep lab opened Discipline in the lab Don’t make noise in lab No eating drinking Labs are not for discussion in general that disturbs others No sharing of password, even with your project-mates Any mischief can lead to suspension of your account

Conclusion Self help is the best help! –The UNIX man pages “Manual sections” –Using man, whatis etc. –Experiment. You can never kill the system. Links – for GNU tools and manuals – Philips Lab. internal page – Intel cluster archives Books –The UNIX programming environment, Kernighan & Pike