Unix Flashcards
Specify the difference between absolute path and related path.
Absolute path refers to the exact path as defined from the root directory.
Related path refers to the path related to the current locations.
What are the main features of UNIX?
Machine independent Portability Multi-user operations Unix Shells Hierarchical file system Pipes and filters Background processors Utilities Development tools.
What is called Shell?
The interface between user and system called a shell. Shell accepts commands and set them to execute for user operations.
What are the responsibilities of a shell?
Program Execution Input/output redirection Filename and variable substitution Pipeline hookup Environment control Integrated programming language
What is the UNIX command to list files/folders in alphabetical order?
The ‘ls –l’ command is used to list down files and folders in alphabetical order. When you use ‘ls –lt’ is list down files /folders sorted with modified time.
Describe links and symbolic links in UNIX?
Links are defined as a second name which is used to assign more than one name to a file. Although links are referred to as a pointer to another file it cannot be used to link filenames on different computers.
A Symbolic link is also known as the soft link is defined as a special type of file that contains links or references to another file or directory in the form of absolute or relative path. It does not contain the data actually in the target file but the pointer to another entry in the file system. Symbolic links can also be used to create a file system.
The following command is used to create a symbolic link:
Ln –s target link_name
Here, path is ‘target’
Name of the link is represented by link_name.
What is the FIFO?
FIFO (First In First Out) is also called named pipes and it is a special file for date transient. Data is read only in the written order. This is use to inter-process communications, where data write to one end and reads from another end of the pipe.
Describe fork() system call?
The command use to create a new process from an existing process is called fork().The main process is called parent process and new process id called child process. The parent gets the child process id returned and the child gets 0. The returned values are used to check which process which code executed.
‘It is not advisable to use root as the default login.’ Explain.
The root account is very important and it can leads to system damage easily with abusive usage. So that the securities that normally apply to user accounts are not applicable to the root account.
What is mean by Super User?
The user with access to all files and commands within the system is called super user. Generally, super user login is to root and the login is secured with the root password.
What is process group?
A collection of one or more processes is called process group. There is a unique process id for each process group. The function “getpgrp” returns the process group ID for the calling process. The group of processes associated with a call
What is the behavioral difference between “cmp” and “diff” commands?
Ans) Both commands for file comparison.
Cmp – Compare given two files with byte by byte and display the first mismatch.
Diff – Display changes that need to done to make both file identical.
What are the duties of following commands?chmod, chown, chgrp
chmod – Change the permission set of the file.
chown – Change ownership of the file.
chgrp – Change group of the file.
How to display the last line of a file?
This can perform using either “tail” or “sed” commands. The easiest way is to use “tail” command.
What are the various IDs in UNIX processes?
Process ID is a unique integer that UNIX uses to identify each process. The process executes to initiate other processes is called parent process and its ID is defined as PPID (Parent Process ID).