Agenda Basic Unix Commands (Chapters 2 & 3) Miscellaneous Commands:

Slides:



Advertisements
Similar presentations
RH030 Linux Computing Essentials
Advertisements

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.
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
CSE 303 Lecture 2 Introduction to bash shell
UNIX Chapter 00 A “ Quick Start ” into UNIX Operating System Mr. Mohammad Smirat.
Guide To UNIX Using Linux Third Edition
T UTORIAL OF U NIX C OMMAND & SHELL SCRIPT S 5027 Professor: Dr. Shu-Ching Chen TA: Samira Pouyanfar Spring 2015.
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 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.
Linux Commands LINUX COMMANDS.
L INUX C OMMAND L INE I NTERFACE G UNAANBAN.G
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.
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.
Chapter Four UNIX File Processing. 2 Lesson A Extracting Information from Files.
Guide To UNIX Using Linux Fourth Edition
Agenda Chapter 1: Linux (Unix) Features Commands (Chapters 2 & 3) Command Structure / Command line editing man, passwd, cal, date, whereis, which Working.
Linux+ Guide to Linux Certification, Second Edition
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.
Linux+ Guide to Linux Certification, Third Edition
Guide to Linux Installation and Administration, 2e1 Chapter 7 The Role of the System Administrator.
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.
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.
Lesson 2-Touring Essential Programs. Overview Development of UNIX and Linux. Commands to execute utilities. Communicating instructions to the shell. Navigating.
Second edition Your UNIX: The Ultimate Guide Das © 2006 The McGraw-Hill Companies, Inc. All rights reserved. UNIX Commands cal – will print a calendar.
BIF713 Basic Unix/Linux Commands Getting Help with Commands.
Agenda Basic Unix Commands (Chapters 2 & 3) Miscellaneous Commands: whereis, which, whoami, finger, passwd, cal, date Working with Files: cat, more, less.
Introduction to Programming Using C An Introduction to Operating Systems.
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.
Linux+ Guide to Linux Certification, Second Edition Chapter 4 Exploring Linux Filesystems.
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.
CMSC 104, Version 9/011 Operating Systems and Using Linux Topics What is an Operating System? Linux Overview Frequently Used Linux Commands Reading None.
Tutorial of Unix Command & shell scriptS 5027
Lesson 5-Exploring Utilities
Getting started with CentOS Linux
Chapter 11 Command-Line Master Class
Linux Commands Help HANDS ON TRAINING Author: Muhammad Laique
Some Linux Commands.
C151 Multi-User Operating Systems
The Command Prompt Commands are the way to “do things” in Unix
Shell Script Assignment 1.
Assignment Preliminaries
CSE 374 Programming Concepts & Tools
INTRODUCTION TO UNIX: The Shell Command Interface
Tutorial of Unix Command & shell scriptS 5027
Tutorial of Unix Command & shell scriptS 5027
Guide To UNIX Using Linux Third Edition
Unix : Introduction and Commands
Operating Systems and Using Linux
Tutorial of Unix Command & shell scriptS 5027
Chapter Four UNIX File Processing.
Getting started with CentOS Linux
Tutorial Unix Command & Makefile CIS 5027
Linux Shell Script Programming
Module 6 Working with Files and Directories
Linux Commands LINUX COMMANDS.
LPI Linux Certification
Presentation transcript:

Agenda Basic Unix Commands (Chapters 2 & 3) Miscellaneous Commands: whereis, which, passwd, cal, date, ps / kill Working with Files: file, touch, cat, more, less, grep, head, tail, cp, mv, ls sort, uniq, diff Communicating with Users who, finger, talk, write, mesg

Textbook Coverage These slides are based on Chapter 3 of “A Practical Guide to Linux” Read pages 41 to 57 6

Miscellaneous Commands whereis which passwd cal date ps / kill

whereis / which whereis is a utility that lists all directory paths that contain binary files for a command and directory paths for manuals for a command. For Example: whereis mv which is a utility that lists only one directory path of the command that the shell will run when the user issues the command from the shell prompt. For Example: which cp

passwd A user can change their account password by issuing passwd command at shell prompt. The user will be prompted for their current password and then be prompted for new password and confirmation. Options: -f changes the user information that is stored in the /etc/passwd file along with user's password

cal The cal command without options displays only the current month. The cal command with year as an argument displays the entire year's calendar. The cal command with arguments month followed by year displays the specific month for specific year. Examples: cal 2002 (displays all months for year 2002) cal 9 1947 (displays only month of September 1947)

date The date command is used to display the current date and time. Example: date Note: If you have superuser or "root" access, you can change the computer system's date and time.

ps / kill As mentioned in last week’s notes, the Unix OS continually runs processes (jobs). The ps command is used to provide status information regarding processes such as PID (process I.D. number). The kill command can be used to terminate process number (eg. kill [PID] or kill –9 [PID]) Options: -l Provides detailed process status info (eg parent PID) -a Provides process status info for entire system -al Provides detailed info for all processes

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

file The file command is used to identify a type of file (for example, whether the file is an ASCII (text), executable file, graphics file, MS- PowerPoint file, a directory file, etc...). This command is useful if file does not contain an extension and therefore is hard to identify. Example: file try_me (Identifies the file type of "try_me")

touch The touch command is used to create empty files. This command is useful to create empty files to be edited later with content. Another use for this command is to create empty files in order to practise using Unix commands that may require a filename such as ls, cp, mv, etc… Example: touch file1 file2 file3 (Creates 3 files in current directory)

cat The cat command is used to combine the contents of multiple files (“catenate” means to join together). This command can be used to display contents of small files (that will fit on your terminal's display screen). Example: cat hello.c (displays contents of c program "hello.c")

more The more command displays a file, one screenful at a time. Example: more large_file Movement keys (within more command): <spacebar> Move to next screen b Move to previous screen <enter> Move to next line /car Search for pattern "car" q Exit to shell

less The less command is similar to more command, but "less" command contains more movement and search commands than "more" command. Example less large_file Note: You are not required to learn "less" command for this course, but if you are interested in using this command, you can refer to online manual.

grep The grep command is used to search for a pattern whether contained in files or from other forms of input (eg. keyboard). Example: grep "frog" data (matches lines in file called "data" that contain pattern "frog") Options: -c displays # of lines that contain a match -i ignores case sensitivity -v displays lines that do not match the pattern

head The head command displays the beginning lines of a file. This command is useful to identify any heading information of a file. example: head fname (displays the first 10 lines of "fname") Options: -n displays the first "n" number of lines

tail The tail command displays the ending lines of a file. This command is useful for viewing files that continually add information to the bottom of a file such as log files (eg. Last person to logon, or last system message). Example: tail fname (views the last 10 lines of "fname") Options: -n displays the last "n" number of lines +n displays all lines from line "n" to the end of the file

cp The cp command is used to copy one or more files between directories, or to make backup copies of files within the same directory. Example: cp /public/ipc144/hw.c /home/msaul/ (copies file "hw.c" from “/public/ipc144" directory to msaul's home directory) Options: -R subdirectories & contents are copied -i prompts user to overwrite existing file

mv The mv command is used to move or rename files. Examples: mv hw.c work (moves file "hw.c" from current directory to subdirectory called "work”, assuming directory “work” exists) mv hw.c hello.c (renames file "hw.c" in current directory to "hello.c”) Options: -i prompts user to overwrite existing file

ls The ls command is used to display information regarding a file or directory. Example: ls (Displays a compact listing (i.e. filenames only) contained in current directory) Options: -a short display of all files (incl. hidden files) -l detailed display of files (excl. hidden files) -al detailed display of all files -F displays / after directory, * after executable file

sort The sort command is used to sort or merge files. Particularly useful as a filter to sort standard input. Example: sort fname (alphabetically sorts (in ascending order) the contents of "fname") Options: -r sorts in reverse (descending order) -n sort numerically -kn Sorts by column number "n" -u sorts and only displays unique lines

uniq The uniq command is used to display lines from a file that are unique. Used after a sort, uniq will only display unique lines of text Example: uniq fname (Displays unique lines from file "fname“, eliminating duplicate adjacent lines)

diff Example: diff file1 file2 The diff command displays the differences between two files. If there are no differences in the files, there is no display. If there is a display the command provides instructions on how to make the first file identical to second file. Example: diff file1 file2

Communicating with Others who finger talk write mesg

who Used to display names of users logged into system. Example: who Options: -H displays headings above user information -i displays # of minutes user was idle -T displays message reception status

finger Used to display user names and related information. Example: finger jsmith (Will provide information regarding user "jsmith") Options: -l displays detailed information of all users

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 - use who -T to check mesg status first) NOTE: The talk command may be disabled for the Phobos and Matrix servers..

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