Linux Tutorial #7. quota. df (disk free) du (disk usage)

Similar documents
Linux Tutorial #6. -rw-r csce_user csce_user 20 Jan 4 09:15 list1.txt -rw-r csce_user csce_user 26 Jan 4 09:16 list2.

Introduction to Unix: Fundamental Commands

Chapter-3. Introduction to Unix: Fundamental Commands

Lecture 5. Additional useful commands. COP 3353 Introduction to UNIX

7. Archiving and compressing 7.1 Introduction

Arkansas High Performance Computing Center at the University of Arkansas

CS 460 Linux Tutorial

UNIX Tutorial Two

Session: Shell Programming Topic: Additional Commands

Introduction to the shell Part II

Linux Tutorial #4. Redirection. Output redirection ( > )

Introduction To Linux. Rob Thomas - ACRC

Introduction to Linux

Unix basics exercise MBV-INFX410

Practical Unix exercise MBV INFX410

A Short Introduction to UNIX Operating System

Intro to Linux. this will open up a new terminal window for you is super convenient on the computers in the lab

Open up a terminal, make sure you are in your home directory, and run the command.

The Directory Structure

Unix Tools / Command Line

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.

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.

Introduction: What is Unix?

Utilities. September 8, 2015

1 Very Short Linux Manual

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.

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

Introduction to UNIX command-line

UNIX and Linux Essentials Student Guide

Unzip command in unix

CENG 334 Computer Networks. Laboratory I Linux Tutorial

The Unix Shell & Shell Scripts

Hitchhiker s Guide to VLSI Design with Cadence & Synopsys

Table Of Contents. 1. Zoo Information a. Logging in b. Transferring files 2. Unix Basics 3. Homework Commands

CSC209. Software Tools and Systems Programming.

Introduction to the Linux Command Line

Introduction to Linux. Roman Cheplyaka

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

Ubuntu unzip tar file

UNIX Tutorial One

Lab #1 Installing a System Due Friday, September 6, 2002

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

CSC UNIX System, Spring 2015

Handling Ordinary Files

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

Practical Linux examples: Exercises

1 Installation (briefly)

Computer Systems and Architecture

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

Reading and manipulating files

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

UNIX File Hierarchy: Structure and Commands

Parts of this tutorial has been adapted from M. Stonebank s UNIX Tutorial for Beginners (

Introduction to Linux

The Linux Command Line & Shell Scripting

This is Worksheet and Assignment 12. Disks, Partitions, and File Systems

A Brief Introduction to the Linux Shell for Data Science

PROGRAMMAZIONE I A.A. 2015/2016

Files

CST8207: GNU/Linux Operating Systems I Lab Nine Disks, Partitions, and File Systems Part 2. Disks, Partitions, and File Systems - Part 2 of 2

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

Subcontractors. bc math help for the shell. interactive or programatic can accept its commands from stdin can accept an entire bc program s worth

C Shell Tutorial. Section 1

COMS 6100 Class Notes 3

Running Programs in UNIX 1 / 30

CST8207: GNU/Linux Operating Systems I Lab Ten Boot Process and GRUB. Boot Process and GRUB

Exercise 1: Basic Tools

Computer Systems and Architecture

Introduction. File System. Note. Achtung!

UNIX files searching, and other interrogation techniques

Introduction to UNIX I: Command Line 1 / 21

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

Using WestGrid from the desktop Oct on Access Grid

UNIX Tutorial One. 1.1 Listing files and directories. ls (list) 1.2 Making Directories

5/8/2012. Exploring Utilities Chapter 5

UNIX Tutorial Five

CMPS 12A Introduction to Programming Lab Assignment 7

CSC111 Computer Science II

Basic Shell Commands

This is Lab Worksheet 13 - not an Assignment. Boot Process and GRUB

Cloud Computing and Unix: An Introduction. Dr. Sophie Shaw University of Aberdeen, UK

Command-line interpreters

Unix - Basics Course on Unix and Genomic Data Prague, January 2017

Cloud Computing and Unix: An Introduction. Dr. Sophie Shaw University of Aberdeen, UK

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

CST Algonquin College 2

Scripting Languages Course 1. Diana Trandabăț

Introduction to UNIX command-line II

How to Back-Up a fit-pc2 Using Only a USB Stick (and some creative partitioning)

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

INSE Lab 1 Introduction to UNIX Fall 2017

Contents. Note: pay attention to where you are. Note: Plaintext version. Note: pay attention to where you are... 1 Note: Plaintext version...

Introduction to Linux Part 1. Anita Orendt and Wim Cardoen Center for High Performance Computing 24 May 2017

Part I. Introduction to Linux

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

Open Source Computational Fluid Dynamics

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

Name: Peter Lemieszewski Venue: Education

Lab 4: Bash Scripting

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

Transcription:

Linux Tutorial #7 quota On many computer systems, the system administrator has to restrict the amount of disk space users are allowed to use in order to avoid running out of space on the shared file system. The quota command can be used to find out what your quota is on a particular machine. To check your current quota and how much of it you have used, type % quota v This will show you how many GB of files you can store in your account. If you have a quota of none this means that you can use all the space you need (within reason). The system administrator will establish a policy for what happens if you exceed your quota. For example, you may have 7 days to delete files to get under quota. df (disk free) The df command reports on the amount of space free on the file system. On many systems, there are several disks mounted, and you can find out which disk is nearly full, which is nearly empty, and decide where to put your large files accordingly. For example, to find out how much space is free on the fileserver, type % df du (disk usage) The du command outputs the number of byes used by each subdirectory. This is useful if you have gone over quota and you want to find out which directory has the most files. In your home- directory, type % du This will tell you about the sizes of all of your directories, and their subdirectories. If this is too much information, you can get a quick summary by typing % du - s - h *

The - s flag will display only a summary without listing sizes of subdirectories, the - h flag will report total size in K, M, or G instead of bytes, and the * means all files and directories. gzip There are many ways to compress files so they take less disk space. The gzip command is a popular choice on Linux systems. For example, go to your Linuxstuff directory and type % ls - l science.txt and you should see the following, which tells us the file is 7767 bytes long - rw- r- - r- - 1 csce_user csce_user 7767 Jan 4 12:47 science.txt Then to compress science.txt, type % gzip science.txt % ls - l and you will see that the compressed file science.txt.gz is only 3714 bytes long. - rw- r- - r- - 1 csce_user csce_user 3714 Jan 4 12:47 science.txt.gz In general, gzip will reduce the size of a file by 50%, but in some cases you might get 90% reduction or 10% reduction depending on the file contents. gunzip To expand a gzip compressed file, we must use the gunzip command. This will restore the file to its original size without any loss of information. To see this, type % gunzip science.txt.gz % ls - l You should see science.txt has its original size and original time stamp. zcat The zcat command is a useful utility that will read gzipped files without needing to uncompress them using gunzip first. For example, type % zcat science.txt.gz

If the text scrolls too fast for you, pipe the output though less. file % zcat science.txt.gz less The Linux file command classifies the named files according to the type of data they contain, for example ascii (text), pictures, compressed data, etc. To find out about all of the files in your Linuxstuff directory, type % file * If you have science.txt in your directory, you will see something like science.txt: ASCII text If you have science.txt.gz in your directory, you will see something like science.txt.gz: gzip compressed data diff The diff command compares the contents of two files and displays the differences. Suppose you have a file called file1 and you edit some part of it and save it as file2. To see the differences between these two files type % diff file1 file2 Lines that are identical in both files will be ignored, and each line that is different in file1 compared to file2 will be displayed. Lines that begin with a < character are part of file1, and lines that begin with a > character are part of file2. For example, if you had the phrase hello mom in file1 and you changed this to hello dad in file2, you would see something like 3c3 < hello mom, please send money - - - > hello dad, please send money If there are a lot of changes in a file, you may find that a side- by- side display of differences will be easier to read. To do this, you can type % diff - y file1 file2 less

find The find command searches through the directories for files and directories with a given name, date, size, or any other attribute you care to specify. It is a simple command but with many options. You can read the manual by typing man find. To search for all files with the extention.txt, starting at the current directory (.) and working through all sub- directories, then printing the name of the file to the screen, type % find. - name "*.txt" - print To find files over 1MB in size, and display the result as a long listing, type % find. - size +1M - ls To simply count how many files there are in a directory and all of its subdirectories, you can type % find. wc - l history The Linux operating system keeps an ordered list of all the commands that you have entered. Each command is given a number according to the order it was entered. The history command will show you this list of commands. For example, type % history You should see a list of all of the commands that you have used during this tutorial. This can be helpful in case you have forgotten exactly what command you entered earlier. If you are using the bash shell, you can use the exclamation character (!) to recall commands easily. What you put after the! determine what command is executed again. For example, %!! (recall last command) %!- 3 (recall third most recent command) %!5 (recall 5th command in list) %!grep (recall last command starting with grep)

Summary Command quota df du gzip gunzip zcat file diff find history Meaning check your current disk quota and usage report on how much disk space is free report on how much disk space is being used compress an input file to save disk space uncompress an input file to restore original file read compressed file without uncompressing report on the type of data stored in a file display the differences between two files search directory for files based on name or properties print a list of all commands that have been run Author: M.Stonebank@surrey.ac.uk, 9th October 2000 Edited: jgauch@uark.edu, January 2015