Vidyalelo
Computer Science · all questions

Linux
practice.

Practice every MCQ with options. Use Show answers when you want the correct option and solution.

996

Questions

30/50

Page

Pick an option on a question to see the right answer and solution.

Which signal is generated when we press ctrl-Z?

Select an option to see the answer and solution.

Which of the following enables multi-tasking in UNIX?

Select an option to see the answer and solution.

From where would the read statement read if the following statements were executed?
exec < file1
exec < file2
exec < file3
read line

Select an option to see the answer and solution.

Which file shows the parameter passed to kernel at the time of starting?

Select an option to see the answer and solution.

In GCC compiler, "-shared" option is given to create the shared library with

Select an option to see the answer and solution.

What is temporary breakpoint?

Select an option to see the answer and solution.

What is the output of this program?
#include<stdio.h>
#include<sys/time.h>
#include<sys/resource.h>
 
int main()
{
    struct rlimit limit;
    limit.rlim_cur = 10;
    if(setrlimit(RLIMIT_NOFILE,&limit) != 0)
        perror("setrlimit");
    return 0;
}

Select an option to see the answer and solution.

What is the command that can print lines of first file matching with second file?

Select an option to see the answer and solution.

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

Select an option to see the answer and solution.

What is the output of this program?
#include<stdio.h>
#include<pthread.h>
 
int a;  
void *fun_t(void *arg);
void *fun_t(void *arg)
{       
    printf("%d\n",a);
    pthread_exit("Bye");
}
int main()
{
    pthread_t pt;
    void *res_t;         
    a = 10;
    if(pthread_create(&pt,NULL,fun_t,NULL) != 0)
        perror("pthread_create");
    if(pthread_join(pt,&res_t) != 0)
        perror("pthread_join");
    return 0;
}

Select an option to see the answer and solution.

While debugging with GDB

Select an option to see the answer and solution.

The "step" command of GDB

Select an option to see the answer and solution.

The command "mknod myfifo b 4 16"

Select an option to see the answer and solution.

Which file contains the filesystems to be automatically mounted during boot?

Select an option to see the answer and solution.

A system has 512MB of physical memory. Which among the following is not a suitable virtual memory size for this system architecture?

Select an option to see the answer and solution.

With the help of proc filesystem

Select an option to see the answer and solution.

What does chmod +t do?

Select an option to see the answer and solution.

What is the output of this program?
#include<stdio.h>
#include<stdlib.h>
#include<netinet/in.h>
#include<sys/types.h>
#include<sys/socket.h>
 
int main()
{
    int fd_server, fd_client, len, len_client;
    struct sockaddr_in add_server, add_client;
    char buff[10];
    fd_server = socket(AF_INET,SOCK_STREAM,0);
    if (fd_server == -1)
    {
        perror("fd_sock");
        exit(1);   
    }
    len = sizeof(add_server);
    len_client = sizeof(add_client);
    if( bind(fd_server,(struct sockaddr*)&add_server,len) != 0)
        perror("bind");
    fd_client = accept(fd_server,(struct sockaddr*)&add_client,len_client);
    if(fd_client == -1)
        perror("accept");
    read(fd_client,buff,10);
    return 0;
}

Select an option to see the answer and solution.

Which of these is not a Unix Flavor?

Select an option to see the answer and solution.

The directory /sys/block contains

Select an option to see the answer and solution.