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

33/50

Page

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

Which of these is the correct method for appending "foo" in /tmp/bar file?

Select an option to see the answer and solution.

Which one of the following is not true?

Select an option to see the answer and solution.

Libsysfs is a

Select an option to see the answer and solution.

What is /bin/sh ?

Select an option to see the answer and solution.

What is the output of this program?
#include<stdio.h>
#include<fcntl.h>
#include<errno.h>
#include<sys/stat.h>
#include<sys/mman.h>
 
int main()
{
    int s_id;
    s_id = shm_open("shared_mem",O_CREAT|O_RDWR,0666);
    if(s_id != EACCES)
        perror("Permission granted\n");
    return 0;
}

Select an option to see the answer and solution.

A server which is handling one client at a time is called as

Select an option to see the answer and solution.

Which of the following represents an absolute path?

Select an option to see the answer and solution.

This program will print the
#include<stdio.h>
#include<unistd.h>
 
int main()
{
    long int value;
    value = sysconf(_SC_OPEN_MAX);
    printf("%ld\n",value);
    return 0;
}

Select an option to see the answer and solution.

Single user mode shell runs as

Select an option to see the answer and solution.

Write the command to display the current date in the form dd/mm/yyyy.

Select an option to see the answer and solution.

The object file contains the

Select an option to see the answer and solution.

Inside GDB, a program may stop because of

Select an option to see the answer and solution.

The lines in our code that begin with the "#" character are

Select an option to see the answer and solution.

Which command is used to debug a shell script program

Select an option to see the answer and solution.

What is the output of this program?
#!/bin/bash
function hello_function1 {
    echo "This is first function"	
}
hello_function2() {
    echo "This is second function"
}
hello_function1
hello_function2
exit 0

Select an option to see the answer and solution.

Effective user id can be set using following permission

Select an option to see the answer and solution.

Create a new file "new.txt" that is a concatenation of "file1.txt" and "file2.txt"

Select an option to see the answer and solution.

The hard limit of the file descriptors that can be opened by this process will become
#include<stdio.h>
#include<sys/time.h>
#include<sys/resource.h>
 
int main()
{
    struct rlimit limit;
    limit.rlim_cur = 10;
    limit.rlim_max = 20;
    if(setrlimit(RLIMIT_NOFILE,&limit) != 0)
        perror("setrlimit");
    if(getrlimit(RLIMIT_NOFILE,&limit) != 0)
        perror("getrlimit");
    printf("%lu\n",limit.rlim_cur);
    printf("%lu\n",limit.rlim_max);
    return 0;
}

Select an option to see the answer and solution.

The archive(ar) utility in linux can

Select an option to see the answer and solution.

The gcc option -Wunused warns when a . . . . . . . . variable is unused aside from its declaration.

Select an option to see the answer and solution.