System Administration

Similar documents
Command-line interpreters

Unix Handouts. Shantanu N Kulkarni

INTRODUCTION TO LINUX

CISC 220 fall 2011, set 1: Linux basics

Lezione 8. Shell command language Introduction. Sommario. Bioinformatica. Mauro Ceccanti e Alberto Paoluzzi

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

Lezione 8. Shell command language Introduction. Sommario. Bioinformatica. Esercitazione Introduzione al linguaggio di shell

CS246 Spring14 Programming Paradigm Notes on Linux

Operating Systems. Copyleft 2005, Binnur Kurt

Operating Systems 3. Operating Systems. Content. What is an Operating System? What is an Operating System? Resource Abstraction and Sharing

Unix/Linux: History and Philosophy

Practical Computing-II. Programming in the Linux Environment. 0. An Introduction. B.W.Gore. March 20, 2015

Introduction: What is Unix?

Linux & Shell Programming 2014

Overview LEARN. History of Linux Linux Architecture Linux File System Linux Access Linux Commands File Permission Editors Conclusion and Questions

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

EECS2301. Lab 1 Winter 2016

EECS 2031E. Software Tools Prof. Mokhtar Aboelaze

Perl and R Scripting for Biologists

Introduction to Linux Basics

Shell script. Shell Scripts. A shell script contains a sequence of commands in a text file. Shell is an command language interpreter.

Linux Operating System Environment Computadors Grau en Ciència i Enginyeria de Dades Q2

Chapter Two. Lesson A. Objectives. Exploring the UNIX File System and File Security. Understanding Files and Directories

Introduction and Overview Getting Started

Introduction to Linux. Woo-Yeong Jeong Computer Systems Laboratory Sungkyunkwan University

Introduction to Cygwin Operating Environment

Exercise Sheet 2. (Classifications of Operating Systems)

Getting started with Hugs on Linux

1.3 What does Ctrl-D, Ctrl-A, Ctrl-F and Ctrl-T do in terms of command line editing? (6)

Exploring UNIX: Session 3

CSCI 211 UNIX Lab. Shell Programming. Dr. Jiang Li. Jiang Li, Ph.D. Department of Computer Science

*nix Crash Course. Presented by: Virginia Tech Linux / Unix Users Group VTLUUG

Introduction to Linux

Linux Systems Administration Getting Started with Linux

Everything about Linux User- and Filemanagement

Commands are in black

Introduction to Linux

CS Unix Tools. Lecture 3 Making Bash Work For You Fall Hussam Abu-Libdeh based on slides by David Slater. September 13, 2010

The UNIX Operating System. HORT Lecture 2 Instructor: Kranthi Varala

Unix System Architecture, File System, and Shell Commands

Linux Essentials Objectives Topics:

Practical 4. Linux Commands: Working with Directories

(a) About Unix. History

Introduction to Linux Part I: The Filesystem Luca Heltai

CENG 334 Computer Networks. Laboratory I Linux Tutorial

Getting started with Hugs on Linux

Writing Shell Scripts part 1

UNIX Kernel. UNIX History

Introduction to Linux

Appendix A GLOSSARY. SYS-ED/ Computer Education Techniques, Inc.

CSCI 2132 Software Development. Lecture 3: Unix Shells and Other Basic Concepts

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

UNIX shell scripting

LING 408/508: Computational Techniques for Linguists. Lecture 5

Lecture 3. Unix. Question? b. The world s best restaurant. c. Being in the top three happiest countries in the world.

Common UNIX Commands. Unix. User Interfaces. Unix Commands Winter COMP 1270 Computer Usage II 9-1. Using UNIX. Unix has a command line interface

Basic File Attributes

PROGRAMMAZIONE I A.A. 2015/2016

An Introduction to Unix Power Tools

Introduction to Linux Basics Part I. Georgia Advanced Computing Resource Center University of Georgia Suchitra Pakala

UNIX System Programming Lecture 3: BASH Programming

Introduction to UNIX I: Command Line 1 / 21

EECS 470 Lab 5. Linux Shell Scripting. Friday, 1 st February, 2018

UNIX Concepts COMPSCI 386

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

Introduction to Lab Practicals (Lab Intro 3) Access Control, Synchronisation and Remote Access

GNU/Linux Course Lesson 1. Puria Nafisi

Introduction to Linux

Introduction to Shell Scripting

CST Algonquin College 2

Introduction to Unix May 24, 2008

CSE II-Sem)

Unix Filesystem. January 26 th, 2004 Class Meeting 2

Welcome to Linux. Lecture 1.1

Permission and Ownership

Student Remote Login Procedure (see picture below): 1. Start SSH Secure Shell 2. Click the computer icon (4 th on the toolbar) 3.

Chapter 9. Shell and Kernel

EE516: Embedded Software Project 1. Setting Up Environment for Projects

commandname flags arguments

8. Files and File Systems

Introduction to Unix: Fundamental Commands

Week 2 Lecture 3. Unix

Disks, Filesystems 1

What is UNIX? A Little Bit about UNIX and User Interfaces. Adapted from Practical Unix and Programming Hunter College

Introduction. Let s start with the first set of slides

5/20/2007. Touring Essential Programs

Unix File System. Class Meeting 2. * Notes adapted by Joy Mukherjee from previous work by other members of the CS faculty at Virginia Tech

client X11 Linux workstation

User Commands chmod ( 1 )

UNIX, GNU/Linux and simple tools for data manipulation

Linux shell scripting intro/review

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

Unix Shells and Other Basic Concepts

(32 KB) 216 * 215 = 231 = 2GB

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

INSE Lab 1 Introduction to UNIX Fall 2017

Chapter-3. Introduction to Unix: Fundamental Commands

Introduction to Lab Practicals (Lab Intro 3) Access Control, Synchronisation and Remote Access

The Unix Shell. Permissions

: the User (owner) for this file (your cruzid, when you do it) Position: directory flag. read Group.

Transcription:

Süsteemihaldus MTAT.08.021 System Administration File system basics UNIX shell basics 1/23

2/23

3/23

4/23

5/23

6/23

System Root Mount points User Profiles /home /boot /dev/sda Boot loader files and Linux kernel sda1 sda2 sda3 sda4 SWAP partition 7/23

Mount Points Configured in /etc/fstab ~$ cat /etc/fstab # /etc/fstab: static file system information. # # <file system> <mount point> <type> <options> <dump> <pass> /dev/sda1 swap swap sw 0 0 /dev/sda2 / ext4 errors=remount-ro 0 1 /dev/sda3 /home ext4 defaults 0 2 /dev/sda4 /boot ext2 defaults 0 0 8/23

File System Root directory / cd / Current directory pwd Home directory ~ cd ~ cd Parent directory.. cd.. Sub-directory /home and /home/user 9/23

File parameters Owner Group Name Permission bits Date Modified ~$ ls -l vpn_manual.txt Type File, Directory Link, FIFO, Block device Size -rw------- 1 devel devel 4740 Feb 20 14:39 vpn_manual.txt ~$ ls -l drwxr-x--- 10 devel devel 4096 Feb 21 06:02 Downloads ~$ ls -l text.txt lrwxrwxrwx 1 devel devel 19 Feb 21 06:02 text.txt -> vpn_manual.txt 10/23

File Name in UNIX Case sensitive Downloads and downloads are two different files Hidden files start with. (use ls -la) File name max length 255 bytes File path max length none Reserved characters: & ; *? ` " [ ]( ) $ < > { } %! # @ \ Escaping reserved chars: \( \) \# \! \? 11/23

Permissions Three types of permissions: r read: file or directory read access w write: changing file or directory: add or remove files from directory x execute: running application file or command, in case of directory: enter or list directory contents The permissions can be changed by file owner or by superuser (root) 12/23

Permissions -r-------- 400 u+r --w------- 200 u+w Owner user (u) ---x------ 100 u+x ----r----- 040 g+r -----w---- 020 g+w Owner group (g) ------x--- 010 g+x -------r-- 004 o+r --------w- 002 o+w All others (o) - world ---------x 001 o+x 13/23

Changing permissions chmod g-rwx,o-rwx f1.txt chmod go-rwx f1.txt chmod a-x f1.txt chmod u+rwx,g+rx f1.txt Symbol Meaning u user g group o other a all chmod 600 f1.tx 400+200 user rw chmod 644 f1.txt 400+200+40+4 user rw, group r, other r chmod 640 f1.txt?? r read w x write (and delete) execute (and access directory) + add permission - take away permission 14/23

Sticky bit Introduced in Unix 5 in 1974 Originally was meant for optimizing most often executed program The program stayed in memory after finishing execution, hence was started faster next time Today used for protecting files in common directories If directory has sticky bit set the file in the directory can be only removed by an owner the file even if directory has 777 permissions Example: /tmp directory writable for all, removing the files of other users prohibited user@localhost:~$ chmod 1777 test1/ user@localhost:~$ ls l drwxrwxrwt 2 user user 4096 Sep 23 09:30 test1/ 15/23

16/23

UNIX Shell Basics 17/23

Command-line interpreters shell Wiki: A command-line interface (CLI) is a means of interaction with a computer program where the user (or client) issues commands to the program in the form of successive lines of text (command lines). sh, ksh, csh, zsh, tcsh, bash bash is default shell In GNU/Linux 18/23

Bash - Bourne-again shell Objective as a free replacement for the Bourne shell (sh) /bin/sh Default Unix shell of Unix Version 7 (1977) Developed by Stephen Bourne at Bell Labs Was a replacement for the Thompson shell, whose executable file had the same name sh R.Stallman and the Free Software Foundation (FSF) considered a free shell that could run existing sh scripts so strategic to a completely free system built from BSD and GNU The bourne-again shell (bash) was then developed by Brian Fox So In Debian GNU/Linux /bin/sh is directly linked to /bin/bash 19/23

Command line General form: ~$ command -options parameters Options alternate or specify the command behavior Parameters provide the input data by values, or by giving the path to the file. Parameter values may also alternate command behavior 20/23

Command line ~$ head vpn_manual.txt Manual for SA13 Configuration on GNU/Linux Configuring the OpenVPN * in this manual "username" refers to your username in this course (in class 123) To configure your openvpn you need certificates generated in first practical session. 1. First you need to install openvpn package. Install version not newer than 2.2 as 2.3 has a bug. For that either use command # apt-get install openvpn... ~$ head -n 1 vpn_manual.txt Manual for SA13 Configuration on GNU/Linux 21/23

Command Line Help option -h or --help Gives brief description of command usage ~$ tail --help Usage: tail [OPTION]... [FILE]... Print the last 10 lines of each FILE to standard output. With more than one FILE, precede each with a header giving the file name. With no FILE, or when FILE is, read standard input. Mandatory arguments to long options are mandatory for short options too. c, bytes=k output the last K bytes; alternatively, use c +K to output bytes starting with the Kth of each file. 22/23