What is a shell?
A Unix shell is the program which reads user input from the command line and executes actions based upon that input.
Define session?
A session is a collection of one or more process groups. A process establishes a new session by calling setsid function. This function returns process group id if OK.
What do you mean by signal?
Signals are software interrupts. Signals provide a way of handling asynchronous events: a user at a terminal typing the interrupt key to stop a program or the next program in the pipeline terminating prematurely.
What is unix?
UNIX is the most popular operating system on multi-user systems. This operating system originated as a single-user system. It started off on a cast-off DEC PDP-7 at Bell laboratories in 1969. Ken Thompson, with ideas and help from Dennis Ritchie, and others, wrote a small, general-purpose operating system.
Define program and process?
A program is a executable file residing in a disk file. An executing instance of a program is called a process. Every UNIX process has a unique numeric identifier called the process ID. The process ID is always a non negative integer.
List down the different file types?
- Regular file
- Directory file
- Character special file
- Block special file
- FIFO
- Symbolic link Socket
The group ID of the new file can be the effective group ID of the process The group ID of the new file can be the group ID of the directory in which the file is being created.
What are the different types of buffering is supported by UNIX?
- Fuly buffered
- Line buffered
- Un buffered
What is the purpose of exec functions?
When a process calls one of the exec functions that process is completely replaced by the new program. The new program stats execution from main function. The processed does not change across an exec because a new process is not created.But this function replaces the current process with new program from disk.
Define process group?
A process group is a collection of one or more processes. Each process group has a unique process ID. A function getpgrp returns the process group id of the calling process.
What difference between cmp and diff commands?
cmp - Compares two files byte by byte and displays the first mismatch.
diff - tells the changes to be made to make the files identical.
How many prompts are available in a UNIX system?
Two prompts, PS1 (Primary Prompt), PS2 (Secondary Prompt).
What are shell variables?
Shell variables are special variables, a name-value pair created and maintained by the shell.
what are the different commands used to create files?
- touch - to create empty files.(e.g) - touch ‹filename›
- vi ‹filename›
- cat>filename
What is chmod, chown and chgrp?
Chmod : It is used for to change permissions on files.
Chown : It is used for to change ownership of a file.
Chgrp : It is used for to change group of the file.
Example :
chmod 751 tech
chmod u=rwx, g=rx, o=x tech
chmod =r tech
chgrp hope file.txt
- here hope is a new file group name
chgrp -hR staff /office/files
here R - recursively,
Change the owning group of /office/files, and all subdirectories, to the group staff.
chown chope file.txt
- Set the owner of file file.txt to user chope.
chown -R chope /files/work
- Recursively grant ownership of the directory /files/work, and all files and subdirectories, to user chope.
They are process IDs given to processes. A PID can vary from 0 to 65535.
What does the top command display?
Top command displays the current amount of memory occupied by the currently executing processes and the details. In addition to memory usage top command displays CPU usage and process details.
What is the command to send message to all users who are logged in?
Wall
What is Kernel?
Kernel is core part of unix o/s. It is a group of hundreds of system calls.
What are the different security features in Unix?
- Password protection
- File permissions
- Encryption.
How do you find out the current directory you’re in?
pwd
What is a pipe?
A pipe is two or more commands separated by pipe char ‘|’. That tells the shell to arrange for the output of the preceding command to be passed as input to the following command.
How to close the current user account?
exit
What is the use of grep command?
grep is a pattern search command. It searches for the pattern, specified in the command line with appropriate option, in a file(s).
which command is used to identify the type of the file?
file <filename>
ls -F - * executable file, / directory file, @ link file
ls -l - first letter display the file type
What are the features and benefits of unix?
- Portability
- Machine Independent
- Multi-user operations
- Hierarchical file system
- Unix shell
- Pipes and filters
- Utilities
- Background Processing
- Software Development Tools
- Maturity
What is the use of break and continue statements?
The continue statement suspends execution of all statements following it, and switches control to the top of the loop for the next iteration. The break statement, on the other hand, causes control to break out of the loop.
What is single users system?
The personal computer (PC) is a small, general-purpose system that can execute programs to perform a wide variety of tasks. The PC, however, was designed for use by one person at a time; that is, it is Single-User oriented with MS-DOS as the de facto standard operating system for this range of machines. Single user systems became very popular due to the low cost hardware and wide range of software available for these machines.
No comments:
Post a Comment