Presentation is loading. Please wait.

Presentation is loading. Please wait.

A Guide to Unix Using Linux Fourth Edition

Similar presentations


Presentation on theme: "A Guide to Unix Using Linux Fourth Edition"— Presentation transcript:

1 A Guide to Unix Using Linux Fourth Edition
Chapter 9 Exploring the UNIX/Linux Utilities

2 Understanding UNIX/Linux Utilities
UNIX/Linux utilities are classified into: File processing System status Networking Communications Security Programming Source code management Miscellaneous A Guide to Unix Using Linux, Fourth Edition

3 Classifying UNIX/Linux Utilities
Several categories Network tasks Programming tasks File-processing utilities A Guide to Unix Using Linux, Fourth Edition

4 Checking Hard Disk Usage
Basic strategies used to maintain adequate free space: Be vigilant against running dangerously low on free space Use df command Watch for conspicuous consumption Use du command Follow a routine schedule for “garbage” collection and removal Use a combination of find and rm commands A Guide to Unix Using Linux, Fourth Edition

5 Using the df Utility If entered without specifying file system, shows information for all mounted file systems A Guide to Unix Using Linux, Fourth Edition

6 Using the df Utility (continued)
A Guide to Unix Using Linux, Fourth Edition

7 Using the du Utility With no options, report is based on all file usage Starts at current directory By default, output is in number of 512-byte blocks A Guide to Unix Using Linux, Fourth Edition

8 A Guide to Unix Using Linux, Fourth Edition

9 Using System Status Utilities
System status commands reflect system’s performance You can redirect the output of these commands to a file File can later be: Printed Forwarded to system administrator and system tune-up specialists A Guide to Unix Using Linux, Fourth Edition

10 Using the top Command A Guide to Unix Using Linux, Fourth Edition

11 Using the uptime Command
Example: use it to track how long system has been up since last problem requiring a reboot A Guide to Unix Using Linux, Fourth Edition

12 Using the free Command Swap space is disk space that acts like an extension of memory A Guide to Unix Using Linux, Fourth Edition

13 Using the free Command (continued)
A Guide to Unix Using Linux, Fourth Edition

14 Forwarding top and free Output
You may forward output of top and free to a computer support person for analysis Example: top n 3 > topdata cat topdata A Guide to Unix Using Linux, Fourth Edition

15 Managing Processes When you run a program, it starts one or more processes Processes are identified through a unique number Process id or PID UNIX and Linux offer utilities to: Manage how a program is run Monitor processes Kill processes A Guide to Unix Using Linux, Fourth Edition

16 Running Processes in the Background
UNIX/Linux is a multitasking OS You can run processes in the background To run a process in background: Append the & character Example: top& A Guide to Unix Using Linux, Fourth Edition

17 Monitoring Processes If used with no options, shows a list of processes associated with the current login session A Guide to Unix Using Linux, Fourth Edition

18 Monitoring Processes (continued)
A Guide to Unix Using Linux, Fourth Edition

19 Killing Processes System administrator may want to kill a user’s process because: Associated program is malfunctioning Associated program is using too many system resources A user may want to kill a process that is running in the background A Guide to Unix Using Linux, Fourth Edition

20 Using Networking Utilities
UNIX and Linux offer many utilities to accommodate a connection to the network ifconfig ping traceroute netstat A Guide to Unix Using Linux, Fourth Edition

21 Using the ifconfig Utility
Internet Protocol (IP) is used to help ensure that information on a network goes to the right place IP address uses a dotted decimal notation Consists of four octets separated by periods Identifies a computer/device and the network it is on A Guide to Unix Using Linux, Fourth Edition

22 Using the ping Utility Examples: ping rbrown@xxx.com ping redhat.com
A Guide to Unix Using Linux, Fourth Edition

23 Using the traceroute Utility
Sample use: To ensure your computer is connected and working To ensure your network is working from point to point A Guide to Unix Using Linux, Fourth Edition

24 Using the netstat Utility
Information provided by netstat includes: Network protocol communications Network connections established by host computer Network routing information Information about remotely logged computers (netstat –atn) A Guide to Unix Using Linux, Fourth Edition

25 Software Development Process
Creation of source files (.c,.h,.cpp) Compilation (e.g. *.c *.o) and linking Running and testing programs g++ and make

26 Development Tools Creation of source files (*.c, *.h, *.cpp)
Text editors vi, nano Compilation (*.o) and linking Compilers gcc, g++ g++ and make

27 Basic g++ Examples g++ hello.cpp g++ -o hello hello.cpp
compile hello.cpp produce executable a.out g++ -o hello hello.cpp produce executable hello g++ -o hello hello.cpp util.cpp compile hello.cpp and util.cpp

28 Basic gcc Examples gcc hello.c gcc -o hello hello.c
compile hello.c produce executable a.out gcc -o hello hello.c produce executable hello gcc -o hello hello.c util.c compile hello.c and util.c

29 gcc/ g++ Options -Wall -c -o <file> -g
compile source files, but do not link output is an object file corresponding to source file -o <file> puts output in file called <file> -g include debugging symbols in the output to be used later by debugging program (gdb) -Wall display all warnings – program may still compile


Download ppt "A Guide to Unix Using Linux Fourth Edition"

Similar presentations


Ads by Google