CPSC 2800 Linux Hands-on Lab #7 on Linux Utilities. Project 7-1



Similar documents
CPSC2800: Linux Hands-on Lab #3 Explore Linux file system and file security. Project 3-1

USEFUL UNIX COMMANDS

USB 2.0 Flash Drive User Manual

Partek Flow Installation Guide

Hands-On UNIX Exercise:

Thirty Useful Unix Commands

Dalhousie University CSCI 2132 Software Development Winter 2015 Lab 7, March 11

Introduction to Operating Systems

INASP: Effective Network Management Workshops

Lab: Data Backup and Recovery in Windows XP

Step One: Installing Rsnapshot and Configuring SSH Keys

Navigating the Rescue Mode for Linux

System Resources. To keep your system in optimum shape, you need to be CHAPTER 16. System-Monitoring Tools IN THIS CHAPTER. Console-Based Monitoring

Volume SYSLOG JUNCTION. User s Guide. User s Guide

Hadoop Basics with InfoSphere BigInsights

Lab - Data Backup and Recovery in Windows XP

Oracle Enterprise Manager

Introduction to the UNIX Operating System and Open Windows Desktop Environment

System Administration and Log Management

II. Installing Debian Linux:

AlienVault Offline Key Activation

How To Set Up A Backupassist For An Raspberry Netbook With A Data Host On A Nsync Server On A Usb 2 (Qnap) On A Netbook (Qnet) On An Usb 2 On A Cdnap (

Command Line - Part 1

Laboration 3 - Administration

Server Management Tools (ASMT)

Hypercosm. Studio.

How to use the VCCS Student System

Network Management & Monitoring Request Tracker (RT) Installation and Configuration

Linux Development Environment Description Based on VirtualBox Structure

Unix Sampler. PEOPLE whoami id who

Recover Data Like a Forensics Expert Using an Ubuntu Live CD

Moving Files from TSO to a PC

Do it Yourself System Administration

Unix Guide. Logo Reproduction. School of Computing & Information Systems. Colours red and black on white backgroun

CMSC 216 UNIX tutorial Fall 2010

TOP(1) Linux User s Manual TOP(1)

Using Secure4Audit in an IRIX 6.5 Environment

Using the Radmind Command Line Tools to. Maintain Multiple Mac OS X Machines

TEL2821/IS2150: INTRODUCTION TO SECURITY Lab: Operating Systems and Access Control

University of Pennsylvania Department of Electrical and Systems Engineering Digital Audio Basics

Linux System Administration. System Administration Tasks

NRPE Documentation CONTENTS. 1. Introduction... a) Purpose... b) Design Overview Example Uses... a) Direct Checks... b) Indirect Checks...

New Lab Intro to KDE Terminal Konsole

IDS and Penetration Testing Lab III Snort Lab

Part 3: Accessing Local drives and printers from the Terminal Server

On Disk Encryption with Red Hat Enterprise Linux

End User Setup and Handling

Configuring MailArchiva with Insight Server

INSTALL ZENTYAL SERVER

Reference Document. SedonaOnline Support

VERSION 9.02 INSTALLATION GUIDE.

Local Caching Servers (LCS) February 2015

System Administration Guide

RSA SecurID Token User Guide February 12, 2015

State of Michigan Data Exchange Gateway. Web-Interface Users Guide

Once you ve signed up, all you ll have to do is sign in. To sign in key in your address and password.

Partitioning. Files on the Hard Drive. Administration of Operating Systems DO2003. Partition = Binder with index. Write file = Insert document

Get quick control over your Linux server with server commands

UNIX Comes to the Rescue: A Comparison between UNIX SAS and PC SAS

YubiKey OSX Login. yubico. Via Yubico-PAM Challenge-Response. Version 1.6. October 24, 2015

System Administration

Team Foundation Server 2010, Visual Studio Ultimate 2010, Team Build 2010, & Lab Management Beta 2 Installation Guide

IUCLID 5 Guidance and support. Installation Guide Distributed Version. Linux - Apache Tomcat - PostgreSQL

Customer Release Notes for Xerox Integrated Fiery Color Server for the Xerox Color C75 Press, version 1.0

Managing Software and Configurations

Network Security, ISA 656, Angelos Stavrou. Snort Lab

Installation Guide Mac OS X Operating Systems

DocuShare Installation Guide

Using New Relic to Monitor Your Servers

CIT 470: Advanced Network and System Administration. Topics. Performance Monitoring. Performance Monitoring

NovaBACKUP Storage Server User Manual NovaStor / April 2013

Linux System Administration on Red Hat

List of FTP commands for the Microsoft command-line FTP client

Configuring System Message Logging

HOWTO: Set up a Vyatta device with ThreatSTOP in router mode

Download and Install the Citrix Receiver for Mac/Linux

Centralized Mac Home Directories On Windows Servers: Using Windows To Serve The Mac

Top 10 Things to Know about WRDS

On-Campus Employer Guide

Lab III: Unix File Recovery Data Unit Level

DiskPulse DISK CHANGE MONITOR

SJRWMD Cloud-Based Quick-Start Guide

Apple Mail Outlook Web Access (OWA) Logging In Changing Passwords Mobile Devices Blackberry...

SYSTEM ADMINISTRATION LAB

An Introduction to SAS/SHARE, By Example

Local Caching Servers (LCS): User Manual

Using the Command-Line Interface

This presentation explains how to monitor memory consumption of DataStage processes during run time.

User Guide and Tutorial Central Stores Online Ordering System. Central Stores Financial Services Western Washington University

Recording Supervisor Manual Presence Software

Center for Faculty Development and Support. Gmail Overview

An Introduction to the Linux Command Shell For Beginners

ORACLE NOSQL DATABASE HANDS-ON WORKSHOP Cluster Deployment and Management

NetIQ Sentinel Quick Start Guide

White Paper. Fabasoft on Linux Cluster Support. Fabasoft Folio 2015 Update Rollup 2

1.0. User s Guide & Manual USB 2.0 FLASH DRIVE

You can find the installer for the +Cloud Application on your SanDisk flash drive.

Transcription:

CPSC 2800 Linux Hands-on Lab #7 on Linux Utilities Project 7-1 In this project you use the df command to determine usage of the file systems on your hard drive. Log into user account for this and the following projects. To use the df command to check file system usage: 1. Log in as root by typing su, and type password 123456. 2. Or type sudo df and then type password 123456, and press Enter. Record your output: 3. You can specify a file system as an argument. The statistics for that file system alone appear on the screen. Type df /dev/sda1 (or another partitioned disk appropriate to your system), and press Enter. You see the disk statistics for that volume only. Record your observation: 4. The h option causes the numbers to print in human-readable form. Instead of displaying raw numbers for size, amount of disk space used, and amount of space available, the statistics are printed in kilobyte, megabyte, or gigabyte format. Type df h and then press Enter. Record your observation: 5. If you want to log in to user account again, type login user, and type password 123456. 6. Type clear and press Enter to clear the screen. Project 7-2 When you want to see directory, subdirectory, and file size information, use the du command. In this project you use the du command to learn about your disk use. To report on disk use: 1. To receive a report on disk usage starting at your home directory, type du more, and then press Enter. Record your output: 2. The output shows the number of blocks used in each subdirectory. Type q to exit the more command. 3. To view a similar report on disk usage by the number of bytes instead of by 512-byte blocks, start at your home directory, type du b more, and then press Enter. 4. Type q to exit the more command. 5. Like the df command, the du command supports the h option to display statistics in humanreadable format. Type du h more and then press Enter. 6. Type clear and press Enter. Project 7-3 In this project, you use the find command to search for and delete all occurrences of a.out and core. The steps that follow assume you have a source directory in your home directory. The test files, a.out and 1

core, are quickly created using the touch command, which, when followed by the file names, creates empty files. The tilde (~) ensures that these files go into your home and source directories. You should already have a source directory for this project. If not, create a source directory under your home directory before you start. To remove garbage files: 1. Create some garbage files, core and a.out, and place them in your home directory and in the source subdirectory under your home directory. First type touch ~/core; touch ~/a.out and press Enter to create the files in your home directory. Next type touch ~/source/core; touch ~/source/a.out and press Enter. 2. Verify that you are in your home directory, type find. "(" -name a.out -o -name core ")" and then press Enter. You should see a listing of the four files you created in step 1, the core and a.out files in the home directory and in the source directory under the home directory. 3. Remove the garbage files by typing find. "(" -name a.out -o -name core ")" -exec rm {} \; and then pressing Enter. 4. Check that the files have been removed by repeating the find command you entered in step 2. If the files have been removed, there is no output. Screen shot your work: Project 7-4 Sometimes, your system might respond slowly or seem to have delays. In these conditions, it is useful to employ the top command to monitor CPU use by processes and other system information, as you learn in this project. To use the top utility: 1. Display the CPU activity by typing top and then pressing Enter. Record your screen: 2. The processes are shown in the order of the amount of CPU time they use. After looking at the display for a short time, press q to exit from the top utility. 3. Run the top utility again. Notice that the far-left column of information, labeled PID. This column lists the process id of each process shown. Record PID of top command: 4. Press k to initiate the kill command. The top utility asks to enter the PID to kill. Enter the PID of the top command. Press Enter to kill the process (You might have to press Enter a second time to return to a command prompt.) Type clear and press Enter to clear the lines from the screen. The top utility is no longer running. 5. Run the top utility in secure mode by typing top -s and press Enter. 6. Press k to initiate kill command. Because top is running in secure mode, it displays the message can t kill in secure mode. Record your screen: 7. Press q to exit the top utility. 8. Type clear and press Enter to clear the lines from the screen. 2

Project 7-5 Plan to periodically monitor memory use in your computer, particularly if the computer seems to run slowly when you use specific programs. In this project, you use the free command to monitor memory. To use the free command: 1. Type free and press Enter. The command displays the amount of total, used, and free memory. It also displays the amount of shared memory, buffer memory, and cached memory. In addition, the amount of total, used, and free swap memory is shown. By default, all amounts are shown in kilobytes. 2. Type free m and press Enter to see the free command s output in megabytes. 3. Type free t and press Enter to see memory use totals: Project 7-6 There are times when you might want to send the results of the top and free utilities to a computer support person for help. In this project, you save the results from these utilities to different files and then print the files. To save and print the displays generated by the top and free utilities: 1. Redirect the output of the top utility to a file in your current directory by typing top > topdata and then press Enter. 2. Wait about 10 seconds, and then press q to exit the top utility. Type more topdata and press Enter to confirm you have written the information to the topdata file. Type q to exit the more display of the file contents. 3. Redirect the output of the free utility to a file in your current directory by typing free > freedata and then pressing Enter. Type more freedata and press Enter to verify the contents of the freedata file. Record your output: 4. Type clear and press Enter to clear the screen. Project 7-7 In Linux/Unix, you can run programs in the background. In this project, you practice running the top program in the background. To run a program in the background: 1. Experiment with running a program in the background by running the top program in the background. Type top& and press Enter. After you enter the command, the system reports the process id or PID (id that identifies the process) used by the program that you started in the background. Write down our PID: 3

The top utility is running, but because it runs in the background, you see no other output. 2. Continue to run the top utility in the background. Project 7-8 In this project, you learn how to use the ps command to view processes on your system. To use ps command: 1. Type ps and press Enter. The output of the ps command includes this information about each process you are running: PID Name of the station where the process started Amount of time the process has been running Name of the process Notice that top utility might still be running in the background, or you might see a message at the end of the ps display that top has stopped running. 2. To see a list of all processes running on the system, type ps a more, and press Enter. 3. Press the spacebar until the command finishes its output. 4. Notice that with the command options you ve used so far, it is difficult to tell the status of a process, such as whether or not it has finished. Type ps l (that is, a lower-case of letter l and not a one), and press Enter to see the long display. The WCHAN column shows the status of a process, such as finish. 5. Now consider that you want to know who is running a particular process, by user name. Type ps a u more and press Enter. Record your screen: Press the spacebar to scroll through the listing. Notice that many processes are being run by root as well as by your account. Project 7-9 Sometimes, you need to stop a process, such as one running in the background or one that you no longer want to use. In this project, you use the kill command to stop a process. To stop a process using the kill command: 1. In this step, you terminate the top utility that you started before and that might still be running in the background. (If you received a message that it stopped, continue anyway for practice.) Type ps and press Enter. Look at the list of processes to find the top utility s PID. 2. Type one of these commands (both perform the same operation): kill <process id> and press Enter, or kill %top and press Enter. 3. Type ps l and press Enter to see a list of the processes and to check the status of the top process. Record your output: 4

Project 7-10 In you often work with plain-text documents, it is helpful to know about the ispell command for spell checking. You practice using ispell in this project. To use ispell: 1. Use the vi or other editor create a file called document1. 2. Enter the following text, with misspellings: This is a document that describes our newest and fastest machinnery. Take the time to lern how to use each piece of equipment. 3. Save the file and exit the editor. 4. (Type sudo apt-get install ispell and password to install ispell if you do not have it. ) 5. Scan the file for spelling errors by typing ispell document1 and then press Enter. 6. To correct the word machinnery, look at the options at the bottom of the screen, and find the one that says machinery. Type the number of that option to correct the misspelling, or you can select the r (Replace) option, retype the word after the With: Prompt, and press Enter. Notice that the word is then corrected in the text. 7. Do the same for lern. 8. The program exists and returns you to the command line. Type cat documnet1 and press Enter. The misspelled words have been corrected. Record your screen: Project 7-11 In this project, you create two files and use the cmp command to compare the differences. To compare two files with the cmp command: 1. Use the vi or other editor to create the file file1, containing this text: This is file 1. It is a practice file. It belongs to me. 2. Save the file and exit the editor. 3. Use the editor to crate the file file2, containing the text: This is file 2. It is a practice file. It belongs to you. 4. Save the file and exit the editor. 5. At the command line, type cmp file1 file2, and press Enter. Your screen looks like: 6. This results means that the two files differ, with the first point of differences at the 14 th character in both files. 7. Type clear and press Enter to clear the screen. 5

Include your experiences and answers to all the underlying parts in your report. Include the following at the beginning of your report. Name: UTC ID: Course Number and Name: Semester: Lab Name and Number: I spent hours and minutes to finish this hands-on lab. I have (percent) finish this lab. I expect (A, B, C, or F) of this lab. This lab helps me to master Linux utilities and commands. Choose a number to indicate how much the lab is helpful. 1 2 3 4 5 (less helpful) (more helpful) 6