Linux Nuts and Bolts

Similar documents
Some useful UNIX Commands written down by Razor for newbies to get a start in UNIX

Stop all processes and then reboot - same as above startx. Log in as superuser from current login exit

Computer Systems and Architecture

Linux Reference Card - Command Summary

Introduction to the UNIX command line

Welcome to getting started with Ubuntu Server. This System Administrator Manual. guide to be simple to follow, with step by step instructions

Computer Systems and Architecture

Basic Unix Commands. CGS 3460, Lecture 6 Jan 23, 2006 Zhen Yang

Embedded Linux Systems. Bin Li Assistant Professor Dept. of Electrical, Computer and Biomedical Engineering University of Rhode Island

Please choose the best answer. More than one answer might be true, but choose the one that is best.

Disks, Filesystems 1

Exam Linux-Praxis - 1 ( From )

Unix Tools / Command Line

SIEMENS UserAdmin Workshop TELEPERM XP Version 4 Chapter 1

Introduction to UNIX/Linux

Working with Basic Linux. Daniel Balagué

Chapter 6. Linux File System

Disks, Filesystems, Booting Todd Kelley CST8177 Todd Kelley 1

Course 144 Supplementary Materials. UNIX Fundamentals

LAB #7 Linux Tutorial

Linux Essentials Objectives Topics:

Presented by Bill Genske Gary Jackson

UNIX. Basic UNIX Command

Set 1 MCQ Which command is used to sort the lines of data in a file in reverse order A) sort B) sh C) st D) sort -r

Filesystem and common commands

UNIX Quick Reference

[ Terminal ] [ Users management ] Alt +F6 = Terminal switcher. useradd [option] JohnG

Unix L555. Dept. of Linguistics, Indiana University Fall Unix. Unix. Directories. Files. Useful Commands. Permissions. tar.

Introduction to UNIX command-line

LINUX & FEDORA RED HAT ENTERPRISE. Learning. 4th Edition BILL MCCARTY DEPLOYING OFFICE PRODUCTIVITY APPLICATIONS & SOFTWARE DEVELOPMENT ENVIRONMENTS

Basic Shell Commands

UNIX System Programming Lecture 3: BASH Programming

Read the relevant material in Sobell! If you want to follow along with the examples that follow, and you do, open a Linux terminal.

Linux Command Line Primer. By: Scott Marshall

User & Group Administration

TJU Syllabus for Linux Fundamentals and Applications

Basic Linux Command Line Interface Guide

CSCE 212H, Spring 2008, Matthews Lab Assignment 1: Representation of Integers Assigned: January 17 Due: January 22

Linux Training. for New Users of Cluster. Georgia Advanced Computing Resource Center University of Georgia Suchitra Pakala

Disks, Filesystems Todd Kelley CST8177 Todd Kelley 1

Hands-on Keyboard: Cyber Experiments for Strategists and Policy Makers

Std: XI CHAPTER-3 LINUX

Essential Unix (and Linux) for the Oracle DBA. Revision no.: PPT/2K403/02

Linux Refresher (1) 310/ Fourth Workshop on Distributed Laboratory Instrumentation Systems (30 October - 24 November 2006)

First of all, these notes will cover only a small subset of the available commands and utilities, and will cover most of those in a shallow fashion.

Research. We make it happen. Unix Basics. User Support Group help-line: personal:

UNIX Basics. UNIX Basics CIS 218 Oakton Community College

Lecture # 2 Introduction to UNIX (Part 2)

National University of Computer and Emerging Sciences Operating System Lab - 02 Lab Manual

Basic Linux Commands. Srihari Kalgi M.Tech, CSE (KReSIT), IIT Bombay. May 5, 2009

acmteam/unix.pdf How to manage your account (user ID, password, shell); How to compile C, C++, and Java programs;

First of all, these notes will cover only a small subset of the available commands and utilities, and will cover most of those in a shallow fashion.

Exercise Sheet 2. (Classifications of Operating Systems)

First of all, these notes will cover only a small subset of the available commands and utilities, and will cover most of those in a shallow fashion.

5/8/2012. Creating and Changing Directories Chapter 7

Introduction to Linux Organizing Files

Linux Interview Questions and Answers

Unix Introduction to UNIX

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

No Food or Drink in this room. Logon to Windows machine

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

Quick Start Guide. by Burak Himmetoglu. Supercomputing Consultant. Enterprise Technology Services & Center for Scientific Computing

Files

INTRODUCTION TO LINUX

Introduction to UNIX command-line II

Introduction to the shell Part II

UNIT V. Dr.T.Logeswari. Unix Shell Programming - Forouzan

Lab Working with Linux Command Line

5/8/2012. Encryption-based Protection. Protection based on Access Permission (Contd) File Security, Setting and Using Permissions Chapter 9

Outline. Structure of a UNIX command

FREEENGINEER.ORG. 1 of 6 11/5/15 8:31 PM. Learn UNIX in 10 minutes. Version 1.3. Preface

CS Fundamentals of Programming II Fall Very Basic UNIX

IBM AIX Basic Operations V5.

Defensie Exercises preparing for the exam.

Tutorial-1b: The Linux CLI

Introduction to Linux

Unix Filesystem. January 26 th, 2004 Class Meeting 2

CSE 390a Lecture 3. Multi-user systems; remote login; editors; users/groups; permissions

Introduction to the Linux Command Line

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.

Useful Unix Commands Cheat Sheet

Lab 2: Linux/Unix shell

CS 215 Fundamentals of Programming II Spring 2019 Very Basic UNIX

Basic Linux Command Line Interface Guide

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

This lab exercise is to be submitted at the end of the lab session! passwd [That is the command to change your current password to a new one]

IMPORTANT: Logging Off LOGGING IN

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

Chapter-3. Introduction to Unix: Fundamental Commands

UoW HPC Quick Start. Information Technology Services University of Wollongong. ( Last updated on October 10, 2011)

The Command Line. Matthew Bender. September 10, CMSC Command Line Workshop. Matthew Bender (2015) The Command Line September 10, / 25

Mills HPC Tutorial Series. Linux Basics I

Introduction to Unix and Linux. Workshop 1: Directories and Files

Linux Shell Script. J. K. Mandal

The landscape. File hierarchy overview. A tree structure of directories The directory tree is standardized. But varies slightly among distributions

CENG 334 Computer Networks. Laboratory I Linux Tutorial

Introduction to Linux for QSS/OASIS System Administrators and System Operators

RH133. Red Hat Linux System Administration

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

CSCM98 Lab Class #5 Getting familiar with the command line

Transcription:

Linux Nuts and Bolts David Morgan At the command line Cursor control type to insert del/ctrl-d to delete home/end for endpoints Filename completion tab after initial characters Command repetition uparrow (like MS doskey) history fc ctrl-r Clearing the screen ctrl-l/clear 1

At the command line Rescuing garbled screen ( reset ) Case sensitivity Un-fully-qualified commands PATH./ Linux plumbing standard input/standard output < says get input from file instead of keyboard > says send output to file instead of screen >> says send to file nondestructively <cmd1> <cmd2> says use cmd1 s output as cmd2 s input 2

Linux environment env prints environment variables echo $VARNAME prints individual variable VARNAME=contents sets contents set prints all shell variables An editor: vi vi lovers home page http://www.thomer.com/thomer/vi/vi.html 1-page cheat sheet http://dcfonline.sfu.ca/ying/linux/vi/vi-reference.pdf Run vimtutor 3

Top 10 Commands ls cd cp mv rm chmod cat more grep ps ls list directory contents ls -l ls -F ls -a ls -t Like MS dir 4

cd change current directory cd cd <fully qualified directory name> cd <relative directory name> Use with pwd (print working directory) Like MS cd cp copy files and directories cp -R cp -p explicit. to copy into current directory poor for comprehensive backup (try tar) Like MS copy 5

mv rename/move files Rename mv Afile B mv Xdir Y Move mv Afile Xdir rm remove files and directories rm -i rm -f rm -r Useful but dangerous: rm -rf * Like MS del 6

cat file content to std output cat Afile Bfile > Cfile cat /etc/lilo.conf cat -n cat -A more file filter for viewing View files 1 screen at a time Enter for another line Spacebar for another screenful cf., less Like MS more, /p option of dir 7

grep print lines matching pattern grep <target> <files> <command> grep <target> grep -v ps report process status ps ps ax PID numbers 8

chmod change file permissions chmod u+r ( u/g/o +/- r/w/x ) chmod 777 To enable script execution To restrict/extend access to others File system - permissions -rwxr-x--- File type (file, directory, device, ) Accesses granted to file s associated User Accesses granted to members of file s Group Accesses granted to all Other users 9

One for good measure - ln make links between files Hard links ln Symbolic links ln -s Last one, really - finding files locate create a fileset snapshot database cd /etc/cron.daily updatedb locate <targfile> find find / name <targfile> -print 10

Command Documentation man ln man grep man cat et cetera To print out, capture as man chmod col b > filetoprint Virtual Terminals alt-f1 thru alt-f6 select ctrl-alt- while in X Multiple independent consoles 11

File System formatting mounting sharing with DOS/Windows checking backing up File System - formatting Dos format = format tracks + place filesystem Low-level format High-level format Linux low-level for floppies only fdformat /dev/fd0h1440 High-level format mkfs t ext2 /dev/fd0h1440 12

File System - mounting Mount <device> <mountpoint> eg, mount /dev/fd0 /mnt/floppy Mountpoint name arbitrary eg, mount /dev/cdrom /mnt/floppy no problem Masks any existing subtree at the mountpoint File System - sharing mount t <filesystem type> <device> <mountpoint> Mountpoint directory must pre-exist Read a dos/fat floppy mount t vfat /dev/fd0 /mnt/floppy Read a dos or windows partition mount t msdos /dev/hda1 /mnt/dosdrivec mount t vfat /dev/hda1 /mnt/win98drivec List existing mounts mount 13

File System - checking fsck badblocks File System backing up tar cvf dest.tar srcdir Executed from within parent directory of srcdir Captures whole subtree under srcdir tar xvf dest.tar Executed from within any subdirectory Creates a subdirectory srcdir with whole contents of the original tar tvf dest.tar View contents 14

File System backing up Better (more fully faithful) than cp for archiving tar default: no compression use with gzip or use -z option <file>.tar <file>.gz <file>.tar.gz Destination can be a device (tar = tape + archive) tar cvzf /dev/fd0 srcdir tar xvzf /dev/fd0 Users useradd/userdel /home/<user> /etc/passwd is the user database /etc/shadow has passwords (relocated from passwd) /etc/group whoami su 15

Printing lpr <filename> Shutting down Shut Down shutdown h now or halt Restart shutdown r now or reboot 16