Administration Utilities Objectives –to use standard administration utilities Contents –manual pages –identifying your system –communicating with Users.

Slides:



Advertisements
Similar presentations
POS/420 Philip Robbins – March 19, 2013 (Week 2) University of Phoenix Mililani Campus Introduction to Unix.
Advertisements

CS 497C – Introduction to UNIX Lecture 5: Understanding the UNIX Command Chin-Chih Chang
RH030 Linux Computing Essentials
การใช้ระบบปฏิบัติการ UNIX พื้นฐาน บทที่ 4 File Manipulation วิบูลย์ วราสิทธิชัย นักวิชาการคอมพิวเตอร์ ศูนย์คอมพิวเตอร์ ม. สงขลานครินทร์ เวอร์ชั่น 1 วันที่
Chapter One The Essence of UNIX.
Unix. Outline Commands Environment Variables Basic Commands CommandMeaning lslist files and directories ls -alist all files and directories mkdirmake.
NETW-240 Shells Last Update Copyright Kenneth M. Chipps Ph.D. 1.
Chapter 8 Files and User Information Utilities. Logical Partitions referred to as file systems like a drive in windows world $ df (display filesystems)
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
UNIX Chapter 00 A “ Quick Start ” into UNIX Operating System Mr. Mohammad Smirat.
Guide To UNIX Using Linux Third Edition
Lecture 02CS311 – Operating Systems 1 1 CS311 – Lecture 02 Outline UNIX/Linux features – Redirection – pipes – Terminating a command – Running program.
Introduction to Linux and Shell Scripting Jacob Chan.
1. This presentation covers :  User Interface Administration  Files System and Services Management 2.
BILKENT UNIVERSITY DEPARTMENT OF COMPUTER TECHNOLOGY AND INFORMATION SYSTEMS CTIS156 INFORMATION TECHNOLOGIES II CHAPTER 10: ADVANCED FILE PROCESSING.
COMP1070/2002/lec4/H.Melikian COMP1070 Lecture #5  Files and directories in UNIX  Various types of files  File attributes  Notion of pathname  Commands.
Manage Directories and Files in Linux
Lesson 7-Creating and Changing Directories. Overview Using directories to create order. Managing files in directories. Using pathnames to manage files.
Lesson 11-Locating, Printing, and Archiving User Files.
BIF703 Miscellaneous Commands. File related commands  grep - print lines matching a pattern  head - output the first part of files  tail - output the.
Agenda User Profile File (.profile) –Keyword Shell Variables Linux (Unix) filters –Purpose –Commands: grep, sort, awk cut, tr, wc, spell.
Unix Basics Chapter 4.
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 Chapter Four Exploring Linux Filesystems.
Linux+ Guide to Linux Certification, Third Edition
Isecur1ty training center Presented by : Eng. Mohammad Khreesha.
UNIX and Shell Programming (06CS36) Unit 1 Continued… Shrinivas R. Mangalwede Department of Computer Science and Engineering K.L.S. Gogte Institute of.
Additional UNIX Commands. 222 Lecture Overview  Multiple commands and job control  More useful UNIX utilities.
INTRODUCTION TO LINUX Jacob Chan. GNU/Linux Consists of Linux kernel, GNU utilities, and open source and commercial applications Works like Unix –Multi-user.
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.
Module 6 – Redirections, Pipes and Power Tools.. STDin 0 STDout 1 STDerr 2 Redirections.
Course materials may not be reproduced in whole or in part without the prior written permission of IBM. 5.1 © Copyright IBM Corporation 2008 Unit 10 Linux.
Agenda Regular Expressions (Appendix A in Text) –Definition / Purpose –Commands that Use Regular Expressions –Using Regular Expressions –Using the Replacement.
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.
Administration Utilities Objectives –to use standard administration utilities Contents –manual pages –identifying your system –communicating with Users.
BIF713 Additional Utilities. Linux Utilities  You have learned many Linux commands. Here are some more that you can use:  Data Manipulation (Reg Exps)
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.
ITR3 lecture 6: intoduction to UNIX Thomas Krichel
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.
Chapter Four I/O Redirection1 System Programming Shell Operators.
UNIX An Introduction. Brief History UNIX UNIX Created at Bell Labs, 1969 Created at Bell Labs, 1969 BSD during mid 70s BSD during mid 70s AT&T began offering.
Introduction to Linux Instructor: Bennett M. Tanyag PART – 3 Unit 1.
User Environments Objectives –to provide appropriate environments for different types of users Contents –different login programs –user profiles –restricted.
Basic of UNIX For fresh members of SPARCS
Manage Directories and Files in Linux Part 2. 2 Identify File Types in the Linux System The file types in Linux referred to as normal files and directories.
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)
2 Manual & Filestore Mauro Jaskelioff. Introduction Using the manual The UNIX filestore File permissions.
CS 245 – Part 1 Using Operating Systems and Networks for Programmers Jiang Guo Dept. of Computer Science California State University Los Angeles.
Module 1 - Introduction to Linux. Users must log-in Linux is case sensitive File and Directories naming conventions (No spaces!) Files and Directories.
Why UNIX? In the 1980s, UNIX became popular In the 1980s, UNIX became popular Customer demand for open systems: Customer demand for open systems: Application.
CSC414 “Introduction to UNIX/ Linux” Lecture 6. Schedule 1. Introduction to Unix/ Linux 2. Kernel Structure and Device Drivers. 3. System and Storage.
Linux+ Guide to Linux Certification, Second Edition Chapter 4 Exploring Linux Filesystems.
Lecture 02 File and File system. Topics Describe the layout of a Linux file system Display and set paths Describe the most important files, including.
A Brief Overview of Unix Brandon Bohrer. Topics What is Unix? – Quick introduction Documentation – Where to get it, how to use it Text Editors – Know.
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.
Agenda The Linux File System (chapter 4 in text) Directory Structures / Navigation Terminology File Naming Rules Relative vs Absolute pathnames Unix Commands:
Lesson 5-Exploring Utilities
Linux Commands Help HANDS ON TRAINING Author: Muhammad Laique
Agenda Basic Unix Commands (Chapters 2 & 3) Miscellaneous Commands:
Unix Operating System (Week Two)
CSE 374 Programming Concepts & Tools
Module 5 Getting Help.
UNIX and Shell Programming (06CS36)
UNIX and Shell Programming (06CS36)
Review.
Presentation transcript:

Administration Utilities Objectives –to use standard administration utilities Contents –manual pages –identifying your system –communicating with Users –finding files –looking at files and logs –system defaults –Syslog –Logrotate –logserver Practicals –to become familiar with these commands Summary

On-Line Manuals $ man man $ man 1 intro $ man passwd $ man 4 passwd $ man man $ man 1 intro $ man passwd $ man 4 passwd On-line manuals in many sections: May vary on systems 1user commands4 file formats (8)1Mmaintenance commands5 miscellaneous 2system calls6 games 3functions and libraries7 special files man command displays first manual page found –some systems display all matched pages –add section number before command name to man command line Some systems provide a whatis database (originally BSD) –whatis command one line description of command –apropos command keyword search for command –/usr/ucb/catmanre-creates database from manual source files

Identifying the Unix System The uname command (uname) shows system information –the command hostname also identifies the current host options -aall information -nsystem name (nodename on network) -sO/S name -rO/S release number -vO/S version number -mmachine hardware -pprocessor type $ uname -a SunOS mash generic sun4c sparc $ hostname mash4077 $ uname -a SunOS mash generic sun4c sparc $ hostname mash4077

Identifying active users The who command shows who is currently logged on –information kept in /var/adm/utmp –a history of every login is also kept in /var/adm/wtmp Who can also be used to identify the current user who am i The command id also identifies the current user some systems also have a w command (originally BSD) $ who trapper pts001 Jul 25 11:01 hawkeye console Jul 25 11:31 $ who am i hawkeye console Jul 25 11:31 $ id uid=318(hawkeye) gid=300(users) $ who /var/adm/wtmp history of all system logins $ who trapper pts001 Jul 25 11:01 hawkeye console Jul 25 11:31 $ who am i hawkeye console Jul 25 11:31 $ id uid=318(hawkeye) gid=300(users) $ who /var/adm/wtmp history of all system logins

Talking to users Use write to display a message on a user's terminal –user's can disable messages using mesg n command –root can always write to a user Write all (wall) will display to all logged in users –useful for sending out broadcasts –used by the system shutdown mechanism Use the talk command to set up a two way dialogue. Use the telephone $ write trapper Do you know where the system logbook is? ^D $ mesg is no $ mesg y $ write trapper Do you know where the system logbook is? ^D $ mesg is no $ mesg y $ talk trapper

Finding Files The find command locates files using specified search criteria find directories... search_criteria... action Search Criteria: -name name finds only files called name (can use shell wildcards) -user name finds only files owned by user name -type letter finds files of specified type:f (plain files) d (dirs), etc. -mtime n finds files modified n days ago, less than (-n ), greater than (+n ) -size n[c|K] finds files of size n, larger than (+n ), smaller than (-n ), c=chars, K=kilobytes (when omitted, 512 block size is implied) -newer pathname finds files newer than specified file -mount don't cross disk boundaries Action: -print print filenames found -exec cmd {} \; executes given command (filename will be given in place of {}) -ok cmd {} \; executes command but prompts for confirmation

Exercise - Revision Of Using find What do the following find commands mean? # find. -print # find /etc -type d -print # find /home -name.profile -exec pg {} \; # find /dev -type f -mtime -7 -exec ls -l {} \; # find /sbin /usr/sbin -name "user*" -exec ls -ld {} \; # find. -print # find /etc -type d -print # find /home -name.profile -exec pg {} \; # find /dev -type f -mtime -7 -exec ls -l {} \; # find /sbin /usr/sbin -name "user*" -exec ls -ld {} \;

The grep Family All grep commands provide pattern matching criteria for filtering lines containing a pattern fgrep [ options ] pattern [ files... ] –fgrep uses fixed (simple patterns) grep [ options ] pattern [ files... ] –grep uses "regular expressions" to define powerful pattern matching templates egrep [ options ] pattern|pattern [ files... ] –egrep uses extended regular expressions, allows multi-pattern search common options -v output non-matched lines -c output count of lines matched -i ignore lower/upper case -n mark each matched line with its relative line number

Exercise - Revision Of Using grep Always using single quotes round grep regular expression What do the following grep commands mean? # ls -l | grep '^d' # grep 'ksh$' /etc/passwd # ls -a | grep '^\.[^.]' # fgrep root /var/adm/sulog # who | egrep '(hawkeye|trapper)' # ls -l | grep '^d' # grep 'ksh$' /etc/passwd # ls -a | grep '^\.[^.]' # fgrep root /var/adm/sulog # who | egrep '(hawkeye|trapper)'

Looking Inside Files Use the file command to identify a file type Then for: Text files: use pg or more to look at the file Data files: use octal dump (od) –some systems supply a hex dump (hd) program –use the -c option to characters where possible Use the strings command to list ASCII strings in a data file # file * feed.dat: ASCII text myprog: iAPX 386 executable not stripped myprog.c: C source code runsys: commands text x.jpeg: data # od -c x.jpeg | pg # file * feed.dat: ASCII text myprog: iAPX 386 executable not stripped myprog.c: C source code runsys: commands text x.jpeg: data # od -c x.jpeg | pg

Inspecting Log Files Use a pager such as less or more –can be slow when working with large log files Use grep to look for particular words Use the tail command to look at the last few lines –if the log file is growing than use the -f option Use view (vi read only) to read the whole file Whatever method you choose: DO LOOK AT LOG FILES # tail /var/messages SU 07/17 23:47 + console root-lp SU 07/18 00:37 - console alina-root # tail /var/messages SU 07/17 23:47 + console root-lp SU 07/18 00:37 - console alina-root

System Default Files & logbooks RedHat sysconfig /etc/sysconfig/ –Redhat specific setup and boot files General linux config /etc/ –Many files, system wide configs Adduser enviroment /etc/default –When adding users, this apply in first line –Also /etc/skel is added to user enviroment RedHat system logbooks Undependent of syslog: /var/log/maillog : Mail /var/log/httpd/access_log : Apache web server page access logs RedHat log catalog standards: /var/log/messages: (SYSLOG) Systems services & hardware log /var/log/samba/ : Samba messages /var/log/secure : Login details, ftp, pop, imap and so on.. /var/log/vsftpd : Very secure ftp server