Pages

Tuesday, February 21, 2012

Linux Basics




1.OS interacts with user in 2 ways
-OS commands and OS calls

2.The file structure in Unix is inverted tree-like structure.

3.User programs interact with kernel through the set of system calls

4.Shell is interactive command interpreter

5.A process is generally created using a fork () system call

6. /etc = contains those utilities used by the system administrator
   /tmp = used by some unix utilities (eg vi)
   /usr = contain file systems and executables
   /usr/src = location of source code
   /usr/bin = contains commands which user can execute.

7. File system contains 4 blocks.
-boot block  0
-super block 1
-inode block 2
Data block

The size of each block is 512 bytes

8.To change file ownership use chown and chgrp

9.system default permission for file : 666 and for dir : 777

10.Hard link –in same file system $ln
     Soft link -- $ln-s  in diff file system

11. Two links are present in Unix
 -ordinary file has 1 link and dir has 2 link

12. cat –v for reading a file and cat –n for numbering a file

13. Touch – use to change time span of a file
       Touch –a filename gives access time
       Touch –m  filename gives modified time

14.find . –name “*.c” –print

15.Standard files
   Input 0 , output 1 and error 2

16. grep
   $ls –l | grep –c “^l”

17. the first process in system is init

18.nice is used to reduce the priority of job
    $nice wc-l uxmanual
   Nice reduces the priority of any process by 10

18.Shells   sh, ksh, csh, bash

19. !! recall the last command and execute it.
      !n execute the nth command

20. There are three types of shell variables
  -user defined : local
  -environmental variable : global
  -predefined variable : system defined

21.$# total arguments
     $* all arguments
     $? Exit status of the previous command executed
     $$ pid of the process
     $! Pid of the last background process

Differences between Unix and Linux.
1.      Unix has been made by creator of C and linux by linux torvals
2.      Linux are available free of cost while unic are not available commercially.
3.      Unix has been a defacto standard from 5 decades but linux is there for last decade only.
4.      Unix compatibility has a major design goal for linux dev. Linux just provides the same interface as Unix, but its implementation varies greatly from linux.
5.      In Linux the OS interface is visible to running application is not maintained directly by kernel, rather applications make calls to system libraries, which in turn call the OS services as necessary.

Difference between Sed and Awk;
Sed is stream editor, usually used when u want to do search/ replace kind of things in huge file where editor fails
Awk is basically used for field separated values in a file like if u want to print a few columns in each line.

DWDM
C band : 1550nm , 8 channels
L band : raman amplification , 40 channels at 100 GHZ

WDM , CWDM , DWDM are based on same concept of using mutilple wavelengths of light on a single fibre, but differ in the spacing of the wavelengths, no of channels, and ability to amplify the no of multiplied signals.

Wavelengths coverting transponder
3R’s
-retime , retransmit and reshape

Transponding or multiplexing is a process of converting the signals between the client and trunk wavelengths

TXP and MXP cards perform
Optical ----electrical-----optical

VSAN:
A vsan is virtual storage area network that interconnects hosts and storage devices primarily to exchange SCSI traffic.

Different types of QOS mechanisms
-queueing
-traffic shaping
-traffic policing
-dropping
-link efficiency
-signalling

Three QSO models
-best effort, integrated services and diff services

Diff services is based on per hop behavior . Each node examines a label which is attached to each packet and determines the service it should receive.

Error correction :
ARQ: automatic repeat request
ECC : Error correcting code
Hybrid scheme : hybrid ARQ

Error Detection:
Parity bits
Checksums
CRC
Cryptographic fn

Why Ip is called as a logical address?
It is s/w configurable address. Depending upon network either class A , class B , ip can be configured

NIC interface card works in two modes
-          General mode and promiscuous mode

ICMP message can be used for calculating roundtrip time
for windows  TTL =128
 For linux =64
Embedded systems = 255

ICMP error message is generated for unicast message only.
Voice communication is always at 64kbps

Traps are not acknowledged.
Aux and console ports are synchronous serial ports. Devices connected to these ports must be capable of asynchronous tx.

The assignment command in TCL is set

How to pass an array to a proc ?
-upvar

How to delete a procedure form within a script?
-rename procname “”

List which are not directory
Ls-l | grep –n [^d]

Last 5 lines
Tail -5 file

From line 5 to last line
Tail +5 file

Which of following evaluates a block of expression that is outside scope?
Uplevel

Perl : practical extraction and report language developed by larry well


No comments:

Post a Comment