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

10/50

Page

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

What is the output of the program?
#! /usr/bin/awk -f
BEGIN {
   print toupper("eXaMpLe_1_$")
}

Select an option to see the answer and solution.

Which is not the correct option for removing a message queue

Select an option to see the answer and solution.

What is the output of this program?
#include<stdio.h>
#include<stdlib.h>
#include<string.h>                              
 
int main()
{
    char *ptr;
    ptr = (char*)malloc(sizeof(char)*8);
    strcpy(ptr,"example");
    printf("%d\n",*ptr);
    return 0;
}

Select an option to see the answer and solution.

The permission -rwSr–r– represented in octal expression will be

Select an option to see the answer and solution.

The command "awk {print $1} test.txt" will

Select an option to see the answer and solution.

What is the output of the following program?
b = 
[ -n $b ]
    echo $?
[ -z $b ]
    echo $?

Select an option to see the answer and solution.

Given the command
$ chmod o-w datafile

Select an option to see the answer and solution.

By default, a Linux user falls under which group?

Select an option to see the answer and solution.

Which GDB command is used to examine the memory?

Select an option to see the answer and solution.

What is the output of the command awk 'BEGIN {printf "%c\n",65}'

Select an option to see the answer and solution.

What is the output of this program?
#include<stdio.h>
#include<stdlib.h>
#include<fcntl.h>
 
int main()
{
    int fd;
    char *buff;
    buff = (char *)malloc(sizeof(char)*5);
    fd = open("example.txt",O_RDWR|O_CREAT); 
    write(fd,"Linux",5);
    read(fd,buff,5);
    printf("%s\n",buff);
}

Select an option to see the answer and solution.

Which is an example for block special file?

Select an option to see the answer and solution.

/proc/partitions contains

Select an option to see the answer and solution.

What is the output of this program?
#include<stdio.h>
#include<stdlib.h>
#include<string.h>                              
 
int main()
{
    int ptr;
    ptr = (int)malloc(sizeof(int)*10);
    return 0;
}

Select an option to see the answer and solution.

Which of the following commands can be used to copy files across systems?

Select an option to see the answer and solution.

What is the output of this program?
#include<stdio.h>
#include<fcntl.h>
 
int main()
{
     int fd, fd2, ret;
     fd = open("hello.c",O_RDONLY);
     ret = close(fd2);
     printf("%d\n",ret);
}

Select an option to see the answer and solution.

Which option is used by sed to specify that the following string is an instruction or set of instructions?

Select an option to see the answer and solution.

What is the output of this program?
#include<stdio.h>
#include<fcntl.h>
#include<sys/stat.h>
#include<semaphore.h>
 
int main()
{
    sem_t* sem_id;
    sem_id = sem_open("sem_value",O_CREAT,0666,0);
    if(sem_id == SEM_FAILED)
        perror("sem_open");
    sem_post(sem_id);
    printf("Example\n");
    if(sem_close(sem_id) == -1)
        perror("sem_close");
    return 0;
}

Select an option to see the answer and solution.

what is the output if the who command displays like this
who | cut –d ” ” -f1

Select an option to see the answer and solution.

The command "sed -n '/example/p' old.txt" will

Select an option to see the answer and solution.