Interview

UNIX COMMANDS INTERVIEW QUESTIONS

UNIX COMMANDS


1.SEARCH A FILE FROM ROOT DIRECTORY.(FILENAME = SAMPLE.TXT)
  FIND / -NAME SAMPLE.TXT

2.DISPLAY THE NUMBERS IN SORTED ORDER
   SORT -NU

3.DISPLAY THE UPDATED LINES IN FILE
  TAIL -F FILENAME

4.HOW TO ZIP A DIRECTORY
  GZIP -R /HOM/BEA/APP

5.HOW TO KILL A PROSESS.
   KILL -9 PID

6.DISPLAY ALL JAVA PROCESS IN UNIX.
    PS -EF |GREP JAVA

7.HOW TO DELETE 10 LINES IN VI EDITOR.
    10DD

8.HOW TO SEARCH A STRING AND REPLACE TIN  VI EDITOR.
     :"%S/OLD STRING /NEW STRING/ GI"

9.HOW TO SEARCH A STRING IN VI EDITOR FROM BOTTOM TO TOP.
     ?STRING NAME

10.HOW TO INSERT A LINE ABOVE THE CURRENT LINE IN VI EDITOR .
      ESC+O

11.HOW TO RENAME A FILE .
     MV FILE1 FILE2

12. COPY THE CONTENT ONE DIRECTORY TO ANOTHER DIRECTORY.
        CP -R DIR1/FILE1 DIR2/FILE2

13. HOW CAN DELETE BLANK LINES IN DIRECTORY.
      GREP -V "^$" SAMPLE > TEMP
      MV TEMP SAMPLE

14.HOW CAN REPLACE ASTRING IN UNIX.
     SED "S/OLDSTRING/NEWSTRING/G" FILENAME

15.SYNTAX FOR ZIP AND UNZIP AFILE.
     GZIP FILENAME
     GUZIP FILENAME.GZ

16.HOW CAN DISPLAY TOP 10 DISK USAGE FILES.
  DU -SH *|SORT -NR|HEAD -10

17.HOW TO RETRIVE A FIELD IN A FILE.
   CUT -F 1,2 STUD.

18.WHAT IS COMMAND SEARCH A STRING IN A FILE.
     GREP

19).HOW TO GOTO THE END OF THE LINE IN VIEDITOR?
     G

20).COPY 10 LINE IN VI EDITOR?
      10YY

21).HOW TO GO TO INSERT MODE IN VI EDITOR?
      ESC+I

22).HOW TO SEARCH A STRING IN A FILE(FILENAME=SAMPLE,STRING=WEBLOGIC)?
     GREP WEBLOGIC SAMPLE

23).HOW TO COPYFILE FROM ONE UNIX TO OTHER UNIX SYSTEM AND SYNTAX (FILE=SAMPLE.TXT,TARGET HOST=192.168.11.128,TARGET FILE PATH=/HOME/BEA)?
     SCP -RP SAMPLE.TXT USERNAME@192.168.11.128:/HOME/BEA

24).COPY FILE FROM PATH TO OTHER TREE STRUCTURE IS GIVEN BELOW?

25).HOW TO FIND OUT CPU UTILIGATION?
      TOP

26).HOW TO EXECUTE ASCRIPT USING NOHUP(SCRIPT NAME=STARTWEBLOGIC.SH)?
      NOHUP ./STARTWEBLOGIC.SH &

27).WHICH COMMAND IS USED TO SEARCH AND REPLACE A STRING?
       SED

28).WICH COMMAND IS USED TO SEARCH ASTRING IN MULTIPLE FILES?
      FGREP

1)HOW TO SEARCH A STRING FROM TOP TO BOTTOM IN VI EDITOR'S(STRING =WEBLOGIC)?
A) /WEBLOGIC

2)HOW TO SAVE AND QUIT FROM VI EDITOR'S?
A)WQ!

3)WHAT ARE THE ADVANTAGES OF NOHUP COMMAND?
A)NOHUP WILL EXECUTE THE PROCESS IF YOU LAYOUT SYSTEM.
SYN:NOHUP &.

4)DIFFERANCE B/W THE PING AND TRACERT?
A) PING                   TRACERT
1)IT IS CHECK THE CONNECTIVITY.   1.IT IS PACKET INFORMATION ONE PLACE TO
                                   ANOTHER PLACE DESTINATION.
2)IT IS DISPLAY ALL AT A TIME.    2.IT DISPLAY ONLY 30 HUBS IN TRACERT.
 
5)HOW TO EXECUTE UNIX COMMANDS IN VI?
A):LS

6)TAR DIR1 DIR2 DIR3 AND NEW_DIR?
A)SYN:TAR -CVF NEW_DIR.TAR DIR1 DIR2 DIR3.

7)HOW TO DISPLAY THE IPADDRESS AND PORTNUMBER?
A)NETSTAT -ANP

8)HOW TO DELETE DIRECTORY WITH RECURSION AND FORCE?
A)RM -RF FILENAME.

9)HOW TO OPEN A FILE WITH PAGE TO PAGE ?
A)MORE FILENAME

10)HOW TO HIDE A FILE (FILE NAME=TUXEDO)?
A)MV TUXEDO .TUXEDO

11)HOW TO DO UNDO IN VI EDITOR'S?
A)U

12)HOW TO GOTO 100 LINE IN VI EDITOR'S?
A)100L

13)HOW TO DISPLAY LAST 100 LINE FROM A FILE?
A)TAIL -100 FILENAME

14)HOW TO RETERIVE THE FIELDS FROM A FILE?
A)CUT

15)HOW TO ZIP A DIRECTORY?(/HOME/DIRECTORY)?
A)GZIP -R /HOME/DIRECTORY

16)HOW TO GO TO END OF THE LINE IN VI?
A)G

17)DISPLAY THE DIRECTIORY COUNT IN CURRENT DIR?
A)LS -LRT !WC -L

18)HOW TO DISPLAY ALL FILES ENDING WITH "LOG"?

19)HOW TO APPEAND DATA TO THE EXISTING FILE?
A)CAT>>FILENAME

20)HOW TO FIND OUT THE DISKSPACE OF THE FILESYSTEM?
A)DF -SH

21)WRITE A SYNTAX FOR THE SCP COMMANDS?
A) SCP FILENAME ROOT@IPADDRESS:FILENAME.

22)HOW TO DISPLAY THE UPDATED LINES IN FILE ?
A)TAIL -F FILENAME.

23)HOW TO DISPLAY THE IPADDRESS AND PORTNUMBER?
A)NETSTAT -ANP

24)WHICH COMMAND IS USED TO CONNECT TO THE REMOTE SERVER?
A)TELENET IPADDRESS.

25)HOW TO REPALCE AND STRING IN VI EDITOR'S?
A) SED %S/OLDSTRING/NEWSTRING/G

25)HOW TO REPALCE AND STRING IN UNIX?
A) SED S/OLDSTRING/NEWSTRING/G FILENAME

26)HOW TO DISPLAY TOP 10 LINES FROM A FILE?
A) HEAD -10 FILENAME.

27)SYNTAX FOR TAR AND UNTAR A FILE?
A)TAR -CVF FILENAME.TAR FILE1 FILE2 FILE3.
  TAR -XVF FILENAME.TAR

28)HOW TO DISPLAY HIDDEAN A FILE?
A)LS -A. 29)HOW TO DELETE A BLANK LINE FROM A FILENAME?
A)GREP "^V" SAMPLE >TEMP
  MV TEMP FILENAME

30)HOW TO DISPLAY ALL CUURENT RUNNING PROCESS?
A)PS -EF

31)SYNTAX FOR ZIP AND UNZIP FILE?
A)GZIP FILENAME.
  GUNZIP FILENAME.GZ

Comments

Popular posts from this blog

Bsu

linux

Domain