System Administration

Similar documents
Command-line interpreters

UNIX Quick Reference

Computer Systems and Architecture

Computer Systems and Architecture

Useful Unix Commands Cheat Sheet

Table of contents. Our goal. Notes. Notes. Notes. Summer June 29, Our goal is to see how we can use Unix as a tool for developing programs

Linux Command Line Primer. By: Scott Marshall

CSE 390a Lecture 2. Exploring Shell Commands, Streams, Redirection, and Processes

Processes. Shell Commands. a Command Line Interface accepts typed (textual) inputs and provides textual outputs. Synonyms:

CSCI 2132 Software Development. Lecture 5: File Permissions

Files and Directories

Introduction to Linux

Unix Processes. What is a Process?

Unix/Linux Basics. Cpt S 223, Fall 2007 Copyright: Washington State University

Introduction to the Linux Command Line January Presentation Topics

3/8/2017. Unix/Linux Introduction. In this part, we introduce. What does an OS do? Examples

Perl and R Scripting for Biologists

Lab 2: Linux/Unix shell

Connecting to ICS Server, Shell, Vim CS238P Operating Systems fall 18

Part 1: Basic Commands/U3li3es

Lec 1 add-on: Linux Intro

Introduction to Linux Organizing Files

elinks, mail processes nice ps, pstree, top job control, jobs, fg, bg signals, kill, killall crontab, anacron, at

Introduction to Linux

Introduction to Linux

CSCI 2132 Software Development. Lecture 4: Files and Directories

M2PGER FORTRAN programming. General introduction. Virginie DURAND and Jean VIRIEUX 10/13/2013 M2PGER - ALGORITHME SCIENTIFIQUE

Introduction To. Barry Grant

Linux crash lecture by Andrey Lukyanenko

elinks, mail processes nice ps, pstree, top job control, jobs, fg, bg signals, kill, killall crontab, anacron, at

Introduction to UNIX. Introduction EECS l UNIX is an operating system (OS). l Our goals:

Chap2: Operating-System Structures

Using UNIX. -rwxr--r-- 1 root sys Sep 5 14:15 good_program

EECS 2031E. Software Tools Prof. Mokhtar Aboelaze

UNIX. The Very 10 Short Howto for beginners. Soon-Hyung Yook. March 27, Soon-Hyung Yook UNIX March 27, / 29

ScazLab. Linux Scripting. Core Skills That Every Roboticist Must Have. Alex Litoiu Thursday, November 14, 13

CS370 Operating Systems

The UNIX Shells. Computer Center, CS, NCTU. How shell works. Unix shells. Fetch command Analyze Execute

Introduction: What is Unix?

Introduction to Unix The Windows User perspective. Wes Frisby Kyle Horne Todd Johansen

Shells. A shell is a command line interpreter that is the interface between the user and the OS. The shell:

Processes. System tasks Campus-Booster ID : **XXXXX. Copyright SUPINFO. All rights reserved

CSE 303 Lecture 2. Introduction to bash shell. read Linux Pocket Guide pp , 58-59, 60, 65-70, 71-72, 77-80

Recap From Last Time:

CSE 390a Lecture 2. Exploring Shell Commands, Streams, and Redirection

Introduction to remote command line Linux. Research Computing Team University of Birmingham

The Unix Shell. Pipes and Filters

Basic UNIX commands. HORT Lab 2 Instructor: Kranthi Varala

BGGN 213 Working with UNIX Barry Grant

TestOut Linux Pro - English 4.0.x OBJECTIVE MAPPING: CompTIA Linux+ LX0-103

CSC209H Lecture 1. Dan Zingaro. January 7, 2015

QUESTION BANK ON UNIX & SHELL PROGRAMMING-502 (CORE PAPER-2)

bash, part 3 Chris GauthierDickey

Virtual Machine. Linux flavor : Debian. Everything (except slides) preinstalled for you.

When talking about how to launch commands and other things that is to be typed into the terminal, the following syntax is used:

Chapter 1 - Introduction. September 8, 2016

Introduction to the shell Part II

Lecture-4. Introduction to Unix: More Commands, Boot-up Actions and X Window

UNIX System Programming Lecture 3: BASH Programming

CSE Linux VM. For Microsoft Windows. Based on opensuse Leap 42.2

The Unix Shell & Shell Scripts

Files

Running Programs in UNIX 1 / 30

(MCQZ-CS604 Operating Systems)

CS 3410 Intro to Unix, shell commands, etc... (slides from Hussam Abu-Libdeh and David Slater)

Linux Essentials. Programming and Data Structures Lab M Tech CS First Year, First Semester

Introduction to Linux

EECS2301. Lab 1 Winter 2016

Getting Started With UNIX Lab Exercises

unix intro Documentation

System Programming. Introduction to Unix

Intro to Linux. this will open up a new terminal window for you is super convenient on the computers in the lab

CS4350 Unix Programming. Outline

File permission u owner of file/directory (user) g group of the file/directory o other a all

Linux Shell Script. J. K. Mandal

Introduction to Unix: Fundamental Commands

DATA 301 Introduction to Data Analytics Command Line. Dr. Ramon Lawrence University of British Columbia Okanagan

Why learn the Command Line? The command line is the text interface to the computer. DATA 301 Introduction to Data Analytics Command Line

Introduction to UNIX. Logging in. Basic System Architecture 10/7/10. most systems have graphical login on Linux machines

Basic Linux Command Line Interface Guide

Module 8 Pipes, Redirection and REGEX

Outline. Structure of a UNIX command

Introduction p. 1 Who Should Read This Book? p. 1 What You Need to Know Before Reading This Book p. 2 How This Book Is Organized p.

LPIC-1 System Administrator

Introduction to UNIX Shell Exercises

CS197U: A Hands on Introduction to Unix

Mid Term from Feb-2005 to Nov 2012 CS604- Operating System

18-Sep CSCI 2132 Software Development Lecture 6: Links and Inodes. Faculty of Computer Science, Dalhousie University. Lecture 6 p.

Unix Basics. Systems Programming Concepts

Linux for Beginners. Windows users should download putty or bitvise:

Working with Basic Linux. Daniel Balagué

Sperimentazioni I LINUX commands tutorial - Part II

Introduction to the Linux Command Line

Introduction To Linux. Rob Thomas - ACRC

Linux Kung Fu. Ross Ventresca UBNetDef, Fall 2017

Essential Unix and Linux! Perl for Bioinformatics, ! F. Pineda

Basic Linux (Bash) Commands

Operating Systems. Lecture 07. System Calls, Input/Output and Error Redirection, Inter-process Communication in Unix/Linux

Unix Tools / Command Line

UNIX Essentials Featuring Solaris 10 Op System

Transcription:

Süsteemihaldus MTAT.08.021 System Administration UNIX shell basics Name service DNS 1/69

Command Line Read detailed manual for specific command using UNIX online documentation or so called manual (man) pages. man - special command to view manual of specific command: ~$ man command ~$ man tail Gives detailed description of tail command Navigate with arrow keys, terminate with q key 2/69

Command Line (shell) Internal commands: shell built-in commands Examples: cd exit try user@localhost:~$ which cd External commands: OS level programs, located in /bin and /usr/bin For exact location of the external program use which command: ~$ which ls /bin/ls returned the location of ls 3/69

Command Line (shell) Important meta symbols: File name patterns: * - any amount of any symbols? - exactly one symbol [symbols] exactly one symbol from the list \ -Escaping \( \) \$ \# `command` or $(command) in place execution Expression will be replace with the output of the command 4/69

File management commands pwd print current directory cd dir change directory cp -r dir1 dir2 directory copy cp file1 file2 filen directory copy files to directory mv source_file targe_file - move/rename file mv file1 file2 filen directory rm file1 file2 delete files rm -r directory delete directory 5/69

File permissions and ownership chmod change permissions Covered in slides 12-15 chown change ownership chown newuser.newgroup file1 file2 filen Change ownership of the files to newuser and newgroup chown -R newuser.newgroup directory Change ownership of the directory and all the files within recursively 6/69

Process Management ps view process table ps -e -view all (also detached and not owned) ps -f detailed table ps -u user view processes of user top,htop interactive process tables 7/69

Process Management It is possible to send the signals to process by process id (PID) kill -SIG PID (send signal) kill -l (view signals) kill -15 PID (SIGTERM) soft terminate kill -9 PID (SIGKILL) hard terminate And by process name pkill -15 xclock soft terminate xclock process In graphical environment xkill and the just select the window you want to terminate 8/69

Process Management Process priorities in UNIX Highest -20 Lowest 19 Default 10 Superuser permission required to set process priority below 0 nice -n N run process with N priority renice -n N change priority of running process 9/69

Process Management nohup run program detached (in background) Ctrl+C in runtime send SIGINT (2) signal Ctrl+Z in runtime suspend and detach process bg send detached process to background fg restore detached process from background 10/69

Disk management and quotas Disk Quota Limits user disk usage Number of files Soft quota Hard quota quota Amount used diskspace quota -v detailed quota info Class 123 quota is 50G per user 11/69

Disk management and quotas du Disc Usage information (sum of all files in current directory) du -sk *.??* sort -n sorted list of disc usage by individual files and directories df File system load information 12/69

Default Communication Channels STDIN (0) Standard Input STDOUT (1) Standard Output STDERR (2) error reports Each program apart from options and parameters can read from STDIN and write to STDOUT,STDERR STDIN comes by default from command line input Keyboard STDOUT, STDERR by default command line output Terminal application (command promt) 13/69

Default Communication Channels ~$ N=''; \ echo 'Say something :'; \ read N; \ echo 'You said: ' $N; Here we ask user to input some data, obviously read command will be expecting data from STDIN letting user type in some words. echo prints the corresponding messages to the STDOUT, so user can read the from command promt. N variable is only user to store the user input. Here we do not use STDERR 14/69

Input/Output Redirection command1 > fail1 Write output of the command1 to file1 command1 >> fail1 Append output of the command1 to file1 command1 < fail1 Command1 input from file1 2>&1 Redirect STDERR as well as the STDOUT 15/69

Input/Output Redirection ~$ echo 'Input some words, Enter to separate.' \ echo 'Ctrl+C to finish : '; \ cat > words.txt; Here we ask user to provide list of words (in several lines), and we write the word list int file words.txt. File writing occurs by redirecting output of cat command. ~$ echo 'Sorted list :'; \ sort < words.txt Now we show the alphabetically sorted list of words by providing the input to sort command from the file we just have written. 16/69

Command pipelines Powerful utility to combine simple utility Pipeline redirects the standard output of one command to the standard input of the next command. Commands in pipeline run parallel in separate processes No need for temporary files du -sk *.??* sort -n 17/69

Command pipelines command1 command2 the pipe is one way synchronization Command2 waits if pipe is empty Command1 waits if pipe is full Command2 reads if pipe not empty Command1 writes if pipe not full possible errors pipe lock broken pipe 18/69