Q31
Q31 A user cannot modify a file due to permission restrictions. What command can change this?
ls
chown
chmod
cp
Q32
Q32 A file cannot be deleted due to "Operation not permitted." What is the likely issue?
Directory is not empty
File is owned by another user
File is in a hidden directory
File is not executable
Q33
Q33 Which command is used to create a new directory in Unix?
mkdir
newdir
touch
cp
Q34
Q34 Which command displays the contents of a file in Unix?
display
cat
view
see
Q35
Q35 What is the function of the echo command in Unix?
Display file contents
Print text to screen
List directories
Create new file
Q36
Q36 Which command lists all files, including hidden files, in Unix?
ls -a
ls -l
ls -h
list
Q37
Q37 What is the function of the grep command in Unix?
Copy files
Find files
Search for patterns in text
List directory contents
Q38
Q38 How do you display the last 10 lines of a file in Unix?
last 10
tail
head -10
tail -10
Q39
Q39 Which command is used to rename a file in Unix?
mv
rename
cp
ren
Q40
Q40 How can you count the number of lines in a file in Unix?
count -l
wc -l
lines -c
file -l
Q41
Q41 How do you search for the word "example" in a file named file.txt using Unix?
find "example" file.txt
search example file.txt
grep "example" file.txt
grep example.txt "file"
Q42
Q42 A user tries to use the cp command but encounters a "Permission denied" error. What should they do?
Restart Unix
Use chmod to change permissions
Reboot the system
Use ls -a to list files
Q43
Q43 A file cannot be moved because it "does not exist." What could be the issue?
Incorrect file path
File is hidden
File has no permissions
Disk space is full
Q44
Q44 A script stops with a "Command not found" error. What should be checked first?
Environment variables
User permissions
Script format
File size
Q45
Q45 What is the purpose of a shell script in Unix?
To create graphical applications
To automate tasks
To debug code
To manage permissions
Q46
Q46 Which symbol is used to make a comment in a shell script?
#
//
*
$
Q47
Q47 What does the chmod +x script.sh command do?
Executes the script
Adds write permission
Adds execute permission
Displays script contents
Q48
Q48 Which command is used to execute a shell script?
run
execute
sh
exe
Q49
Q49 What does #!/bin/bash signify at the beginning of a shell script?
A comment
File location
Path to the interpreter
Path to home directory
Q50
Q50 How would you print "Hello, World!" in a shell script?
display "Hello, World!"
echo "Hello, World!"
print "Hello, World!"
say "Hello, World!"
Q51
Q51 How do you define a variable NAME with the value "Unix" in a shell script?
var NAME="Unix"
set NAME Unix
NAME="Unix"
variable NAME=Unix
Q52
Q52 Which command is used to read user input into a variable called INPUT?
input INPUT
read INPUT
enter INPUT
get INPUT
Q53
Q53 How do you check if a variable is equal to a specific value in a shell script?
if $variable == value
if [ "$variable" -eq value ]
if [ "$variable" = value ]
if test
Q54
Q54 A script is not executing due to permission issues. What command can fix this?
chmod +x script.sh
chown script.sh
chmod 644 script.sh
chmod -r script.sh
Q55
Q55 A script outputs "command not found." What is a likely cause?
Incorrect file path
Command is not in $PATH
Missing execute permissions
File is locked
Q56
Q56 A script fails with a "syntax error near unexpected token" message. What could be the reason?
Incorrect permissions
Command not in $PATH
Syntax error or missing quotes
File is hidden
Q57
Q57 Which command is used to view currently running processes in Unix?
ps
top
ls
who
Q58
Q58 What is the function of the kill command in Unix?
To view processes
To delete files
To terminate processes
To schedule processes
Q59
Q59 How would you pause a running process in Unix?
pause
hold
sleep
kill -STOP
Q60
Q60 What does the nice command do in Unix?
Changes file permissions
Sets process priority
Ends a process
Displays process tree