Q121
Q121 Which file contains the list of mounted file systems in Unix?
/etc/mount
/etc/fstab
/mnt/fslist
/var/mntlist
Q122
Q122 What is an inode in Unix file systems?
A file permission
A data structure holding file metadata
A type of directory
A command
Q123
Q123 Which command is used to check and repair file systems in Unix?
fsrepair
chkdsk
fsck
diskcheck
Q124
Q124 How would you view the disk usage of a directory and its subdirectories in Unix?
df -h directory
du -h directory
ls -l directory
df directory
Q125
Q125 Which command mounts a file system in Unix, assuming /dev/sdb1 as the device and /mnt/data as the mount point?
mount /dev/sdb1 /mnt/data
mnt /dev/sdb1 /mnt/data
fsck /dev/sdb1
loadfs /mnt/data
Q126
Q126 A user receives a "disk full" error but has deleted files. What could be a probable issue?
Disk is corrupted
Inode limit reached
Permissions issue
Unmounted disk
Q127
Q127 A file system is read-only and cannot be modified. Which command could remount it with write permissions?
mount -r
mount -o rw,remount /dev/sda1
remount /dev/sda1
fsck -rw /dev/sda1
Q128
Q128 What is the purpose of an alias in Unix?
To create a user
To define a custom command
To edit a file
To open a new shell
Q129
Q129 Where can shell aliases be stored to persist across sessions in Unix?
.bash_profile
/etc/aliases
~/.alias
/bin/alias
Q130
Q130 Which command lists all defined aliases in the current shell?
alias -l
list-alias
alias
show-alias
Q131
Q131 How can you make a shell script run each time a new terminal session opens?
Place it in /bin
Add it to .bash_profile
Move to /usr/local/bin
Add to ~/.profile
Q132
Q132 How would you create an alias ll for ls -l?
alias ll='ls -l'
set ll=ls -l
alias ll="ls -l"
alias -set ll=ls -l
Q133
Q133 How would you remove an alias named myalias in the current session?
unalias myalias
rm myalias
delete myalias
unset myalias
Q134
Q134 An alias does not persist after logging out. What could resolve this?
Add it to .bash_profile
Create a new alias each session
Use unalias
Store in alias.log
Q135
Q135 An alias name conflicts with an existing command. What can you do to avoid this issue?
Use unalias first
Add to ~/.profile
Reboot the system
Create a function instead
Q136
Q136 What does the chmod command do in Unix?
Changes file permissions
Modifies user account
Displays file structure
Creates a directory
Q137
Q137 In Unix, what does a permission setting of 755 mean for a file?
Owner can read, write, execute; group and others can read, execute
All can read, write
Owner and group can write, execute
Others have no access
Q138
Q138 Which command allows you to change the ownership of a file in Unix?
chown
chmod
chperm
useradd
Q139
Q139 What does the umask command define in Unix?
File permissions for new files
Default group for new users
System access policies
Password settings
Q140
Q140 How would you set a file's permissions to rwxr--r-- in Unix?
chmod 777
chmod 744
chmod 755
chmod 754
Q141
Q141 Which command recursively changes permissions for all files and directories within a directory?
chmod -R
chperm
chown
chmod -a
Q142
Q142 A user cannot modify a file due to permission issues. Which command could resolve this if they are the owner?
chmod +x
chown user file
chmod 644
setperm
Q143
Q143 A user is denied access to a directory even with rwx permissions. What could be the issue?
File is locked
Wrong permissions on parent directory
File system is full
Directory is hidden
Q144
Q144 What does $? represent in shell scripting?
Process ID
Exit status of the last command
Parent process
User ID
Q145
Q145 Which command allows you to define functions within a shell script?
function
define
proc
func
Q146
Q146 What is the purpose of the trap command in shell scripting?
Traps errors
Handles signals
Prevents execution
Creates functions
Q147
Q147 How do you pass an argument to a shell script?
sh script arg1
script arg1
bash script
call script arg1
Q148
Q148 How would you create a for-loop in a shell script to iterate over files in a directory?
for file in dir
for each in dir
for file in *; do
do for file in
Q149
Q149 A script terminates unexpectedly upon receiving a SIGINT. How can this be handled in the script?
Add trap 'exit' SIGINT
Use ignore function
Edit permissions
Run in background
Q150
Q150 A shell script outputs an "unexpected end of file" error. What is the most likely cause?
Missing done or fi
Invalid loop
Infinite loop
Incorrect permissions