In: Computer Science
A email application is an instance of a client-server
model of computer networking.
T/F
Which of the following command is used to list out
process details in Unix system.
mkdir process_a
ls -;a
bg
ps -l -u $(whoami)
Which of the file is used to sink the output of a
process to Null.
/dev/null
/dev/tty
/dev
/dev/empty
What does a pipe operator do?
performs an OR operation
takes input form a file and fees as input to other command
it takes output of a command and feeds as input to other
command
it takes input of a command and feds as input to other command
Which of the following command removes all files with three characters file extension ,except that ends with ".opt"?
rm *.*
rm *[opt]
rm *.[o][p][t]
rm *.[!o][!p][!t]
A command ${command-name} is used as a substitution
command in shell.
T/F
Zombie are the processes whose parents have
died.
T/F
Select a set whose all processes are a daemon
processes.
mkdir, inetd,con,mysql
sendmail,inetd,con,ps
sendmail,ls,con,mysql
sendmail,inetd,con,mysql
Which of the following command is used to get process id
of a process?
kill pid
pidof processname
ls -la
pid processname
Which of the following system call is used by a parent
process to create a child process?
exec()
listen()
wait()
fork()
Which of the following is the parent process for all
other processes (in options)?
init
shell
mysqld
system process
Which of the following is used to probe a network
connectivity of a host?
ssh
telnet
ping
dig
Which of the following command is used to open a
firewall for a port 'n'?
sudo ufw allow n/tcp
sudo fuw allow tcp n/tcp
sudo netstat -tupln ufw n/tcp
sudo ufw allow tcp/n
Which of the following method is used to upload a file
to a ftp server?
get
lcd
upload
put
Which of the following file contains the hostnames and
associated IP addresses in Unix system?
/etc/hostname
/etc/conf.d
/etc/hostnames
/etc/hosts
1. An email application is an instance of a client server model of computer networking(T/F)
Ans: T
Explanation:client server model is a type of distributed application that divides tasks between servers and clients. email is an example or instance of client server model
2. The command used to list out process details in Unix system
Ans: ps -l -u $(whoami)
Explanation : In unix ps command is used to list out the currently active process and their process IDs and some other information about that process.
ps -l indicates a long listing of processes.
-u means detailed information about the process.
3. The file used to sink the output of a process to Null is
Ans: /dev/null
Explanation: It is used to provide a null output. Sometimes it is used to discard output which is not needed.
4. The pipe operator is used to:
Ans: It takes output of a command and feeds as input to another command. It is used for redirecting standard output of a command (stdout) as standard input (stdin) of another command. It creates a temporary connection and it is unidirectional.
5. Which of the following command removes all files with three characters file extension ,except that ends with ".opt"?
Ans:rm *.[!o][!p][!t]
Explanation: removes file extension pattern that matches anything except given pattern. it removes except .opt
* means matches 0 or more characters
? means matches any single character
[seq] matches any in seq
[!seq] matches any character not in seq
6. A command ${command-name} is used as a substitution command in shell.
Ans: True
Explanation: The substitution command is used to run a shell command and store its output to a variable.
7. Zombie are the processes whose parents have died.
Ans: False
Explanation: Zombie is a died process but its parent is not yet died. Zombie are occured due to incorrect programming in parent process. zombie processes will stick around in memory until they are cleaned up.It does not use any system resources but retains its process ID.
8. Select a set whose all processes are a daemon processes.
Ans:sendmail,inetd,con,mysql
Explanation: inetd= internet superserver daemon
sendmail= a mail transfer agent daemon
mysql= database server daemon
cron is a daemon in unix deals with job scheduling.
daemon processes are the proceses that runs in background (background process) ,
9.Which of the following command is used to get process id of a process?
Ans:pidof processname
Explanation: porcess id is a unique id assigned to a process when it is created. process is a program in execution.
The command "pidof" is used to find the process ID of a running program.
10. Which of the following system call is used by a parent process to create a child process?
Ans: fork()
Explanation: The fork() system call is used by a process to create another process. i.e. parent process uses fork() to create its child process. A child process used the same PC , registers, same open files etc. of the parent process. If fork() is successfully executed, then pid of newly created process(child) is returned to the parent process and 0 is returned to the child process. If it is not successfull, then a negative value(-1) is returned to the parent process.
11. Which of the following is the parent process for all other processes (in options)?
Ans: init
Explanation: init is the mother of all other processes, it is initial program which is initiated by kernel itself at the booting time. It manages all the other processes in the system. The process ID of init process is always 1.
12. Which of the following is used to probe a network connectivity of a host?
Ans: ping
Explanation: It is a network administration software used to test network connectivity of a host.
13.Which of the following command is used to open a firewall for a port 'n'?
Ans:sudo ufw allow n/tcp
Explanation: It is used to open a port in ubuntu firewall. It will open both tcp and udp protocols by default.
Syntax: ufw allow port-number/protocol.
14. Which of the following method is used to upload a file to a ftp server?
Ans: put
Explanation: FTP (File Transfer protocol) is used to transfer files from one system to other i.e. uploading and downloading. Ftp is not a secure protocol instead of this SFTP can be used for secure transferring.
"put" command is used to upload files into FTP server . it is used for uploading a single file . To upload multiple files,"mput" can be used.
15.Which of the following file contains the hostnames and associated IP addresses in Unix system?
Ans: /etc/hosts
Explanation: It is a plain text file that the OS used to translates hostnames(URL) into IP address.This is a system file and it needs administrative rights to save any changes in it.