Agenda Chapter 1: Linux (Unix) Features Commands (Chapters 2 & 3) Command Structure / Command line editing man, passwd, cal, date, whereis, which Working.

Slides:



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

Learning Unix/Linux Bioinformatics Orientation 2008 Eric Bishop.
Jump to first page Unix Commands Monica Stoica Jump to first page Introduction to Unix n Unix was born in 1969 at Bell Laboratories, a research subdivision.
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.
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
Linux+ Guide to Linux Certification, Second Edition
The Unix Shell. Operating System shell The shell is a command interpreter It forms the interface between a user and the operating system When you log.
UNIX Chapter 00 A “ Quick Start ” into UNIX Operating System Mr. Mohammad Smirat.
Guide To UNIX Using Linux Third 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.
Unix Filters Text processing utilities. Filters Filter commands – Unix commands that serve dual purposes: –standalone –used with other commands and pipes.
UNIX Filters.
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.
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.
Notes Assignment #1 is due next Friday by 11:59 pm via Test #1 will be held Thursday February 18 at the start of class (one period long) Format:
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 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.
Chapter 3 Mastering Editors
BIF703 Miscellaneous Commands. File related commands  grep - print lines matching a pattern  head - output the first part of files  tail - output the.
Chapter 3: Command Line Utilities Doin’ stuff. In this chapter … Special characters Redirection More utilities than you shake a stick at.
Agenda User Profile File (.profile) –Keyword Shell Variables Linux (Unix) filters –Purpose –Commands: grep, sort, awk cut, tr, wc, spell.
Unix Basics Chapter 4.
Title Slide CSS 404/504 The UNIX Operating System (2) By Ralph B. Bisland, Jr.
Jozef Goetz, expanded by Jozef Goetz, 2009 Credits: Parts of the slides are based on slides created by UNIX textbook authors, Syed M. Sarwar, Robert.
©NIIT Collaborate Lesson 1C / Slide 1 of 23 Collaborate Knowledge Byte In this section, you will learn to: Use the cal command Determine the file types.
System Administration Introduction to Unix Session 2 – Fri 02 Nov 2007 Reference:  chapter 1, The Unix Programming Environment, Kernighan & Pike, ISBN.
Week 3 Exploring Linux Filesystems. Objectives  Understand and navigate the Linux directory structure using relative and absolute pathnames  Describe.
UNIX Commands. Why UNIX Commands Are Noninteractive Command may take input from the output of another command (filters). May be scheduled to run at specific.
COMP1070/2002/lec4/H.Melikian COMP1070 Lecture #4  Unix software architecture  Correcting mistakes  System setups  Useful commands for the beginner.
Introduction to Unix (CA263) Getting Started By Tariq Ibn Aziz.
BIF713 Additional Utilities. Linux Utilities  You have learned many Linux commands. Here are some more that you can use:  Data Manipulation (Reg Exps)
Agenda Getting Started: Using Unix Unix Structure / Features Elements of the Unix Philosophy Unix Command Structure Command Line Editing Online Unix Command.
Chapter 0 A “Quick-Start” into the UNIX Operating System.
Lesson 2-Touring Essential Programs. Overview Development of UNIX and Linux. Commands to execute utilities. Communicating instructions to the shell. Navigating.
BIF713 Basic Unix/Linux Commands Getting Help with Commands.
Introduction to UNIX Geraint Vaughan. What is UNIX? Command-line operating system (not point- and click) Designed for ‘experts’ Lots of different variants.
Day 6 COP 3502 David A. Gaitros Department of Computer Science Florida State University.
Chapter Five Advanced File Processing. 2 Lesson A Selecting, Manipulating, and Formatting Information.
Agenda Basic Unix Commands (Chapters 2 & 3) Miscellaneous Commands: whereis, which, whoami, finger, passwd, cal, date Working with Files: cat, more, less.
Lesson 4-Mastering the Visual Editor. Overview Introducing the visual editor. Working in an existing file with vi. Understanding the visual editor. Navigating.
Introduction to Programming Using C An Introduction to Operating Systems.
Introduction to UNIX. 2 History of Unix  1960 Software based on Hardware Limits  1969 Ken Thompson Develop a Better Programming Environment  1971 New.
Agenda Basic Unix Commands (Chapters 2 & 3) Miscellaneous Commands: which, passwd, date, ps / kill Working with Files: file, touch, cat, more, less, grep,
Lesson 3-Touring Utilities and System Features. Overview Employing fundamental utilities. Linux terminal sessions. Managing input and output. Using special.
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.
CS 245 – Part 1 Using Operating Systems and Networks for Programmers Jiang Guo Dept. of Computer Science California State University Los Angeles.
Agenda The Bourne Shell – Part II Special Characters Ambiguous File Reference Variable Names and Values User Created Variables Read-only Variables (Positional.
Linux+ Guide to Linux Certification, Second Edition Chapter 4 Exploring Linux Filesystems.
BIF713 Introduction to Linux. Agenda Getting Started: Using Linux Unix and Linux - Structure / Features Elements of the Linux Philosophy Linux Command.
Learning basic Unix command It 325 operating system.
Lesson 6-Using Utilities to Accomplish Complex Tasks.
Agenda The Bourne Shell – Part I Redirection ( >, >>,
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.
UNIX Basics Matt Hayward October 18, 2016 LS560 – Information Technology for information professionals.
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.
Lesson 5-Exploring Utilities
Linux Commands Help HANDS ON TRAINING Author: Muhammad Laique
Some Linux Commands.
Agenda Basic Unix Commands (Chapters 2 & 3) Miscellaneous Commands:
INTRODUCTION TO UNIX: The Shell Command Interface
Tutorial Unix Command & Makefile CIS 5027
Presentation transcript:

Agenda Chapter 1: Linux (Unix) Features Commands (Chapters 2 & 3) Command Structure / Command line editing man, passwd, cal, date, whereis, which Working with Files: file, cat, more, less, grep, head, tail, cp, mv, ls sort, uniq, diff Communicating with Users who, talk, write, mesg, finger

Unix Structure The Linux operating system can be visualized in terms of layers: Unix Kernel controls the computer resources and schedules jobs Shell acts as a command interpreter that acts as an interface between users and the operating system Utilities (Commands) comprehensive set of utilities that are universally required by Unix administrators & users. Utilities are often referred to as commands

Linux Structure Hardware Linux Kernel The shell & other basic utilities Compilers Mail & message facilities Interpreters Database Mgmt System Formatters Editors Inventory control systems Spreadsheet applications Word processors Calendar systems

Utilities (Commands) For the remainder of this course, utilities and commands are considered the same. Linux commands are usually typed in lowercase followed by an argument (or arguments) Pressing ENTER or RETURN signals that you have completed giving an instruction and that you are ready for the OS to execute the command or respond to your message

Linux (Unix) Command Format command [arg 1] [arg 2] … [arg n] An argument is a filename, string or text, or some other object that a command acts upon An option is also an argument that modifies the effect of a command A space, a number of spaces, or a tab can be used to separate command from argument, or separate arguments.

Correcting Mistakes You can correct mis-typed command prior to pressing ENTER or RETURN Erase Characters Backspace or CTRL-Backspace or CTRL-h Delete a Word CTRL-w Delete an Entire Line CTRL-u

Correcting Mistakes Aborting Program Execution DELETE or CTRL-c Recalling Previous Commands Depends on shell &.profile setup Phobos (check.profile for VISUAL variable): if VISUAL=vi (K - up, J - down) if VISUAL=emacs Gothic: Up arrow, Down arrow

man A comprehensive online manual for common UNIX commands format: man [options] command Options: -k provides short (one-line) explanation relating to the commands matching the character string eg. man -k mkdir

passwd Used to change existing password format: passwd [options] Options: -f changes the user information accessed by the finger command

cal Used to display a calendar Format: cal [month] [year] (calendar for specified month & year) cal (displays calendar for current month) eg. cal (displays calendar month of December Year 2000)

date Used to display or set the time & date Format: date [option] [+format] +format argument specifies format of display After the + sign, can specify (within quotes) text as well as % followed by a field descriptor to indicate how date will be displayed

date Popular Field Descriptors: %A Full Weekday name %d Number of day %B Full month name %m Number of month %y Last 2 digits of year %Y 4-digit-year % I Hour %H Hour (Military time) %M Minutes %S Seconds %n New Line %r h:m:s with am or pm eg. date +”Today is %A” (note no space between + and “) %n is used to advance to the next line

whereis / which whereis is a utility that lists all directory paths that contains command or program For Example: whereis mv which is a utility that lists only the directory path that the shell will run the command or program (used to help avoid confusion if more that 1 command but perform differently. Example: which mv

Working with Files file, cat, more, less grep, head, tail cp, mv, ls sort, uniq, diff

file Used to classify the type of file: ASCII (text) or executable (binary) Format: file [options] file-list

cat Used to combine contents multiple files (“catenate” means to join together). Can be used to display contents of one file format: cat [options] [file-list] *Refer to on-line manual regarding options for cat command

more Displays a file, one screenful (spacebar) at a time or scroll one line at a time (RETURN) format: more [options] [file-list] Options: -d prompts user to continue at bottom of screen note: when searching for text within more process, user can type k/pattern? ENTER to initiate text search. In addition u for page up, d for down (can also use numbers to indicate amount of movement)

less Less is a program similar to more, but which allows backward movement in the file as well as forward movement (more movement options than more) Format: less [options] [file-list] Please refer to online manual for movement options

grep Used to search for a pattern which is stored in a file or files. Format: grep [options] pattern [file-list] Options: -c displays # of lines that contains a match -i ignores case sensitivity -n displays line number of file that contains a match -l displays only name of file that contains a match

head Display the beginning lines of a file format: head [-number] [file-list] * “-number” indicates the number of lines (from the beginning of the file) that you want to have displayed

tail Displays the tail or ending lines of a file format: tail [-number] [+number] [options] [file] * “-number” indicates the number of lines (from the bottom of the file) that you want to have displayed. “+number” indicates line number to display until end (tail) of file

cp Used to copy one or more files format: cp [options] sourcefile destinationfile Options: -r subdirectories & contents are copied -i prompts user to overwrite existing file

mv Used to move or rename files format: mv [options] oldfilename newfilename mv [options] existingfile-list directory mv [options] existingdirectory newdirectory Options: -i prompts user to overwrite existing file

ls Used to display information regarding a file or directory format: ls [options] [file-list] Options: -a short display of all files (incl. hidden files) -l detailed display of files (excl. hidden files) -al detailed display of all files -Fdisplays / after directory, * after executable file

sort Used to sort or merge files. Particularly useful as a filter to sort standard input. Format: sort [options] [field-specifier-list][file-list] Examples sort output.txt who | sort | more ls | sort > listing.txt

uniq Used to display lines from a file that are unique. Used after a sort, uniq will only display total “unique” lines of text uniq [options] [inputfile] [outputfile] Options: -c preceed line with # of occurrence line in input file -d display only lines that are repeated -u display only lines that are not repeated

diff Displays the differences between two files. Provides instructions as to editing steps to make files identical diff [options] [file1] [file2] diff [options] [directory1] [directory2] Options: -b ignore blanks

Communicating with Others who talk write mesg finger

who Used to display names of users logged into system Format: who [options] who or who am i or whoami Options: -H displays head above user information -i displays # of minutes user was idle -T displays message reception status

talk / write talk allows user to conduct a two-way text-based conversation. To initiate talk you type: talk phobos_user_id (use who -T to determine if user is receiving messages) write is used to send a message to another user. To send a message, type: write phobos_user_id (Mainly used to broadcast a message but can be used to chat - user who -T to check mesg status first)

mesg Used to “turn on” or “turn-off” reception of messages from other users. To turn on message reception status, type: mesg y To turn-off message reception status, type: mesg n

finger Used to display user names and related information format: finger [options] [user-list] Options: -l displays detailed information of all users -m matches names specified from user-list -q displays short report of users logged on -s displays a short report for each user incl.name

finger Interesting point: finger utility will display contents in file “.plan” and “.project” in the user’s home directory. These files are useful to provide additional information about the user eg. finger msaul (In phobos) finger jankul (In phobos) Note: you need to set the file permissons to allow group & others to read file!