Q31
Q31 How do you list all files, including hidden files, in a directory?
ls -a
ls -l
ls -h
ls -all
Q32
Q32 How do you view the first 10 lines of a file named data.txt?
head -10 data.txt
tail -10 data.txt
cat data.txt
more data.txt
Q33
Q33 How do you search for the pattern "error" in a file named log.txt and display matching lines?
grep "error" log.txt
find "error" log.txt
locate "error" log.txt
search "error" log.txt
Q34
Q34 A user complains that they cannot find a command they just installed.
What could be the most likely cause?
The command is not in the user's PATH
The command is not executable
The command was not installed correctly
The command is hidden
Q35
Q35 A user reports that the df command is showing incorrect free space for a partition.
What could be a possible reason?
The partition is unmounted
The disk is faulty
Inode exhaustion
Filesystem is read-only
Q36
Q36 A user wants to compress a file but receives a "Permission denied" error.
What is the likely cause?
The file is read-only
The user does not have write permissions
The file is already compressed
The user is not in the correct directory
Q37
Q37 A user wants to use the find command to search for all .txt files in their home directory, but it returns no results.
What could be the issue?
Incorrect syntax
The files do not exist
The user lacks read permissions
The files are hidden
Q38
Q38 What does the command chmod 755 do?
Sets read, write, and execute permissions for the owner, and read and execute permissions for others
Sets read and write permissions for the owner, and read permissions for others
Sets execute permissions for the owner and group
Sets read and execute permissions for the owner and group
Q39
Q39 What does the 'r' permission signify in Linux file permissions?
Read
Write
Execute
Delete
Q40
Q40 How can you view the permissions of a file named example.txt?
ls example.txt
ls -l example.txt
chmod example.txt
chown example.txt
Q41
Q41 What is the effect of setting the setuid bit on an executable file?
The file can be executed with the user's permissions
The file can be executed with the group's permissions
The file can be executed with the owner's permissions
The file can only be executed by the owner
Q42
Q42 Which command is used to change the owner of a file?
chmod
chown
chgrp
ls -l
Q43
Q43 How do you grant read and write permissions to the owner and the group for a file named data.txt?
chmod 660 data.txt
chmod 640 data.txt
chmod 644 data.txt
chmod 600 data.txt
Q44
Q44 How do you add execute permissions for the user on a file named script.sh?
chmod +x script.sh
chmod u+x script.sh
chmod u-x script.sh
chmod o+x script.sh
Q45
Q45 Which command is used to change the group ownership of a file named project.txt to a group named devteam?
chown devteam project.txt
chgrp devteam project.txt
chgroup devteam project.txt
chmod devteam project.txt
Q46
Q46 A user reports that they cannot delete a file named report.txt, even though they have write permissions.
What could be the reason?
The file is read-only
The user does not have execute permissions
The directory containing the file does not have write permissions
The file is hidden
Q47
Q47 A file named data.txt has the permissions set to -rwxr-xr--.
What does this imply about the user's permissions?
The user can read, write, and execute the file
The user can read and write the file
The user can read and execute the file
The user can only read the file
Q48
Q48 Which command is used to list all currently running processes?
ps
ls
top
jobs
Q49
Q49 What is the purpose of the 'init' process in Linux?
To initialize network connections
To manage the system's boot process
To execute user commands
To manage user sessions
Q50
Q50 What is a zombie process in Linux?
A process that is sleeping
A process that is currently running
A terminated process that has not been cleaned up by its parent
A process that is in the background
Q51
Q51 Which signal is sent to a process to terminate it immediately?
SIGINT
SIGTERM
SIGKILL
SIGHUP
Q52
Q52 How do you put a currently running job into the background?
fg
bg
ctrl+c
ctrl+z
Q53
Q53 How do you kill a process with the process ID 1234?
kill -9 1234
killall 1234
kill -KILL 1234
terminate 1234
Q54
Q54 How do you display a real-time view of running processes, showing system resource usage?
ps
ls
top
jobs
Q55
Q55 A user reports that a process is consuming too much CPU.
Which command can help identify this process?
ps
ls
top
jobs
Q56
Q56 A user has started a process in the background but now wants to bring it to the foreground.
Which command should they use?
fg
bg
kill
jobs
Q57
Q57 A process is stuck and not responding to SIGTERM.
What is the most effective way to kill it?
kill -15 PID
kill -1 PID
kill -9 PID
kill -HUP PID
Q58
Q58 What is a shell script in Linux?
A compiled program
A series of commands written in a file
A binary executable
A system call
Q59
Q59 Which of the following is used to make a shell script executable?
chmod +x script.sh
chmod u+x script.sh
chmod 777 script.sh
chmod 755 script.sh
Q60
Q60 What is the purpose of the shebang (#!) in a shell script?
To comment the script
To specify the script's interpreter
To define variables
To provide execution permissions