Working with Linux Lab 1 1. Login and logout Account – username & password – Note: Linux is case-sensitive Administrator: username = root Logout: exit,

Slides:



Advertisements
Similar presentations
©Colin Jamison 2004 Introduction to Linux Colin Jamison.
Advertisements

Lab6 CPCS361 I.Mona Alshehri. Working with Files and Directories Creating files Create a file with the cat command type the command cat > name_of_file.
5 Basic utilities When a user logs in to the Linux operating system the directory that they will start in is their home directory. Most users will have.
ATS Programming Short Course I INTRODUCTORY CONCEPTS Tuesday, Jan. 27 th, 2009 Essential Unix Commands.
File Security. Viewing Permissions ls –l Permission Values.
Linux+ Guide to Linux Certification, Second Edition
T UTORIAL OF U NIX C OMMAND & SHELL SCRIPT S 5027 Professor: Dr. Shu-Ching Chen TA: Samira Pouyanfar Spring 2015.
Unix Basics. Systems Programming: Unix Basics 2 Unix Basics  Unix directories  Important Unix file commands  File and Directory Access Rights through.
Linux File Security. What is Permission ? Specifies what right are granting to users to access the resources available in the computer. So that important.
Using Linux Commands Lab 4. Using the Shell in Linux Commands Syntax  Options: could be added to the commands to change their behavior (-a, -la, --help)
Linux Commands LINUX COMMANDS.
L INUX C OMMAND L INE I NTERFACE G UNAANBAN.G
Systems Programming Concepts
Learning basic Unix command IT 325 operating system.
COMP1070/2002/lec4/H.Melikian COMP1070 Lecture #5  Files and directories in UNIX  Various types of files  File attributes  Notion of pathname  Commands.
Brief introduction to UNIX A. Emerson CINECA, High Performance Systems.
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.
CHAPTER 1 UNIX FOR NONPROGRAMMERS By U ğ ur Halıcı.
Linux Directory Navigation. File & Directory Commands This is a minimal list of Unix commands that you must know for file management: ls (list) mkdir.
2 Manual & Filestore. Introduction Using the manual The UNIX filestore File permissions.
Linux environment ● Graphical interface – X-window + window manager ● Text interface – terminal + shell.
1 Lecture 2 Working with Files and Directories COP 3344 Introduction to UNIX.
File Permissions. What are the three categories of users that apply to file permissions? Owner (or user) Group All others (public, world, others)
Linux+ Guide to Linux Certification, Second Edition
The UNIX development environment CS 400/600 – Data Structures.
System Administration Introduction to Unix Session 2 – Fri 02 Nov 2007 Reference:  chapter 1, The Unix Programming Environment, Kernighan & Pike, ISBN.
Module 4 - File Security. Security Overview File Ownership Access to Files and Dircetories Changing File and Directory Ownership Changing File and Directory.
Session 2 Wharton Summer Tech Camp Basic Unix. Agenda Cover basic UNIX commands and useful functions.
Basic Unix Commands CGS 3460, Lecture 6 Jan 23, 2006 Zhen Yang.
1May 16, 2005 Week 2 Lab Agenda Command Line FTP Commands Review More UNIX commands to learn File name expansion - * Introduction of vi.
Week 8: Linux / ubuntu Dr. I. H. Shah. / CSCS 301 Fall 2009.
E X C E E D I N G E X P E C T A T I O N S Basic LINUX Linux System Administration Dr. Hoganson Kennesaw State University Operating Systems Directory structure:
Using Linux Commands Lab 4. Using the Shell in Linux Commands Syntax  Options: could be added to the commands to change their behavior (-a, -la, --help)
Λειτουργικά Συστήματα – Lab2 Γιάννης Πετράκης. Directory Navigation and Control  The Unix file system is set up like a tree branching out from the root.
Agenda Basic Unix Commands (Chapters 2 & 3) Miscellaneous Commands: which, passwd, date, ps / kill Working with Files: file, touch, cat, more, less, grep,
Linux Commands C151 Multi-User Operating Systems.
Revision: Absolute and relative paths. (root) staffusrbinstudetc ResearchTeachingPrivate pgugitmasters xxxgtrxxx CUA Coursework1.txt CUA xxx02uxxx04u.
2 Manual & Filestore Mauro Jaskelioff. Introduction Using the manual The UNIX filestore File permissions.
1 Lecture 2 Working with Files and Directories COP 3353 Introduction to UNIX.
1 Introduction to Unix. 2 What is UNIX?  UNIX is an Operating System (OS).  An operating system is a control program that helps the user communicate.
1 CS3695 – Network Vulnerability Assessment & Risk Mitigation – Introduction to Unix & Linux.
Basic Unix Commands. Listing files and directories ● ls:command is used to list the files and ● directories in present working directory ● ls command.
UNIX file systems Learning Objectives: 1. To understand the basics of file systems 2. To understand the hierarchical structure in Unix file system 3. To.
ICE UNIX TUTORIAL. File System Commands cd – change directory cd – change directory ls – list contents ls – list contents rm – remove/delete rm – remove/delete.
Learning basic Unix command It 325 operating system.
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).
UNIX Basics Matt Hayward October 18, 2016 LS560 – Information Technology for information professionals.
UNIX To do work for the class, you will be using the Unix operating system. Once connected to the system, you will be presented with a login screen. Once.
Tutorial of Unix Command & shell scriptS 5027
File permissions Operating systems I800
Getting started with CentOS Linux
Commands Basic syntax of shell commands UNIX or shell commands have a basic structure command -options target command comes first (such as cd or ls) any.
Web Programming Essentials:
Lecture 2 Working with Files and Directories
C151 Multi-User Operating Systems
CS314 – Section 5 Recitation 1
Linux Basic Commands Visit to more Learning Resources.
Tutorial of Unix Command & shell scriptS 5027
Basic UNIX OLC Training.
Introduction to UNIX.
Tutorial of Unix Command & shell scriptS 5027
Using Linux Commands Lab 3.
Web Programming Essentials:
Tutorial of Unix Command & shell scriptS 5027
A Brief Overview of Unix
Security and File Permission
Getting started with CentOS Linux
Tutorial Unix Command & Makefile CIS 5027
Linux Commands LINUX COMMANDS.
January 26th, 2004 Class Meeting 2
Presentation transcript:

Working with Linux Lab 1 1

Login and logout Account – username & password – Note: Linux is case-sensitive Administrator: username = root Logout: exit, Ctrl+D 2

Linux File System 3 (C) WINDOWSProgram Files FontsSystem32 …. (D) DataMusic OS …. (/) boot home …. etc khoastudent1 root Windows File System Linux File System

Directory/file commands List contents of directory : ls [-a] [-l] [directory_name] Print working directory: pwd Change working directory : cd directory_name E.g. cd /home Create new directory : mkdir directory_name Remove a directory: rm -r directory_name Some special symbols : ~ : home directory.. : parent directory 4

Directory/file commands Display file content : cat filenameor more filename head filenameor tail filename Copy file(s) or directory: cp [-r] source_file destination_file Remove file or directory rm –r file_name Move (rename) file(s)/directory mv old_pathnew_path 5

File system and permissions Each user may owns one or more directories/files Each user has different access rights in different directories/files  users can share their data together  users also can protect their private data 6

File system and permissions Access right on directory/file – read (r) – write (w) – execute (x) Each directory/file has 9 access-right bits, divide into 3 groups as follow : – owner – group (e.g. people the same project team) – others (people in public domain) 7

File system and permissions 8

Changing access rights (1) Symbolic chmod who op mode [-R] file(s) Who: u : owner g : group o : others a : all Mode: r : read w : write x : execute Op + : grant more rights - : revoke rights = : reset rights 9

Changing access rights (2) Example $ touch temp $ ls –l temp -rw-r--r-- 1 user1 staff 0 Jun 11 11:44 temp $ chmod o-r temp $ ls -l temp -rw-r user1 staff 0 Jun 11 11:44 temp $ chmod u+x, o+r temp $ ls -l temp -rwxr--r-- 1 user1 staff 0 Jun 11 11:44 temp 10

Changing access rights (3) Numeric: chmod xyz [-R] file(s) read = 4 write = 2 execute = 1 11 Octal valueAccess right 7rwx 6rw- 5r-x 4r-- 3-wx 2-w- 1--x 0---

Changing access rights (4) Example: some common access rights of directory/file(s) 12 Octal valueAccess right rw rw-r--r rwx rwxr-x--x rwxrwxr-x rwxrwxrwx

Changing access rights (5) Example $ touch abc $ ls –l abc -rw-r--r-- 1 user1 staff 0 Jun 11 11:44 abc $ chmod 555 abc $ ls -l abc -r-xr-xr-x 1 user1 staff 0 Jun 11 11:44 abc $ chmod 775 abc $ ls -l abc -rwxrwxr-x 1 user1 staff 0 Jun 11 11:44 abc 13

Advanced utilities (1) Who is who? who [option] Print current host name hostname Where do they come from? which [filename] How much disk usage? df [option] Clear screen clearOR Ctrl + L 14

Advanced utilities (2) Find a specified file : find path –name filename Find lines in file matching a pattern grep pattern file_name Mount and unmount file system mount -t filesystem device_file mount_point umount mount_point 15

vi editor Interactive simple editor Can not use mouse Text editing on a buffer Appears on most Unix or Unix-like system 16

vi usage 17 syntaxmeaning vi filenameopen/create file a or ichange to edit mode ESC → wq!save and quit ESC → q! not save and quit

Cursor movement in vi 18 CmdMeaning nn move cursor left n character(s) nn move cursor down n character(s) nn move cursor up n character(s) nn move cursor right n character(s) Entermove cursor to beginning of next line Gmove cursor to the last line nwnwmove cursor left n word(s) nWnWmove cursor right n word(s)

Text manipulation commands 19 CmdMeaning nxnxdelete n character(s) from current cursor position nXnXdelete n character(s) immediately preceding current cursor position D, d$delete all characters from current cursor position to end of line d0, d|delete all characters from left column of screen to character preceding current cursor position on current line

Text manipulation commands 20 CmdMeaning ndddelete n line(s) beginning at current line dGdelete all lines, starting with current line, through end of file d1Gdelete all lines, starting with current line, through beginning of file ndwdelete from cursor position through end of n following word ndbdelete from nearest preceding word through character before current cursor position Jjoin the next line at the end of current line

Text manipulation commands 21 CmdMeaning ~change case of current character rreplace single character at cursor position nccchange n line(s) beginning at current line cGchange all lines from current line through end of file ncwchange n word(s) on the left of cursor ncbchange n word(s) on the right of cursor

Text manipulation commands 22 CmdMeaning nY, nyycopy (yank) n line(s) into buffer nywcopy (yank) n word(s) into buffer y$copy (yank) from current cursor position through end of line into buffer yGcopy (yank) from current line through end of file into buffer pInsert buffer content at the line after current line PInsert buffer content at the line above current line