0% found this document useful (0 votes)
6 views6 pages

Interviewddd

The document discusses various UNIX commands and concepts, including the differences between 'su' and 'sudo', the components of a file system, and how to gracefully kill processes. It also addresses issues with the 'df -h' command not showing output and provides solutions for troubleshooting. Additionally, it mentions how to find and print user login names from the '/etc/shadow' file.

Uploaded by

suman.mitra2025
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views6 pages

Interviewddd

The document discusses various UNIX commands and concepts, including the differences between 'su' and 'sudo', the components of a file system, and how to gracefully kill processes. It also addresses issues with the 'df -h' command not showing output and provides solutions for troubleshooting. Additionally, it mentions how to find and print user login names from the '/etc/shadow' file.

Uploaded by

suman.mitra2025
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 6

1

Which command can be used to know the terminal type?


tty

Diffrence between su and sudo

sudo (superuser do):


1. Usage:
 Allows a permitted user to execute a command as the
superuser or another user, as specified by the security policy
configured in the sudoers file.
2. Permission System:
 Requires the user to be granted explicit permission to execute
specific commands as the superuser or another user.
Permissions are defined in the /etc/sudoers file.

su (switch user):
1. Usage:
 Allows a user to switch to another user account, typically the
superuser.
2. Permission System:
 Requires the user to know the password of the target user
account. This means that if you want to switch to the
superuser account, you need to know the superuser password.

High cpu utilisation command


2

$@ and $*
3

o/p of top command


4

9) In UNIX, what is the primary fundamental component of a file system?

These are (BIDS)

 Boot lock

 Inode Block

 Data Block

 Super Block

17) In shell scripting, where you will find the login names of all the users on a
system and how they can be printed at the same time?

There is a file “etc/shadow file which contains all the information related to the users and the
same can be printed or displayed anytime when the need of same is felt. You have no reasons
to worry about this and the command awk-F can let you print them all in one go.
5

Grcefull kill
2. kill -15
 Sends the SIGTERM signal.
 SIGTERM (signal number 15) is a polite way to ask a process to
terminate. It allows the process to perform cleanup (such as closing
files and freeing resources) before it exits.
 Most applications respond to SIGTERM by shutting down gracefully, but
the process can ignore this signal if it is programmed to do so.

Df -h does not show any output :


Filesystem Table (/etc/mtab) Issue
 The df command uses the /etc/mtab file, which contains information
about mounted filesystems. If this file is corrupted, df might fail.
 Solution: You can regenerate mtab by creating a symbolic link to
/proc/mounts
Filesystem or Mount Issues
 If there is a problem with the filesystem or mount points (e.g.,
corrupted filesystems or unresponsive network filesystems), df -h may
hang or produce no output.
 Solution: Check for mounted filesystems with:
bash
Copy code
mount | grep "type"
1. Permissions Issue
 Sometimes, if you’re running the command as a non-root user, there
might be permission issues that prevent df -h from accessing certain
filesystem information.
 Solution: Try running the command with sudo
bash
6

Copy code
sudo df -h

You might also like