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

15/50

Page

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

Which one of the following string will print first by this program?
#include<stdio.h>
#include<pthread.h>
 
void *fun_t(void *arg);
void *fun_t(void *arg)
{
    printf("Example\n");
    pthread_exit("Bye");
}
int main()
{
    pthread_t pt;
    void *res_t;
    if(pthread_create(&pt,NULL,fun_t,NULL) != 0)
        perror("pthread_create");
    printf("Linux\n");
    if(pthread_join(pt,&res_t) != 0)
        perror("pthread_join");
    return 0;
}

Select an option to see the answer and solution.

The preprocessor creates the file with extension

Select an option to see the answer and solution.

System V IPC common attributes are

Select an option to see the answer and solution.

Which option of make command print the commands that would be executed, but do not execute them?

Select an option to see the answer and solution.

we can change the priority of a running process using

Select an option to see the answer and solution.

What is the output of the below code?
void exit_handler1();   
void exit_handler2();    
int main() 
{     
	int pid;        
	atexit(exit_handler1);      
	atexit(exit_handler2);     
	pid = fork();       
	if(pid == 0) 
	{        
		_exit(0);      
        } 
        else 
	{          
		sleep(2);            
		exit(0);     
	}     
	return 0;    
}

Select an option to see the answer and solution.

Functions improves the shell's programmability significantly, because

Select an option to see the answer and solution.

ILP32 stands for

Select an option to see the answer and solution.

Which one of the following contains various bits of information about the state of power management?

Select an option to see the answer and solution.

To put the breakpoint at the current line . . . . . . . . command can be used?

Select an option to see the answer and solution.

Which among the following is used to write small programs to control Unix functionalities?

Select an option to see the answer and solution.

The file /proc/[PID]/cgroups

Select an option to see the answer and solution.

Which command allows to view the current jobs being handled by the shell?

Select an option to see the answer and solution.

Executing cat /etc/password > /dev/sda as superuser will

Select an option to see the answer and solution.

Kernel objects are exported as . . . . . . . . via sysfs.

Select an option to see the answer and solution.

What is the output of this program?
#!/bin/sh	
var="Example"
demo_function() {
    var="Linux"
    echo $var
}
demo_function
exit 0

Select an option to see the answer and solution.

The /dev directory contains the

Select an option to see the answer and solution.

Which represents the user home directory

Select an option to see the answer and solution.

Command used to determine the path of an executable file is

Select an option to see the answer and solution.

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

Select an option to see the answer and solution.