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

19/50

Page

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

What command is used to copy files and directories?

Select an option to see the answer and solution.

Which expression use the value of the enclosed arithmetic expression?

Select an option to see the answer and solution.

To read/write attribute, which one of the following method is required?

Select an option to see the answer and solution.

What is the output of the program?
#include<stdio.h>
#include<sys/types.h>
#include<sys/un.h>
#include<sys/socket.h>
 
int main()
{
    struct sockaddr_un add_server, add_client;
    int fd_server, fd_client;
    int len;
    char ch;
    fd_server = socket(AF_UNIX,SOCK_STREAM,0);
    if(fd_server == -1)
        perror("socket");
    add_server.sun_family = AF_UNIX;
    strcpy(add_server.sun_path,"demo_sock");
    if( bind(fd_server,(struct sockaddr*)&add_server,sizeof(add_server)) != 0)
        perror("bind");
    if( listen(fd_server,3) != 0)
        perror("listen");
    len = sizeof(add_client);
    fd_client = accept(fd_server,(struct sockaddr*)&add_client,&len);
    printf("Example\n"); 
    return 0;
}

Select an option to see the answer and solution.

Runlevel system command is used for?

Select an option to see the answer and solution.

Which option of the command 'cd' use the actual filesystem path for cd.. and the value of pwd?

Select an option to see the answer and solution.

cmd > abc 2>&1 will

Select an option to see the answer and solution.

Which command sets up shorthand for command or command line?

Select an option to see the answer and solution.

If a signal is received by a process, when will it be processed?

Select an option to see the answer and solution.

Solaris real time class priority is

Select an option to see the answer and solution.

What is the output of this program?
#include<stdio.h>
#include<stdlib.h>
#include<sys/types.h>
#include<sys/ipc.h>
#include<sys/sem.h>
 
static int sem_p(void);
static int sem_v(void);
union semun{
    int val;
    struct semid_ds *buf;
    unsigned short array;
};
int sem_id;
struct semid_ds myds;
struct sembuf mybuf;
union semun myun;
static int sem_p(void)
{
    mybuf.sem_num = 0;
    mybuf.sem_op = -1;
    mybuf.sem_flg = SEM_UNDO;
    semop(sem_id,&mybuf,1);
}
static int sem_v(void)
{
    mybuf.sem_num = 0;
    mybuf.sem_op = 1;
    mybuf.sem_flg = SEM_UNDO;
    semop(sem_id,&mybuf,1);
}
int main()
{
    int wfd, rfd;
    sem_id = semget((key_t)911,1,0666 | IPC_CREAT);
    myun.val = 0;
    semctl(sem_id,0,IPC_RMID,myun);
    semctl(sem_id,0,SETVAL,myun);
    sem_p();
    printf("Example\n");
    sem_v();
    return 0;
}

Select an option to see the answer and solution.

In sysfs every subsystem has

Select an option to see the answer and solution.

In the shell, by default, all variables are considered and stored as

Select an option to see the answer and solution.

In GDB, a tracepoint can be set by the command

Select an option to see the answer and solution.

The permission -rwxr-sr– represented in octal expression will be

Select an option to see the answer and solution.

Switch table is used by

Select an option to see the answer and solution.

Which daemon manages the physical memory by moving process from physical memory to swap space when more physical memory is needed.

Select an option to see the answer and solution.

Which gcc option includes debugging info in the generated object code?

Select an option to see the answer and solution.

Which option of gcc makes the compiler print out each function name as it is compiled, and print some statistics about each pass when it finishes?

Select an option to see the answer and solution.

If a file is removed in Unix using 'rm' then

Select an option to see the answer and solution.