Explore topic-wise InterviewSolutions in Current Affairs.

This section includes 7 InterviewSolutions, each offering curated multiple-choice questions to sharpen your Current Affairs knowledge and support exam preparation. Choose a topic below to get started.

1.

What is the ‘nohup’ in UNIX?

Answer»

nohup is a special command to run a process in the background EVEN when a user LOGS off from the SYSTEM. It also HELPS in creating daemon processes or some CLEANUP script of logs.

2.

Can you name the important standard streams in the UNIX shell scripting?

Answer»

These are STANDARD INPUT, Standard OUTPUT as WELL as Standard ERROR.

3.

What do chmod, chown, chgrp commands do?

Answer»

These are file management commands. These are used for:

  • chmod - It CHANGES the permission set of a file
  • CHOWN - It changes the ownership of the file.
  • chgrp - It changes the group of the file.

$ chmod g+w testfile

It changes permission for a user group to write.
$ chown sroy8091 testfile

It changes the OWNER of testfile to sroy8091.

$ chgrp MODERATORS testfile

It changes a group of testfile to moderators.

4.

What is meant by the term Super User?

Answer»

The SUPER User is a user with ACCESS to all files and commands WITHIN the system. In general, this superuser login is to access root and it is SECURED with the root PASSWORD.

5.

What is the fork() system call?

Answer»

This is used to create ANOTHER process that duplicates the entire process structure and address SPACE. The newly created process is CALLED the child process and the one from which it got replicated is called the parent process. This was used to achieve parallelism before threads. The fork() system call takes no arguments and returns an integer. 

  • 0 means that the child process is created successfully, and 0 REFERS to the child process within the parent process. 
  • –1 means that the system was unable to create another process. 
  • default positive integer > 0 is returned to the parent process which represents the process ID of the child process.
6.

In Shell scripting, how do you separate the grep and egrep?

Answer»

egrep is an extended version of GREP, in addition to searching using regular expressions, egrep can use extended regular expressions for searching.
$ ls | grep '.env|.json'

This will check whether any FILE has extension ‘.env|.json’ literally
$ ls | egrep '.env|.json'

But in this case, it CHECKS whether any file has extension ‘.env’ or ‘.json’ since ‘|’ this will be CONSIDERED as a metacharacter.

7.

Describe pipes in Unix

Answer»

 A pipe is a unidirectional mechanism of INTERPROCESS communication. In a Unix COMMAND line, if a pipe is being used, the first process is ASSUMED to be WRITING to stdout and the second is assumed to be reading from stdin.

$who | sort | lpr

This will create 3 PROCESSES with 2 pipes in between them.

8.

Describe a link in UNIX.

Answer»

Link is used to assigning more than one name to a file. It is like a pointer to a file and one file can have MULTIPLE pointers. There are two types of link

  • Hard link- These hard-linked files are assigned to the same inode VALUE as the original and THUS reference the same physical location of the file. Also if the file is MOVED to a different directory the link will still WORK

ln  [original filename] [link name]

  • Symbolic link- A soft link is similar to the file shortcut feature and it contains a separate inode than the original one. If the original file is moved then the link might not work, but it can reference across the different file systems.

ln  -s [original filename] [link name]

9.

Can you write a command to erase all files in the current directory including all its sub-directories?

Answer»

rm –r* is used to erase all files in the current DIRECTORY including all its sub-DIRECTORIES. rm is used for deleting files, but with the addition of option -r it erases all files in directories and SUBDIRECTORIES, and finally, an asterisk REPRESENTS all entries.

10.

Name a few significant features of UNIX?

Answer»

The FOLLOWING are a few features of UNIX:

  • Hardware independent
  • Multi-user operations
  • Unix Shells
  • Hierarchical file system
  • Pipes and filters
  • Utilities
  • Development TOOLS
11.

Define a single-user system.

Answer»

Single-user systems are the ONES with an operating system to cater to only ONE user at a time. These are commonly our personal computers and BECAME popular due to low hardware cost and WIDE range of software.

12.

Explain Unix Architecture

Answer»

The UNIX comprises mainly three layers such as kernel, shell, and user application.

Kernel - This is the core layer of the operating system which interacts with the hardware of the system. The kernel provides API VIA system calls to process the user requests. The kernel also provides services such as SIGNAL handling, synchronization, interprocess communication,  file system services,  network services,  and hardware monitoring. Each time a process is STARTED, the kernel has to initialize the process, assign the process apriority, allocate MEMORY and resources for the process, and schedule the process to run. When the process terminates, the kernel frees any memory and/or resources held by the process.

Previous Next