Home | Buy | LINUX | ERP | UNIX | MULTI-PATHING | DATABASE | SAMPLE | SAN PERFORMANCE TUNING | Testimonials | Terms of Use | Support
UNIX

Interview Guru

You can read a sample of this e-Book before making your purchase:

 

 

How to find?

 

Using the find command:

Search and list all files from current directory and down for the string PQR:

find ./ -name "*" -exec grep -H PQR {} \;

find ./ -type f -print | xargs grep -H "PQR" /dev/null

find . -type f -exec grep "string or options" /dev/null {} \;

 

Normally using only:

$ find . -type f -exec grep "string/options" {} \;

 

What is Cron?

 

CRON - Scheduling a re-occurring task:

 

Run a script  hourly, daily, weekly or monthly

 

/etc/cron.hourly/

/etc/cron.daily/

/etc/cron.weekly/

/etc/cron.monthly/

These are preconfigured schedules. To assign a very specific schedule add a line to the /etc/crontab file. Cron entries may also be added to a crontab formatted file located in the directory /var/spool/cron/.

 

 

 

Crontab Syntax:

A crontab file has five fields for specifying day , date and time  followed by the command to be run at that interval.

 

*     *   *   *    *  command to be executed

-     -    -    -    -

|     |     |     |     |

|     |     |     |     +----- day of week (0 - 6) (Sunday=0)

|     |     |     +------- month (1 - 12)

|     |     +--------- day of month (1 - 31)

|     +----------- hour (0 - 23)

+------------- min (0 - 59)

 

Scheduling access and control:

 

/etc/cron.deny and /etc/cron.allow :to allow users to use this facility

The at facility may be controlled with the /etc/at.deny and /etc/at.allow files.

Reference:Man pages:

 

cron

crontab

 

How to display general information about physical disk locations?

·  format – Use this command to display physical disk location information for disks when reviewing partition tables or relabeling

FORMAT MENU:
        disk       - select a disk
        type       - select (define) a disk type
        partition  - select (define) a partition table
        current    - describe the current disk
        format     - format and analyze the disk
        repair     - repair a defective sector
        label      - write label to the disk
        analyze    - surface analysis
        defect     - defect list management
        backup     - search for backup labels
        verify     - read and display labels
        save       - save new disk/partition definitions
        inquiry    - show vendor, product and revision
        volname    - set 8-character volume name
        !<cmd>     - execute <cmd>, then return
        quit

 

arp manipulate the system ARP cache

arp -a Shows other systems on your network

arp -e Show ARP table Linux style:

arpwatch (8) man page - keep track of ethernet/ip address pairings

arpsnmp (8) man page - keep track of ethernet/ip address

arping (8) man page - send ARP REQUEST to a neighbor host

cat /proc/net/arp List ARP table

ip neighbor View ARP table

 

 

SCSI device addressing?

 

Linux employs a four-attribute scheme to address SCSI devices:

SCSI adapter number

Channel number

Target ID number

Logical Unit number (LUN)

 

This information is exported to the /proc and is available for viewing

as follows:

$ cat /proc/scsi/scsi

 

 

Kernel Tracing/debugging Commands

dtrace – trace and monitor kernel

lockstat – monitor locking statistics

lockstat -k – profile kernel

mdb debug live and kernel cores

 

Copyright ©2007 Bottom Line Global Solution, LLC. All Rights Reserved.