The fourth column shows the group ownership of each file.At the time of user account creation, the system administratorassigns the user to a group. The fifth column displays the file size in bytes. The sixth column gives the date and time of modification of thefiles. The last column gives the name of the file and the list isarranged in the alphabetical order.5.Write a UNIX command to display the current date in the formdd/mm/yyyy.
. $ date +%D6.Explain the different types of files in UNIX.
. There are four possible types of file in UNIX:
These files cannot contain text, data, or programinformation. An ordinary file cannot contain another file, or directory. An ordinaryfile can be a text file or a binary file.
Directories are containers that can hold files, andother directories. A directory is actually implemented as a file that has one line for each item contained within the directory.
These files represent input/output (i/o) devices, like atty (terminal), a disk drive, or a printer. Because UNIX treats such devices as files,some of the commands used to access ordinary files will also work with device files.This allows for more efficient use of software.
A link is a pointer to another file. Since a directory is a list of thenames and i-numbers of files, a directory entry can be a hard link, in which the i-number points directly to another file.
1.Write a UNIX command to count how many users havelogged on to the UNIX system.Ans.
2.What is a process? Explain the mechanism of processcreation in UNIX system.Ans.
A process is born when a program starts execution and existsas long as the program is running. After execution the process issaid to die. The name of the process is usually the name of theprogram being executed. The creation of a process is in three phases and uses threesystem calls known as fork, exec and wait. ‘fork’ is a system callthat creates a new process from an existing process. The newprocess is called the child process, and the existing process is calledthe parent. The attributes of the parent and child are an identicalimage except for parameters like Parent-ID. The child gets a newParent-ID and the process is forked. This is the mechanism used tomultiply process in the system. The child process overwrites theimage with a copy of program that is to be executed by using the‘exec’ system call. No additional processes are created and the