Linux/Unix Filesystems

Similar documents
Part I. Introduction to Linux

You should see something like this, called the prompt :

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

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

History. Terminology. Opening a Terminal. Introduction to the Unix command line GNOME

Guided Tour (Version 3.3) By Steven Castellucci as Modified by Brandon Haworth

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

Getting Started With UNIX Lab Exercises

Operating Systems and Using Linux. Topics What is an Operating System? Linux Overview Frequently Used Linux Commands

Brief Linux Presentation. July 10th, 2006 Elan Borenstein

Programming and Data Structure Laboratory (CS13002)

Helpful Tips for Labs. CS140, Spring 2015

CSE 391 Lecture 1. introduction to Linux/Unix environment

Linux hep.wisc.edu

Unit 13. Linux Operating System Debugging Programs

Unit 10. Linux Operating System

Commands are in black

Introduction to Linux. Fundamentals of Computer Science

Matlab = Matrix Laboratory. It is designed to be great at handling matrices.

Introduction to Linux Spring 2014, Section 02, Lecture 3 Jason Tang

Working with Basic Linux. Daniel Balagué

CSE 391 Lecture 1. introduction to Linux/Unix environment

Using the Zoo Workstations

User Guide Version 2.0

Lab Working with Linux Command Line

CS 2400 Laboratory Assignment #1: Exercises in Compilation and the UNIX Programming Environment (100 pts.)

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

Introduction to Linux

CSCI 2132 Software Development. Lecture 4: Files and Directories

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

CMSC 104 Lecture 2 by S Lupoli adapted by C Grasso

CSE 390a Lecture 1. introduction to Linux/Unix environment

C++ Programming on Linux

Guided Tour (Version 3.4) By Steven Castellucci

Pivotal Capgemini Just Do It Training HDFS-NFS Gateway Labs

CENG 334 Computer Networks. Laboratory I Linux Tutorial

2. Click on the Launch button and select Terminal. A window will appear which looks like:

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

Introduction to the Linux Command Line

HOW TO Use Linux, Text-Edit, Compile, and More

CS CS Tutorial 2 2 Winter 2018

Tutorial 1: Unix Basics

Laboratory 1 Semester 1 11/12

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

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.

Using LINUX a BCMB/CHEM 8190 Tutorial Updated (1/17/12)

Introduction to UNIX command-line

Mills HPC Tutorial Series. Linux Basics I

Lab 2: Linux/Unix shell

Introduction to Lab Sessions

Linux Command Line Primer. By: Scott Marshall

AN INTRODUCTION TO UNIX

Physics REU Unix Tutorial

Lecture 01 - Working with Linux Servers and Git

Arkansas High Performance Computing Center at the University of Arkansas

The Directory Structure

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.

Lab 1 Introduction to UNIX and C

Introduction to Unix - Lab Exercise 0

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

Lab 1: Introduction to Linux Networking

Lab Assignment #1. University of Pittsburgh Department of Electrical and Computer Engineering

Prof. Navrati Saxena TA: R. Sachan

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

Linux/Cygwin Practice Computer Architecture

Essential Linux Shell Commands

CSCI 161: Introduction to Programming I Lab 1a: Programming Environment: Linux and Eclipse

CSC116: Introduction to Computing - Java

Bioinformatics? Reads, assembly, annotation, comparative genomics and a bit of phylogeny.

In this exercise you will practice working with HDFS, the Hadoop. You will use the HDFS command line tool and the Hue File Browser

CENG393 Computer Networks Labwork 1

Parallel Programming Pre-Assignment. Setting up the Software Environment

Introduction of Linux

Linux at the Command Line Don Johnson of BU IS&T

WHAT IS MATLAB?... 1 STARTING MATLAB & USING THE COMMAND LINE... 1 BASIC ARITHMETIC OPERATIONS... 5 ORDER OF OPERATIONS... 7

CMSC 201 Spring 2017 Lab 01 Hello World

Introduction to Linux

The Unix Shell & Shell Scripts

GEO 425: SPRING 2012 LAB 9: Introduction to Postgresql and SQL

Introduction to Supercomputing

Programming Studio #1 ECE 190

Introduction to Linux

Linux + Galaxy Server Tutorial

Files

CHAPTER 1 UNIX FOR NONPROGRAMMERS

Unix Tutorial Haverford Astronomy 2014/2015

CSE115 Lab exercises for week 1 of recitations Spring 2011

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

CS 307: UNIX PROGRAMMING ENVIRONMENT KATAS FOR EXAM 1

Session 1: Accessing MUGrid and Command Line Basics

Intermediate Programming, Spring Misha Kazhdan

CS 215 Fundamentals of Programming II Spring 2019 Very Basic UNIX

Getting Started with UNIX

CSC116: Introduction to Computing - Java

CS1101: Lecture 5 Basic File Manipulation II

Introduction to the UNIX command line

AMS 200: Working on Linux/Unix Machines

PDS Lab Section 16 Autumn Tutorial 1. Unix Commands pwd The pwd command displays the full pathname of the current directory.

CMSC 201 Spring 2018 Lab 01 Hello World

Transcription:

Linux/Unix Filesystems Objectives: The lab exercise is designed to introduce you to the linux operating system and environment employed in the Geography Department's Lab. This exercise covers: - How to log in and start working with linux - How linux files are organized and used - Several important commands for examining and manipulating files This lab concentrates on command line operations from the terminal window. It is possible to do all of this via a graphical interface using the konqueror file browser, available by clicking the Home icon on the desktop panel. Open that application, click on the File System icon, and change the view setting to Details. Task Overview Create a new directory called labs, then cd to labs and create a directory called lab1. Furthermore, cd to lab1 and create subdirectories called 1) michigan, 2) indiana, and 3) ohio. Then create 6 subdirectories, 2 under directory michigan called Detroit and lansing, 2 under directory indiana called Indianapolis and tipton, and 2 under into your lab1 directory. Then copy your address file to subdirectories lansing, indianapolis, and columbus. Furthermore, move address file from lansing subdirectory to tipton subdirectory and rename it new. Finally, delete columbus subdirectory and move back to your home directory. Detailed Instructions Step1: Log In Log in by entering your log-in name/password. In the menu on the lower-left, click linapps and log in again. A KDE desktop environment should spring up.

Step2: Create directories 1. Start a terminal window by clicking K System Konsole 1.Check your current location. What does it say? 2. If you are not in your home directory, change your current location to your home directory. %cd /home/your_username or %cd ~ 3. List all files in your current location. How many files do you have? %ls 4. If you don't already have one, create a directory called labs, then cd to labs, and create a directory called linux_lab. %mkdir labs %cd labs %mkdir linux_lab 5. Change directory to linux_lab. %cd linux_lab (full path: cd /home/<your_username>/labs/linux_lab) 6. Check your current location. 7. Create subdirectories called michigan, indiana, and ohio under this directory. %mkdir michigan %mkdir indiana %mkdir ohio 8. List all files in your current location and check that they should be 3 subdirectories. %ls 9. Now move to the michigan directory with the cd command. %cd michigan (full path: cd /home/<your_username>/labs/linux_lab) 10. Create 2 subdirectories called detroit and lansing. %mkdir detroit %mkdir lansing 11. Examine the differences between ls and ls l. What does column 5 show? %ls l 12. Move to the indiana subdirectory from michigan. What's the difference between cd /home/<your_username>/labs/linux_lab) and cd../indiana? 13. Create other 2 subdirectories under indiana. %mkdir indianapolis

%mkdir tipton 14. List all files, including hidden files. What is the.. file? %ls a 15. Move to the ohio subdirectory. %cd /home/<your_username>/labs/linux_lab/ohio 16. Create other 2 subdirectories. What happens if you type cd ashland? %mkdir ashland %mkdir columbus Step 3: Create a text file 1. Open the text editor, by clicking K Utilities Editors Kwrite. 2. Type your name and your address. 3. Save the document and name it address.txt in your linux_lab folder. Step 4: Examine and manipulate files 1. Back in the terminal window, check your current location. 2. Move to your linux_lab directory and list the files. Write the commands you type to do this 3. Look at the contents of address.txt from the command line. %more address.txt 4. Copy your address.txt file to the assigned subdirectories (lansing, indianapolis, and columbus). The following command copies just to lansing: %cp /home/<your username>/labs/linux_lab/address.txt /home/<your username>/labs/linux_lab/michigan/lansing/address.txt Write down how to copy the same file to other assigned subdirectories. You can also try: Go to your destination location using cd and then copy the file from the source location. %cp ~/labs/linux_lab/address.txt address.txt 5. Now change to the directory that you want to move the file from. %cd ~/labs/linux_lab/michigan/lansing 6. Move the file from lansing to the tipton subdirectory and rename it new. %mv address.txt../../indiana/tipton/new

7. List all files to see the your new file %ls../../indiana/tipton or ls ~/labs/linux_lab/indiana/tipton Step 5: Delete a subdirectory 1. We'll delete 'columbus'. Always wanted to do that... 2. You will have to find out what the command for removing a directory is. Make sure you are in the ohio subdirectory (~/labs/linux_lab/ohio). Check the hints section for help. After you have done deleting, move back to your home workspace. Step 6: Report Write down answers for the questions in the Report section and hand it in to TA. Step 7: Log out Click on the Launch bar and choose Log Out. Then log out of the thin-client gateway server. IMPORTANT: Make sure you log out every time you finish lab class!!! Report 1. Contrast the differences between commands cd and pwd. 2. What is the option of the list command that will show the properties of files? 3. Explain how to remove the directory 'columbus' and indicate any problems you had. 4. How many bytes are occupied by the labs directory? 5. How can you get more information about a linux command (See Hints below!)?

Hints and commands The linux File Structure: Linux organizes files into a tree directory system. If you want to work with a particular file, the system has to know which sequence of directories it must search in order to find the file you want. A path name specifies a file by giving a sequence of directories and the file s name. Linux also lets you cd to a directory (just as in DOS) and then refer to files under that directory with relative path names. Tip: Previous commands you entered in the terminal window are stored in a buffer, or list. To repeat old commands press the up arrow. Some helpful Linux commands: man: MANual. Give this command with the command you need more information on, and a series of manual will appear that describe how to use the specified utility. cd: Change Directory. Use cd to move to different directories on the network. cd.. moves you up one directory in the tree. cd ~ or cd by itself will move you to your home directory. pwd: Present Working Directory. Use pwd to see the name of the directory you are currently in. ls: LiSt. Use ls to see the contents of your current directory. ls l: List (Long option). Use ls l to see file properties. ls a: will list all files in the directory (including hidden files). rm: ReMove files. rm r: removes a directory. mv: moves a file from one directory to another. cp: Copy. Copies a specified file or files from a specific location to a specific location (directory). Source and destination files, with paths, must be specified. mkdir: Make directory. rmdir: Remove directory. more: will display an ASCII text file on the screen. du sk <directory>: shows number of kilobytes stored in that directory. Credits/Blame Written by Perry Varnakovida and Ashton Shortridge (2002, 2003) Updated by Ashton Shortridge (2006, 2008, 2010, 2012)