WorksheetsQuiz #1
Total questions: 50
Worksheet time: 25mins
Where is account of user in Linux?
/etc/passwd
/etc/users
/etc/group
/etc/user
How many users in linux system?
2
3
4
5
How many permission in linux?
2
3
4
5
How many column of users account?
4
5
6
7
What is command to change day after password change?
usermod -e "2026-01-15" user1
usermod -m 10 user1
chage -e "2026-01-15" user1
chage -m 10 user1
which command to display user status?
chage -S user1
chage -L user1
passwd -S user1
passwd -s user1
which command for lock account?
usermod -L user1
usermod -l user1
passwd -l user1
passwd -L user1
what is comamnd to lock password of user1?
usermod -L user1
usermod -l user1
passwd -l user1
passwd -L user1
What is command to limited password changed after expired?
chage -m 10 user1
chage -M 10 user1
chage -I 10 user1
chage -W user1
Where is location of file for group?
/etc/group
/etc/groups
/var/group
/var/groups
which command for rename file or directory?
cp
mv
cd
rm
what is command for copy directory?
cp
mv
rm
mkdir
Change permission of User to read and write of file1.txt without octal.
chmod 600 file1.txt
chmod u+rw file1.txt
chmod 777 file1.txt
chmod u+r file1.txt
echo "$#" what is result of this command?
File Name
Paramter Name
Number of Parameter
Number of File
Result of command echo "#HOME"
Home Directory
User Directory
Current Working Directory
Directory of User
What is the command to view the current user's home directory?
cd ~
ls ~
echo $HOME
pwd
Which command is used to change the ownership of a file?
chown
mv
chmod
chgrp
What is the command to display the last 10 lines of a file?
tail -n 10 file.txt
head -n 10 file.txt
less file.txt
cat file.txt
What command is used to display the current working directory?
cd
pwd
ls
echo
Which command is used to remove a directory?
rm -r
mv
rmdir
del
What is the command to list all files, including hidden ones?
ls -l
ls -R
ls -a
ls -h
How do you display the contents of a file one page at a time?
cat file.txt
more file.txt
head file.txt
tail file.txt
What is the command to find the location of a command?
whereis
locate
which
find
What is the purpose of the shebang (#!) at the beginning of a shell script?
To comment out the first line
To indicate the script's file type
To specify the interpreter for the script
To define the script's execution permissions
How can you pass arguments to a shell script?
Through standard input
By using the 'set' command
By specifying them after the script name
Using environment variables
Which command is used to set an environment variable in a shell script?
env VAR=value
set VAR=value
define VAR=value
export VAR=value
What operator is used for numeric comparison to check if two numbers are equal in a shell script?
==
=
eq
===
Which command is used to compare two numbers and return true if the first is greater than the second?
if [ $a -gt $b ]
if [ $a > $b ]
if [ $a < $b ]
if [ $a -ge $b ]
What is the correct syntax to check if a number is less than or equal to another number in a shell script?
if [ $a -le $b ]
if [ $a <= $b ]
if [ $a -lt $b ]
if [ $a < $b ]
What command clears the contents of your terminal display?
clear
cache
delete
remove
Which of the Linux command-line commands listed below is used for directory traversal/navigation?
change
cd
cdc
ps
What command creates an empty directory?
Ipp
Cd chown
mkdir
None of these
What command to check/see current working directory?
who
pwd
where
catch
Which of the following commands in Linux is used to display information about files and directories contained within the current working directory?
ls
sl
show
None of these
What is the command to list hidden files & directory?
ls -l
ls -a
ls
None of these
show information about the current logged in user
id
ids
id user
id username
show information about a user
id username
ids username
info username
info user
file for checking if user was created
/etc/passwd
/etc/password
/etc/user
/etc/group
Which command changes deepak’s home directory from its default location to /usr/local directory? (select 1)
usermod -d /usr/local deepak
usermod -g /usr/local deepak
usermod -l /usr/local deepak
usermod -a /usr/local deepak
What is the command to delete the home directory of user along with the user?
# userdel <username>
# userdel -l <username>
# userdel -r <username>
# userdel -d <username>
User id 0 is
An innvalid user id
The id of the root user
The id of a user when the user’s account is deleted
None of the mentioned
Which one is command in shell script?
//
/* */
#
!#
What is a shell script?
group of commands
a file containing a series of commands
group of functions
a file containing special symbols
To find out what your path is, at the Unix shell prompt________
$echo PATH
$echo $path
$echo $PATH
none of the above
change permission of a file to rw-r--r-x?
chmod 546 file
chmod 642 file
chmod 645 file
chmod 655 file
