Saturday, April 13, 2013

Nitheen Kumar

Shell Scripting Interview Questions 5

 
41: How can I set the default rwx permission to all users on every file which is created in the current shell?

We can use: umask 777 This will set default rwx permission for every file which is created to every user.

42: How can we find the process name from its process id?

We can use “ps –p ProcessId”

43: What are the four fundamental components of every file system on linux?

bootblock, super block, inode block and datablock

44: What is a boot block?

This block contains a small program called “Master Boot record”(MBR) which loads the kernel during system boot up.

45: What is a super block?

Super block contains all the information about the file system like size of file system, block size used by it,number of free data blocks and list of free inodes and data blocks.

46: What is an inode block?

This block contains the inode for every file of the file system along with all the file attributes except its name.

47: How can I send a mail with a compressed file as an attachment?

zip file1.zip file1|mailx –s “subject” Recepients email id Email content EOF

48: How do we create command aliases in shell?

alias Aliasname=”Command whose alias is to be created”

49: What are “c” and “b” permission fields of a file?

“c “ and “b” permission fields are generally associated with a device file. It specifies whether a file is a character special file or a block special file.

50: What is the use of a shebang line?

Shebang line at top of each script determines the location of the engine which is to be used in order to execute the Script.

<< 1 2 3 4 5 >>

Subscribe to get more Posts :