Explore topic-wise MCQs in Computer Science Engineering (CSE).

This section includes 713 Mcqs, each offering curated multiple-choice questions to sharpen your Computer Science Engineering (CSE) knowledge and support exam preparation. Choose a topic below to get started.

301.

Whcich command is used for word count

A. infile
B. file
C. wc
D. cp
Answer» D. cp
302.

The command for changing file owener is

A. chown
B. chgrp
C. chmod
D. cher
Answer» B. chgrp
303.

Which command is used to determine a type of file

A. infile
B. file
C. wc
D. cp
Answer» C. wc
304.

which command is used for displaying contents of a file

A. mv
B. cp
C. rm
D. cv
Answer» C. rm
305.

which command is used for copying a file

A. mv
B. cp
C. rm
D. cv
Answer» D. cv
306.

which command is used for renaming a file

A. mv
B. cp
C. rm
D. cv
Answer» B. cp
307.

which option in used for deleting everything in current directory and below.

A. rm-i
B. rm-r
C. rm-f
D. rm-rf
Answer» E.
308.

which option is used for forcing removal operation

A. rm-i
B. rm-r
C. rm-f
D. rm-rf
Answer» D. rm-rf
309.

Which option makes the command to ask the user for confirmation before removing each file

A. rm-i
B. rm-r
C. rm-f
D. rm-rf
Answer» B. rm-r
310.

which opttion deletes all files in the current directory and all its subdirectories

A. rm-i
B. rm-r
C. rm-f
D. rm-rf
Answer» C. rm-f
311.

Which directory under the root contains the information on devices

A. /usr/bin
B. /dev
C. /usr/peripherals/de v
D. /etc/dev
Answer» C. /usr/peripherals/de v
312.

For some file the access permissions are modified to 764. Which of the following interpretation is valid:

A. every one can read, group can execute only and the owner can read and write.
B. every one can read and write, but owner alone can execute.
C. every one can read, group including owner can write, owner alone can execute
D. none of these
Answer» D. none of these
313.

The advantage of binary files over text file is

A. it is compact
B. it can be accessed faster.
C. they are more reliable
D. all of these
Answer» E.
314.

UNIX uses ls to list files in a directory. The corresponding command in MS environment is

A. lf
B. listdir
C. dir
D. none of these
Answer» D. none of these
315.

dev/nul

A. it is a file
B. has write operation for all
C. built in dest bin
D. all of these
Answer» E.
316.

In a system 5 peole are currently using VI editor, then no. of currosonding rocesses will be

A. 1
B. 5
C. 2
Answer» C. 2
317.

which of following features of UNIX may be used for IPC

A. signals
B. ipes
C. semaphores
D. all of these
Answer» E.
318.

Short lived files created during execution are stored in

A. /tmp
B. /lib
C. /bin
D. /etc
Answer» B. /lib
319.

various administrative fils such as password file in

A. /dev
B. /lib
C. /bin
D. /etc
Answer» E.
320.

The basic program such as who and ed resids in

A. /dev
B. /lib
C. /bin
D. /etc
Answer» D. /etc
321.

primary parts oc c comipler is in

A. /dev
B. /lib
C. /bin
D. /etc
Answer» C. /bin
322.

The rm command removes

A. directory entries
B. removes inodes
C. removes names
D. removes files
Answer» B. removes inodes
323.

The first tow bytes in each directory entry are

A. connection between id and name
B. connection between name of file and its contents
C. connection between if and its contents
D. connection betweeen id and contents
Answer» C. connection between if and its contents
324.

The systems internal name to file is

A. id
B. i-number
C. pid
D. pid_t
Answer» C. pid
325.

The administrative information of a file is stored in

A. vnode
B. dnode
C. inode
D. snode
Answer» D. snode
326.

The command - in ls represents

A. accessibility of a file
B. permissin on the file
C. reead
D. execute
Answer» C. reead
327.

The -t option to ls is used for

A. sort according to time
B. sor according to date
C. sort according to name
D. sort according to size
Answer» B. sor according to date
328.

the different pemissions asociated with files are

A. read
B. write
C. execute
D. all ofthese
Answer» E.
329.

user on unix system is alled as

A. unique user
B. super user
C. special user
D. all of these
Answer» C. special user
330.

The parent directory is known as

A. root
B. bin
C. user
D. none of these
Answer» B. bin
331.

what is file system

A. seqenceof bytes
B. sequence of bits
C. sequence of kilo bytes
D. sequence of megabytes
Answer» B. sequence of bits
332.

Code snippet (file1 size is 2024)f1 = fopen (file1, RDWR, RWX) lseek(f1,1024,SEEK_SET) write(f1,buf,10) What is offset now.

A. 1024
B. 1034
C. 2034
D. 2054
Answer» C. 2034
333.

ode snippets str1=”45678\n” str2=”123\n” f1 = fopen(file1,RDWR,RWX) f2 = fopen(file1,RDWR,RWX) write(f1,str1,len_str1) write(f2,str2,len_str2) o/p:

A. 12378
B. 123(newline)8(new line)
C. 123(newline)78(ne wline)
D. 45678(newline)1 23(newline)
Answer» C. 123(newline)78(ne wline)
334.

Below is the codeint main() { int fd1, fd2; struct stat buff1, buff2; fd1 = open(“1.txt”, O_RDWR); fd2 = open(“2.txt”, O_RDWR | O_APPEND); lseek(fd1, 10000, SEEK_SET); write(fd1, “abcdefghij”, 10); write(fd2, “abcdefghij”, 10); fstat(fd1, &buff1); fstat(fd2, &buff2); printf(“ %d %d”, buff1.st_size, buff2.st_size); return 0; }Before running the program, the file 1.txt and 2.txt size is 20 each. What is the output?

A. 30 30
B. 100020 20
C. 100030 30
D. 100010 30
Answer» E.
335.

For the below mentioned codeint main() { int fd; fd = open(“logfile”, O_CREAT|O_RDWR, 0600); lseek(fd, 5, SEEK_CUR); write(fd, “Hello”, 5); return 0; },

A. 5
B. 1024
C. 1029
D. 1034
Answer» C. 1029
336.

What is stored in logfile as per below mentioned code if we execute ./a.out > logfile?nt main() { int fd; close(1); fd = open(“logfile”,O_RDWR, 0744); write(fd, “Hello”, 5); printf(“World\n”); return 0; }

A. hello
B. helloworld
C. world
D. none
Answer» C. world
337.

Given a code snippet below? #define PERMS (S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH) int main() { int fd1, fd2; umask(0); fd1 = open(“file1”, O_CREAT | O_RDWR, PERMS) umask(S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH); fd2 = open(“file2”, O_CREAT | O_RDWR, PERMS) return 0; } The newly created files file1 and file2 will have the permissions respectively

A. rw-rw-rw- r——–
B. r——– rw-rw-rw-
C. rw-rw-rw- rw——
D. none of the abov
Answer» D. none of the abov
338.

dup2(1,0)

A. closes the stdout and copies the stdin descriptor to stdout
B. closes the stdin and copies the stdout descriptor to stdin
C. will produce compilation error
D. none of the above
Answer» C. will produce compilation error
339.

Which system call is used to create a hard link?

A. hardlink
B. link
C. symlink
D. ln
Answer» C. symlink
340.

namei() is

A. ansi c library function
B. c library function
C. system call
D. kernel routine
Answer» E.
341.

read() system call on success returns

A. 0
B. -1
C. c)
D. none
Answer» D. none
342.

printf() uses which system call

A. open
B. read
C. write
D. close
Answer» D. close
343.

Which function can be used instead of the dup2 to duplicate the file descriptor?

A. read()
B. open()
C. stat()
D. fcntl()
Answer» E.
344.

What is the use of fcntl function?

A. locking a file
B. reading the file descriptor flag
C. changing the file status flag
D. all the above
Answer» E.
345.

Switch table is used by

A. device special file
B. directory file
C. fifo
D. link file.
Answer» B. directory file
346.

he file system information is stored in

A. boot block
B. super block
C. inode table
D. data block
Answer» C. inode table
347.

What is the default number of files open per user process?

A. 0
B. 1
C. 2
D. 3
Answer» E.
348.

File descriptor table indexes which kernel structure?

A. struct file
B. strruct fs_struct
C. files_struct
D. struct inode
Answer» B. strruct fs_struct
349.

Which command is used to mount file system read only.

A. mount –a
B. mount –v
C. mount –f
D. mount –r
Answer» E.
350.

Each process has unique

A. fd table
B. file table
C. inode table
D. data block table
Answer» B. file table