OSquiz 3
OSquiz 3
Subject with Code: Operating System (RCS5C203) Course & Branch: B. Tech. & CSE
Year & Semester: 3rd & V
1: Which command is used to display the current working directory in UNIX? [0.5 mark]
[CO3] [L2]
A) `pwd`
B) `ls`
C) `cd`
D) `dir`
2: What does the `chmod` command do in UNIX? [0.5 mark] [CO3] [L2]
A) Changes the modification time of a file
B) Changes file permissions
C) Changes the owner of a file
D) Changes the file extension
3: In UNIX, what is the purpose of the `grep` command? [0.5 mark] [CO3] [L2]
A) Display current processes
B) Search for a pattern in files
C) Rename files
D) Display system information
4: Which command is used to terminate a running process in UNIX? [0.5 mark] [CO1] [L2]
A) `kill`
B) `terminate`
C) `end`
D) `stop`
5: What does the `echo` command do in UNIX shell scripting? [0.5 mark] [CO1] [L2]
A) Print the output of a program
B) Display the contents of a file
C) Display a line of text
D) Execute a command silently
6: Which symbol is used for redirection of standard output in UNIX? [0.5 mark] [CO3]
[L2]
A) `<`
B) `>`
C) `|`
D) `&`
7: What does the `$?` variable represent in UNIX shell scripting? [0.5 mark] [CO3] [L2]
A) Current shell process ID
B) Exit status of the last executed command
C) Number of arguments passed to a script
D) Current user ID
8: How do you assign a value to a variable in UNIX shell scripting? [0.5 mark] [CO3] [L2]
A) `VAR=value`
B) `set VAR value`
C) `assign VAR=value`
D) `setenv VAR value`
9: Which command is used to list all environment variables in UNIX? [0.5 mark] [CO3]
[L2]
A) `showenv`
B) `env`
C) `listenv`
D) `printenv`
10: What does the `if` statement evaluate in UNIX shell scripting? [0.5 mark] [CO3] [L2]
A) A loop condition
B) The result of an arithmetic operation
C) A command's exit status
D) The value of a variable