Category Archives: Featured

awk Commands, Examples & Meaning


awk is an interpreted language used for data processing and validation,  generate reports and experiment with algorithms that can be ported to other languages.

awk name & History
The name awk comes from the initials of its creators: Alfred V. Aho, Peter J. Weinberger, and Brian W. Kernighan.
Original version of awk was written in 1977 at AT&T Bell Laboratories.  Paul Rubin wrote gawk ( gnu awk ) in 1986.

Application Monitoring


Application monitoring is a very important aspect of a project but unfortunately not much attention is paid to develop the effective monitoring while the projects are still movingh to completions. Once project is complete & live lack of proper monitoring costs in terms of downtime when support persons are not aware if application is having some problems or application not working at all.

Unix Date Format Examples

Unix date format is needed  in the scripts, timestamped log files and  script generated reports .  This article attempts to simply date formatting with several examples .  Date command in Unix is used to format date as well as time . First portion of this article covers Date  function and the second portion has the  time function covered .

ssh without password in few simple steps

Passwordless access for ssh and sftp , How to do sftp & ssh without password – Step by Step

This a real life example of configuring passwordless access for two users . The user ‘web’ in this case needs a secure password less access to another user james in a server ‘devserver’

Unix Tutorial – Learn Unix OS Basics to get started

unix tutorial

This is a Unix Tutorial where you can learn Unix OS Basics to get started with UNIX and Linux operating systems and covers Unix Directory structure , Unix Commads and Unix Shells

Unix Dir Structure

The table shows the Unix/Linux Directory structure and description of files it stores.

Directory Description
/ Primary hierarchy root and root directory of the entire
file system hierarchy.
/bin/ Executable binary command files.
/dev/ Has nodes for devices , hard disk , tape etc
/etc/ Host-specific configuration files such as
/etc/inittab , /etc/hosts
/home/ Users’ home directories .
/lib/ Libraries needed by various Unix programs.
/mnt/ Temporary file system mount point .
/opt/ Optional application software packages installation
directory .
/proc/ Virtual file system having kernel process files .
/sbin/ system binaries files such as init .
/tmp/ Temporary file system used to store temporary data of
programs .
/usr/ user related command , programs , librar


Binary commands for all users .


Include files required by programs..


Libraries for the binaries in /usr/bin/ and /usr/sbin/.


system binaries for users .


shared file system


Source code files


Optional user programs and packages are installed here .
/var/ Directory to store dynamic files such as logs . Most
programs has /var as default location for writing log , lock and spool files .


Lock files.


Log files.


Users’ mailboxes.


Spool for tasks waiting to be processed (e.g. print queues and unread mail).

Unix commands

Unix/Linux operating systems comes with online manual system which can be used to see the command details ,syntax options and examples on while working on a Unix system. Unix manual can be accessed using man command , syntax is man <command name>

Unix commands are listed in following sections based on command functionality and you can scroll down to see all the sections.

Unix Command Sections :
1. Wild card,
2. dir level Operation
3. File – Listing , moving
4. File Create , edit , View
5. File operation 6. Process
7. User Admin
8. System System Status
9. Environment Variable
10. Connectivity
11. Backup and recovery
12. Find files and directories You can also download a one page pdf version of the unix commands listed below.

Wild Card Characters

Single character and match all wild card characters which can be used in Unix commands to substitute one or more characters

* – The * wildcard character substitutes for one or more characters in a filename. For instance, to list all the files in your directory that end with .c, enter the command, ls *.c

? – ? (question mark) serves as wildcard character for any one character in a filename. For instance, if you have files named prog1, prog2, prog3, and prog3 in your directory, the Unix command:,

ls prog?

Directory level Operation

Commands to Change , make , move and remove the directory entries .

Change cd dir Change to directory d
Make mkdir dir Create new directory d
Move mv dir1 dir2 Rename directory d1 as d2
Remove rmdir dir Remove directory d

File – Listing , moving

Commands to list ,copy , move , rename , delete and type the files .

list , no details only names ls filename , filename with wildcard character/s.
list , details ls -1 filename , filename with wildcard character/s.
move to directory mv filename dirname (wildcard character/s supported)
copy file to other/current directory cp file directory/newfile or cp directory/oldfile .
Copy file file1 into file2 cp file1 file2
move (rename ) file mv file1 file2 Rename file file1 as file2
Delete the file rm file , rm -rf directory – Recursively remove files & directly without any warning.
Remove rm file Delete (remove) file f
file file filename , file command tries to determine the file type , text , executable etc after comparing the values in /etc/magic .

File Create , edit , View

Command/s to to create new files , edit & view existing file .

vi – vi full screen editor vi filename , Opens a existing file or creates a new one does not exists.
ed – Line Text editor ed filename
count – Line, word, & char wc filename
Text content display – List contents of file at once cat filename
Text content display by screen : List contents of file screen by screen more filename
Concatenate – file1 & file2 into file3 cat file1 file2 >file3

File operation

Commands to change owner of file, compare files , sort a file , split large file , match a pattern in a file , list difference between two files .

Change read/write/execute mode of fil chmod mode file
chown chown [-R] [-h] owner[:group] file
Compare two files cmp file1 file2
Sort Alphabetically sort file
Sort Numerically sort -n file
Split f into n-line pieces split [-n] f
match pattern grep pattern file Outputs lines that
Lists file differences diff file1 file2
head f Output beginning of file head file
Output end of file tail file


Commands to find the Status of a process , suspend the process , stop the process , interrupt a process & kill a process .

status process status stats ps
Suspend current process CTRL/z *
Interrupt processes CTRL/c *
Stop screen scrolling CTRL/s *
Resume screen scrolling CTRL/q *
Sleep for n seconds sleep n
Print list of jobs jobs
Kill job n kill %
Remove process n kill -9 n
Resume background job n bg [%n]
Resume foreground job n fg [%n]
Exit from shell exit

User Admin

Command to add user and change password of a user .

add a new user login to the system # useradd -u 655 -g 20 -d /home/ttes testlogin loginname

-u is userid , if not specified system takes highest available .
-g group id should be existing in /etc/group , if not specified other or user is assigned.
-d home directory , default is to use user as the directory name under the home directory.
loginname – new login name to be created .

#useradd testlogin will create a user by the name ‘testlogin’ with all default values .

password Change passwd <user>
alias (csh/tcsh) – Create command alias name1 name2
alias (ksh/bash) – Create alias command alias name1=”name2″
alias – Remove alias unalias name1[na2…]

System System Status

Command to find quota , date , users , logged in user , finger [username] and history of Unix commands issued .

Display disk quota quota
Print date & time date
List logged in users who
Display current user whoami
Output user information finger [username]
Display recent commands history

Environment Variable

Command to set and export system environment variables .

set set command alone displays the environment variables, it is used to set options in ksh like set -o vi
export export variable , export makes variable visible in sub shells.
Set environment variable (csh/tcsh) to value v sentenv name v
Set environment variable (ksh/bash) to value v export name=v example : export TERM=vt100


Commands for connecting to other systems using telnet ,ssh , ftp , sftp , ping

Connecting to a remote host $telnet hostname/ip address or $telnet Telnet brings up the login prompt of remote host and expects you to enter your user name & password .Without argument it enters command mode (telnet>) and accepts command listed by ? at telnet> prompt. Communication is not encrypted between two hosts.
Securely connecting to a remote host
ssh username@hostname or ssh -l username hostname
Depending on ssh setting for your account you may or may not be asked a password to login. Your login/passwd will be same login password as you would use with telnet connection.
Communication is encrypted between two hosts so if someone intercepts your communication he will not be able to use it.
Copy files from/to remote host
ftp hostname
ftp expects you to enter your username/passwd or if it is ftp only account it will require ftp account password .
put , mput (multipleput) command is used to transfer files to remote host.
get , mget (multipleput) command is used to transfer files from remote host.
ftp allows some limited number of commands to be executed at ftp> prompt & summary of ftp command can be found by using ? at ftp> prompt


Securely copy files from/to remote host sftp username@hostname:remotefile localfile Communication is encrypted between two hosts.
Test the tcp/ip connectivity between two hosts
ping hostname
If you can ping a host the host is reachable from the machine that you are using.
Router/firewall configuration may prevent ping to succeed .

Unix Shells
Shell in UNIX acts as a command interpreter between user and Unix kernel as well as provides a strong scripting language .

Following are the different types of Unix shells ,

B shell , /bin/sh – This is the default Unix shell for many Unix operating systems.

Bourne shell was written by S. R. Bourne and its more emphasis is to use it as a scripting language rather than an interactive shell .

vi editor Quick Reference

vi  pronounced as ” vee eye ” is a unix editor available on almost all the unix  operating systems , solaris , bsd ,aix , hpux etc.
This document is a quick reference to vi editor and will be of help if your are new to unix , learning unix  or just refreshing your vi knowledge after a few years.

Backup commands – usage and examples

Backup commands – ufsdump, tar , cpio
Unix backup and restore can be done using unix commands ufsdump , tar ,
cpio . Though these commands may be sufficient for small setups in
order to take a enterprise backup you have to go in for some custom
backup and restore solutions like Symatic netbackup, EMC networker or
Amanda .
Any backup solution using these commands depends on the type of backup you
are taking and capability of the commands to fulfill the requirement . Following
paragraphs will give you an idea of commands , syntax and examples.

Crontab – Quick Reference

Setting up cron jobs in Unix and Solaris

cron is a unix, solaris utility that allows tasks to be automatically run in the background at regular intervals by the cron daemon. These tasks are often termed as cron jobs in unix , solaris.  Crontab (CRON TABle) is a file which contains the schedule of cron entries to be run and at specified times.

Unix Commands Tutorial

Unix commands are the first thing needed by a unix sysadmin who are starting to work in unix operating system . Unix operating systems comes with online manual system which can be used to see the command details , syntax options and examples on while working on a unix system. Unix manual can be accessed using man and it requires the man package installed and MANPATH set to man directories. The manual page directories may differ in different unix operating systems and man package may not be installed in all systems .

DNS Troubleshooting

DNS troubleshooting , this article describes some of the common dns problems and their solutions.
First phase of article describes dns errors relating to configuration , server setup and its basic functionality . Second phase talks about the nslookup related errors when the dns servers seems to be working correctly but names resolution fail .