BCA Paper - UNIX and Shell Programming (Set-1)
UNIX and Shell Programming
Q1: Explain UNIX architecture and its salient features. Distinguish between INTERNAL and EXTERNAL commands.
Q2: Explain with examples different types of files supported in UNIX.

i. echo $PATH
ii. ls -l/wc -l
iii. type mkdir; mkdir new;
iv. who > userlist
Q4: Explain man command with its option.
Q5: Explain briefly the file attributed listed using ls -l command
Q6: Explain with suitable example how and who can change file permission.
Q7: Explain different modes in vi editor and list commands in each mode.
Q8: How to do the following using vi editor:
- Combine 5 lines in to single line
- Move the cursor to last line in a file
- Replace 'has' with 'have' in the current line
- Add /* at the beginning of line and */ at the end of the line.
Q10: Explain the following commands with suitable example and list its options:
- ps
- kill
Q12: What are environment variables that control UNIX system? Explain any three such variables.
Q13: Explain with example find command and its options.
Q14: Write a note on sort command. Discuss its options with examples.
Q15: Explain the following commands:
- ls -l | grep "^d" > directories
- grep -v "USA" news.txt | wc -l
- sed '10,$ s/loop/ loop with in loop/g' <loop.txt> moreloops
- grep "$SHELL$" /etc/passwd | cut -d ":" f1
- grep a b c > found.txt
Q17: What is shell programming? Write a shell script to create a menu which displays the list of files, current users, contents of a particular file and process status of the system based on the user choice.
Q18: Explain the expr command applicable to numeric and string functions.
Q19: Explain the following with reference to shell programming:
- $?
- test
- shift
- trap
- while loop
- for loop
Q22: Write an awk sequence to find the DA, HRA and gross pay of employees. DA at 50% of basic, HRA at 25% of basic and the gross pay is sum of basic pay, DA and HRA. Also compute the average gross pay.
Q23: Explain with example the following built in functions:
- split( )
- substr( )
- length( )
- index( )
- $_default variable
- foreach loop construct
- join( )
Q26: Using command line arguments, write a PERL program to find whether the given year is leap year.