# Recent questions tagged unix

1
Match the following for Unix file system: ...
2
Which statements is not correct about “init” process in Unix? It is generally the parent of the login shell. It has PID $1$. It is the first process in the system. Init forks and execs a ‘getty’ process at every port connected to a terminal.
3
A notebook computer is set up to take maximum advantage of power saving features including shutting down the display and the hard disk after periods of inactivity. A user sometimes runs UNIX programs in text mode, and at other times uses the $X$ Window System. She is surprised to find that battery life is significantly better when she uses text-only programs. Why?
4
Many versions of UNIX use an unsigned $32$-bit integer to keep track of the time as the number of seconds since the origin of time. When will these systems wrap around (year and month)? Do you expect this to actually happen?
5
A personal computer salesman visiting a university in South-West Amsterdam remarked during his sales pitch that his company had devoted substantial effort to making their version of UNIX very fast. As an example, he noted that their disk driver used the elevator ... the performance that he measured was identical to what would be expected from first-come, first-served. Was the salesman lying?
6
Implement a program to measure the impact of application-level buffer sizes on read time. This involves writing to and reading from a large file (say, $2$ GB). Vary the application buffer size (say, from $64$ bytes to $4$ KB). Use timing measurement ... buffer sizes. Analyze the results and report your findings: does buffer size make a difference to the overall write time and per-write time?
7
Write a new version of the UNIX ls program. This version takes as an argument one or more directory names and for each directory lists all the files in that directory, one line per file. Each field should be formatted in a reasonable way given its type. List only the first disk address, if any.
8
Write a program that scans all directories in a $UNIX$ file system and finds and locates all i-nodes with a hard link count of two or more. For each such file, it lists together all file names that point to the file.
9
It has been suggested that the first part of each UNIX file be kept in the same disk block as its i-node. What good would this do?
10
We discussed making incremental dumps in some detail in the text. In Windows it is easy to tell when to dump a file because every file has an archive bit. This bit is missing in $UNIX.$ How do $UNIX$ backup programs know which files to dump?
11
Is the open system call in $UNIX$ absolutely essential? What would the consequences be of not having it?
12
In early UNIX systems, executable files (a.out files) began with a very specific magic number, not one chosen at random. These files began with a header, followed by the text and data segments. Why do you think a very specific number was chosen for executable files, whereas other file types had a more-or-less random magic number as the first word?
13
Examine and try to interpret the contents of a UNIX-like or Windows directory with a tool like the UNIX od program. (Hint: How you do this will depend upon what the OS allows. One trick that may work is to create a directory on a USB stick with one operating system and then read the raw device data using a different operating system that allows such access.)
14
Figure $1-23$ shows that a number of UNIX system calls have no Win32 API equivalents. For each of the calls listed as having no Win32 equivalent, what are the consequences for a programmer of converting a UNIX program to run under Windows?
15
16
Where can I study the UNIX portion of OS? That is relavent for GATE.
17
Which UNIX/Linux command is used to mae all files and sub-directions in the directory "progs" executable by all users? chmod - R a + x progs chmod - R 222 progs chmod - X a + x progs chmod - X 222 progs
18
Choose the incorrect statement Shell scripts can accept arguments Shell scripts are interpreted Shell is a programming language Shell scripts are compiled
1 vote
19
The command cat > x in unix is invalid creates a file x and displays an error message creates a file x and waits for the user to give input from the keyboard none of the above
1 vote
20
how 3 could be ans?
21
22
Files that are related to input/output and are used to model serial I/O devices such as terminals, printers and networks are called : (A) regular files (B) character special files (C) directories (D) block special files
23
The Unix command used to find out the number of characters in a file is (A) nc (B) wc (C) chcnt (D) lc
1 vote
24
Explain the following terms with there respective formula (expression) 1) Max file size 2) Max possible file size 3) Max Disk Size 4) Total file size 5) max possible size of the file system. For max possible file size = https://gateoverflow.in/20440/unix-inode https:// ... $\text{size of disk block} * 2^\text{No of bits for Disk Block Addresses}$. When to use what please clear this doubt.
25
Consider the organization of a UNIX file as represented by the inode Assume that there are 12 direct block pointers, and a singly, doubly, and triply indirect pointer in each inode. Further, assume that the system block size and the disk sector size are both 8KB. If the ... the file inode is already in main mem- ory, how many disk accesses are required to access the byte in position 13,423,956?
26
A user level process in Unix traps the signal sent on a Ctrl-C input, and has a signal handling routine that saves appropriate files before terminating the process. When a Ctrl-C input is given to this process, what is the mode in which the signal handling routine executes? User mode Kernel mode Superuser mode Privileged mode Note : I know this is previous year question
27
Q1> Consider the Unix file node which maintains 12 direct disk block addresses, 1 single indirect, 1 double indirect, and 1 triple indirect disk block addresses. The disk block address requires 32 bits and DB size is 1 KB then calculate 1. total file size. 2. ... location of data byte no. 10000000 Byte in the file, location comprises of <In which direct/ indirect pointers branch the address is>
The following source code corresponding to a 'bash' shell script 'sl.sh' in UNIX system: for i in $* do cat$ ... of all the files in present working directory. (C) Displays contents of all the files in present working directory. (D) Displays an error message.