You will automatically be in your user (home) directory when you login.

Similar documents
Unix Filesystem. January 26 th, 2004 Class Meeting 2

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

A Brief Introduction to Unix

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

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

UNIX File Hierarchy: Structure and Commands

commandname flags arguments

Commands are in black

CSCI 2132 Software Development. Lecture 4: Files and Directories

CENG 334 Computer Networks. Laboratory I Linux Tutorial

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

Essential Linux Shell Commands

Files and Directories

Operating Systems. Engr. Abdul-Rahman Mahmood MS, PMP, MCP, QMR(ISO9001:2000) alphapeeler.sf.net/pubkeys/pkey.htm

Introduction of Linux

Overview of the UNIX File System. Navigating and Viewing Directories

Unix background. COMP9021, Session 2, Using the Terminal application, open an x-term window. You type your commands in an x-term window.

Overview of the UNIX File System

Getting your department account

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

This section reviews UNIX file, directory, and system commands, and is organized as follows:

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

Basic Survival UNIX.

Crash Course in Unix. For more info check out the Unix man pages -orhttp:// -or- Unix in a Nutshell (an O Reilly book).

Introduction to Linux

Introduction to the Linux Command Line

Mills HPC Tutorial Series. Linux Basics I

INTRODUCTION TO LINUX

Week 2 Lecture 3. Unix

Lecture 2b. Pathnames, files, special characters in filenames, and file permissions. COP 3353 Introduction to UNIX, FALL 2013

Linux/Cygwin Practice Computer Architecture

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

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

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

CST8207: GNU/Linux Operating Systems I Lab Six Linux File System Permissions. Linux File System Permissions (modes) - Part 1

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

Getting started with Hugs on Linux

Chapter-3. Introduction to Unix: Fundamental Commands

Introduction to Unix: Fundamental Commands

Files (review) and Regular Expressions. Todd Kelley CST8207 Todd Kelley 1

Linux File System and Basic Commands

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

EECS Software Tools. Lab 2 Tutorial: Introduction to UNIX/Linux. Tilemachos Pechlivanoglou

h/w m/c Kernel shell Application s/w user

Outline. Structure of a UNIX command

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

CS4350 Unix Programming. Outline

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

CS Fundamentals of Programming II Fall Very Basic UNIX

THE HONG KONG POLYTECHNIC UNIVERSITY Department of Electronic and Information Engineering

A Big Step. Shell Scripts, I/O Redirection, Ownership and Permission Concepts, and Binary Numbers

Perl and R Scripting for Biologists

CS197U: A Hands on Introduction to Unix

1. What statistic did the wc -l command show? (do man wc to get the answer) A. The number of bytes B. The number of lines C. The number of words

Getting started with Hugs on Linux

Session 1: Accessing MUGrid and Command Line Basics

Files

Scripting. Shell Scripts, I/O Redirection, Ownership and Permission Concepts, and Binary Numbers

The Unix Shell. Permissions

Introduction to the UNIX command line

CISC 220 fall 2011, set 1: Linux basics

Unix Tutorial Haverford Astronomy 2014/2015

Lab Working with Linux Command Line

Introduction to Linux Workshop 1

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

Unix File System. Learning command-line navigation of the file system is essential for efficient system usage

Unix Basics. Systems Programming Concepts

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

UNIX: Departmental Library Management on AIX

Outline. File Systems. File System Structure. CSCI 4061 Introduction to Operating Systems

CSC209. Software Tools and Systems Programming.

CS Unix Tools. Lecture 2 Fall Hussam Abu-Libdeh based on slides by David Slater. September 10, 2010

Linux Exercise. pwd answer: We call this directory (into which you get when you log in) your home directory.

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

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

CHAPTER 1 UNIX FOR NONPROGRAMMERS

Computer Systems and Architecture

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

-1- csh cd. cd alias!! ; set prompt=" pwd % " 16 cd. 17 cd.. 18 his /home% set prompt. alias. yasuoka : root :

CSE II-Sem)

Systems Programming and Computer Architecture ( ) Exercise Session 01 Data Lab

Exploring UNIX: Session 3

Outline. UNIX security ideas Users and groups File protection Setting temporary privileges. Examples. Permission bits Program language components

Week Overview. Unix file system File types and file naming Basic file system commands: pwd,cd,ls,mkdir,rmdir,mv,cp,rm man pages

CS/CIS 249 SP18 - Intro to Information Security

SECTION -C. Getting Started with UNIX

Introduction to Linux

Some Linux (Unix) Commands that might help you in ENSC351

Introduction to Linux

Unix tutorial. Thanks to Michael Wood-Vasey (UPitt) and Beth Willman (Haverford) for providing Unix tutorials on which this is based.

LAB 0: LINUX COMMAND LINE AND SVN

Linux & Shell Programming 2014

Oxford University Computing Services. Getting Started with Unix

CS246 Spring14 Programming Paradigm Notes on Linux

Introduction to Linux Basics

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

CS 215 Fundamentals of Programming II Spring 2019 Very Basic UNIX

Introduction to Linux Part I: The Filesystem Luca Heltai

INSE Lab 1 Introduction to UNIX Fall 2017

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

Transcription:

Directory structure / (root) bin dev etc lib users users2 tmp These directories typically contain system libraries, executable binary files, device handlers and drivers, etc. The user home directories are under users and users2, emulation software is contained in usr, and temporary files are put in tmp. You will automatically be in your user (home) directory when you login. pwd ls ls -a ls -l indicates what directory you are currently in $pwd might return /users2/courses/282/fm/project1 lists the files in your current directory lists all files in your current directory including invisible files such as.profile (Borne or Korn shell).login(c shell).environ (PAM shell) Note: A leading period in a file name indicates an invisible file. gives a detailed listing of all files in your current directory -46-

ls -p same as ls but appends a / to directory names Typical directory structure / (root) users2 courses frank jim sue lab1 lab2 lab3-47-

mkdir <directory_name> makes a new directory Example: $mkdir lab3 Creates the directory /users/frank/lab3 if you are currently in /users/frank IMPORTANT: ALWAYS USE LS TO CHECK A DIRECTORY BEFORE YOU COPY OR SAVE TO IT. UNIX DOES NOT KEEP ANY PREVIOUS VERSIONS OF A FILE. how to move around in a UNIX directory structure: $cd pathname $cd lab1 $cd part1 $cd lab1/part1 $cd.. $cd../.. $cd If you are in the directory frank, this will change you to the directory lab1. Note that this assumes that lab1 is contained in frank. Changes from the directory lab1 to part1. Again, it is assumed that part1 is located in lab1. Changes the current directory to part 1 with one command. Changes the current directory to the parent directory, i.e. it moves one level up the directory structure. Moves your current directory two levels up the directory structure Takes you to your home directory $rmdir <directory_name> $rmdir part1 Will remove the directory part1 from your current directory. This assumes that part1 is in your current directory. Will only work for empty directories. -48-

-49-

chmod changes a file s protection This changes the file protection mode. The official hp protection modes are: 400 Only you can read it. No one including youcan write it or delete it. 444 Anyone can read it. No one can write it or delete it. 600 Only you can read it, write to it, or delete it; however, you cannot execute it. 666 Anyone can do anything (execept execute it) to it. An easier method is to type chmod to get Usage: chmod [-A][ugoa][+-=][rwxstHugo] file... which shows you the mnemonics for specifying read and write priviledges. Examples: The letters u (user), g (group, you are all in the eeap282 group), o (others, everyone but you) and a (all) describe the group to which the priviledge change applies. The letters + (add this priviledge) and - (delete this priviledge) indicate the nature of the priviledge change. Finally, the letters r (read), w (write) and x (execute) indicate the nature of the priviledges to be modified. chmod ug+rw demo The first two letters specify user and group. The plus indicates that the priviledges r and w are to be added. The r and w are mnenomics for read and write. Thus, the file demo has now been set to read/write priviledges for you and everyone in your group. chmod o-a file Deny write permission to others. chmod +x file Make a file executable. -50-

chmod 644 file Assign read and write permission to the file owner, and read permission to everybody else. You can assign priviledges numerically as this example shows but this is best only for advanced users. See the man pages on chmod for more information on this option. -51-

Detailed example using ls -a to see what happens to files. [9] % ls lab1.lis lab1.o lab1.x lab2.llis lab2.s lab1.llis lab1.s lab2.lis lab2.o lab2.x [10] % ls -l total 36 -rw-rw-rw- 1 merat users 4348 Sep 17 09:32 lab1.lis -rw-rw-rw- 1 merat users 763 Sep 17 09:44 lab1.llis -rw-rw-rw- 1 merat users 1096 Sep 17 09:32 lab1.o -rw-rw-rw- 1 merat users 1121 Sep 17 09:30 lab1.s [11] % chmod o-rw lab1.s [12] % ls -l total 36 -rw-rw-rw- 1 merat users 4348 Sep 17 09:32 lab1.lis -rw-rw-rw- 1 merat users 763 Sep 17 09:44 lab1.llis -rw-rw-rw- 1 merat users 1096 Sep 17 09:32 lab1.o -rw-rw---- 1 merat users 1121 Sep 17 09:30 lab1.s [13] % chmod 400 lab1.s [14] % ls -l total 36 -rw-rw-rw- 1 merat users 4348 Sep 17 09:32 lab1.lis -rw-rw-rw- 1 merat users 763 Sep 17 09:44 lab1.llis -rw-rw-rw- 1 merat users 1096 Sep 17 09:32 lab1.o -r-------- 1 merat users 1121 Sep 17 09:30 lab1.s The stat bits indicate, in order, the owner, user_group and others access privileges. The bits are read, write and execute in that order. -52-

HELP Often additional information about a UNIX command can be obtained using the man (short for manual) pages. $man man will provide information about using the man command $man ls will provide information about the list command $man cp will provide information about the copy command The information will typically be in the form: NAME SYNOPSIS DESCRIPTION --More-- (11%) what it does valid forms of the command, [anything in square brackets is optional] detailed description of command indicates how much of the file remains to be viewed, similar to the more command Course related help can be gotten by sending mail to: help@dumbo ee282@dumbo -53-

MAIL $mailx <user_name> Subject: <short subject title> Now type message.. end of message indicator $mailx no arguments >N 1 fm Tue Jan1991 10:05 6/94 Grades. N 2 fm Tue Jan1991 10:05 6/94 Exams. N 3 fm Tue Jan1991 10:05 6/94 HW. where: N indicates a new message, U would indicate an unread-message, The numbers 1,2,3, etc. indicate the message number. The name fm indicates who sent you the message. The date and time are self-explanatory. The n/m (6/94 in this case) indicate the message has n lines and is m characters long. The last entry on each line is the subject title of the message. To read messages: $<return> will read the current message, indicated by > $ n will read message number n You can get help in mailx by typing h You can quit mailx by typing q -54-

NEWS Used to keep you informed of important system news such as exam dates, when the computer will be down, etc. News will be indicated when you log onto the system. Once read the login message will not be shown. To read old news use the command $news -a To read a specific news item use the command: $news <file_name> -55-