Saturday, 1 October 2011

Common Utilities in Windows

And Linux




What makes a good Utility ?

A good utility is one that does its job as well as possible. It has to play well with others; it has to be amenable to being combined with other utilities. A program that doesn't combine with others isn't a utility; it's an application.

Utilities are supposed to let you build one-off applications cheaply and easily from the materials at hand. A lot of people think of them as being like tools in a toolbox. The goal is not to have a single widget that does everything, but to have a handful of tools, each of which does one thing as well as possible.

Some utilities are reasonably useful on their own, whereas others imply cooperation in pipelines of utilities.

So let us put some light on the utilities of various Operating Systems like Linux and Windows.


Common Utilities in Linux !




Linux System Monitoring Tools !

top - Process Activity Command

The top program provides a dynamic real-time view of a running system i.e. actual process activity. By default, it displays the most CPU-intensive tasks running on the server and updates the list every five seconds.

Commonly Used Hot Keys

The top command provides several useful hot keys:

Hot Keys Usage

t Displays summary information off and on.

m Displays memory information off and on.

A Sorts the display by top consumers of various system resources. Useful

for quick identification of performance - hungry task on a system.

o Enables you to interactively select the ordering within top.

r Issues kill command.

z Turns off or on color/mono.



>> top.




>> vmstat.

The command vmstat reports information about processes, memory, paging, block IO, traps, and cpu activity.




>> vmstat –a.

Get Information About Active / Inactive Memory Pages.





>> vmstat –m.

Display Memory Utilization.




>> ps –axZ.

Prints Security Information.




>> Uptime.

The uptime command can be used to see how long the server has been running. The current time, how long the system has been running, how many users are currently logged on, and the system load averages for the past 1, 5, and 15 minutes.






1 can be considered as optimal load value. The load can change from system to system. For a single CPU system 1 - 3 and SMP systems 6-10 load value might be acceptable.

Simplify data extraction using Linux text utilities !


Before you start, you should first understand what regular expressions are and how to use them.

In their simplest form, regular expressions are the search criteria used for locating text in a file. For example, to find all lines containing the word "admin", you can search for "admin". Thus, "admin" constitutes a regular expression. If you want not only to find "admin" but also to replace it with "root", you can give the appropriate commands in a utility to substitute "root" for "admin". Both thus constitute regular expressions.

These basic rules govern regular expressions:


  • Any single character or series of characters can be used to match itself or themselves, as in the "admin" example above.
  • The caret sign (^) signifies the beginning of a line; the dollar sign ($) signifies the end.
  • To literally search for special characters such as the dollar sign, precede them with a backslash (\). For example, \$searches for $ and not the end of a line.
  • The period (.) represents any single character. For example, ad..n stands for five-character entries, the first two being "ad" and the last being "n". The middle two characters can be anything, but there can be only two of them.
  • Any time the regular expression is contained within slashes (for example, /re/), the search is forward through the file. When it is enclosed in question marks (for example, ?re?), the search is backward through the file.
  • Square brackets ([]) signify multiple values, and a minus sign (-) indicates a range of values. For example, [0-9] is the same as [0123456789], and [a-z] is the equivalent of a search for any lowercase letter. If the first character of a list is a caret, it matches any character not in the list.

Table 1 illustrates how these matches work in practice.


Example Description


[abc] Matches one of "a", "b" or "c"


[a-z] Matches any one lowercase letter from "a" to "z"


[0-9] Matches any one no from 0 to 9


[^0-9] Matches any character other than the no from 0-9


[a-zA-Z0-9] Matches any alphabetic or numeric character


With this information under your belt, let's look at the utilities.

>> fgrep.


fgrep searches files for a string and prints all lines that contain that string. Unlike grep, fgrep searches for a string instead of searching for a pattern that matches an expression. The fgrep utility can be thought of as grep with a few enhancements:


>> egrep.

egrep is a more powerful version of grep that allows you to search for more than one object at a time. Objects being searched for are separated by carriage returns (as with fgrep) or by the pipe symbol (|).


Besides the capacity to search for multiple objects, egrep offers the ability to search for repetitions and groups:

  • ? looks for zero repetitions or one repetition of the character that precedes the question mark.
  • + looks for one or more repetitions of the character that precedes the plus sign.
  • ( ) signifies a group.

>> cut.


With the cut utility, you can separate columns that could constitute data fields in a file. The default delimiter is the tab, and the -foption is used to specify the desired field.


>> paste.


The paste utility combines fields from files. It takes one line from one source and combines it with another line from another source.

For example, imagine that the content of a file named "file1.txt" is:

Microsoft
Research
Services

In addition, you have "file2.txt" with this content


India
China
United State

The following command combines the contents of these files, as shown below:





Sysstat Utility !

The Sysstat package contains utilities to monitor system performance and usage activity. Sysstat contains various utilities , common to many commercial Unixes and tools you can schedule via cron to collect and historize performances and activity data.

>> iosat.

It reports CPU stastics and input/output statistics for devices, partitions & network file systems.

>> mpstat.

It reports individual or combined processor related statistics.





>> sar.

It collects, reports & saves system activity information, CPU, memory, disk, interrupts, network interfaces, TTV, Kernel, tables, etc.

>> sadc.

It is the system activity data collector, used as backend for sar.

Time Tracker Tool !

  • Ktimetracker.

Ktimetracker tracks time spent on various tasks. It is useful for tracking billable hours and can report the hours logged by tasks and day.






Editor Tools !

Various editing tools are available in linux like gedit, emacs, kwrite, okteta.

  • Okteta

To start okteta, type okteta at a terminal or select Hex Editor from Applications à Utilities à Okteta.

Okteta is a simple editor for the raw data of files. The data is displayed in the traditional view with two columns: one with nemuric values & one with assigned characters. Editing can be done both in values column & the character column. Besides the usual editing compatibilities, okteta also brings a small set of tools, like a table listing decoding into common simple data types.





Backup Tool !

  • Kbackup.

Kbackup is a simple backup utility that backs up locally to any media (hard drive or mounted device) that can be written to. It’s designed to be a backup device that ANY user can take advantage of. To that end, it is simple and doesn’t have a long feature list. Outside of being able to back up files and directories, the only other feature is that the user can save backup profiles that can be opened and backed up quickly. Kbackup uses the tar format to restore backups, which is as simple as using ARK as a GUI for unpacking the backup files.

Firewall Tool !

An application Firewall is a form of firewall which controls input, output, and/or access from, to, or by an application or service. It operates by monitoring and potentially blocking the input, output, or system service calls which do not meet the configured policy of the firewall. The application firewall is typically built to control all network traffic on any OSI layer up to the application layer. It is able to control applications or services specifically, unlike a stateful network firewall which is - without additional software - unable to control network traffic regarding a specific application.









Common Utilities in Windows !


Backup utility !

This utility helps us to create backup/copies of any data stored in the computer.

We can backup the folders, libraries, and drives. By default, the backups are created on a regular schedule. We can back up our files to a local hard disk, a removable disk, a DVD, or another computer on the network. (We may need to provide credentials to access a network location.)



System restore !

System Restore helps us to restore our computer's system files to an earlier point in time. It's a way to undo the system changes to our computer without affecting our personal files. System Restore uses a feature called system protection to regularly create and save restore points on our computer. These restore points contain information about registry settings and other system information that Windows uses. We can also create restore points manually.



Problem steps recorder !

It’s a quite useful utility in windows. Sometimes, we (users) have certain problems in describing a problem accurately. That’s when PSR comes in handy.

It’s a type of screen capture software that records all the actions like keystrokes, mouse clicks etc and saves the sequence of events in a MHTML page that documents every step the user took, along with screenshots. We can run PSR by writing psr.exe in the Start menu Search box or at the command prompt.





System repair disc !

This utility helps in system recovery when a serious error occurs in windows. To create a system recovery disc:

Just click Start and type System Repair in the Search box. Click on Create A System Repair Disc




To use system repair disc

Insert the system repair disc into your CD or DVD drive.

Restart the computer from the disc. (We may have to set CD/DVD as the primary boot device in BIOS.) Then we will get a list of recovery options:

Startup repair

System Restore

System Image Recovery

Windows memory diagnostic

Command prompt

Display projection !

This utility helps us to display our Windows 7 portable computer’s desktop on a projector. To run this, just press Windows logo key + P and we’ll see a pop-up box.


The first setting is the default and displays on the computer screen only.

The second setting duplicates the display on the computer screen to the projector. The third setting extends the desktop across both the computer screen and the projector, and the fourth setting displays via the projector only and turns off the computer screen.

Windows Mobility Center !

Mobility Center displays the most commonly used laptop settings, such as brightness, volume, battery status, and wireless network status. Different tiles are displayed depending on system, and some tiles are added by the laptop manufacturer.



This disables the screensaver, sets the wallpaper to a neutral one and even puts the IM client on “do not disturb” status.

Windows Powershell !

Windows powershell is a command line shell interface and scripting tool that makes users easier to perform tasks using cmdlets, which are commands that perform single task and scripts, that perform complex tasks.






Posted By : Himanshu Kumar & Amit Khiwal.



No comments:

Post a Comment