85.
What is stored in logfile as per below mentioned code if we execute ./a.out > logfile?
int main() 
{
    int fd;
    close(1);
    fd = open(“logfile”,O_RDWR, 0744);
    write(fd, “Hello”, 5);
    printf(“World\n”);
    return 0;
}

86.
What is the output of this program?
#! /usr/bin/awk -f
BEGIN {
    for(i=0;i<=5;i++) {
        print i
        i++
    }
}

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

88.
What is the output of this when the pipe is successfully created?
#include<stdio.h>
 
int main()
{
     int ret_val;
     int fd[2];
     ret_val = pipe(fd);
     printf("%d\n",ret_val);
     return 0;
}

89.
Which one of the following is not correct about job control in bash shell?

90.
By this program the soket "demo_sock" will create
#include<stdio.h>
#include<sys/types.h>
#include<sys/un.h>
#include<sys/socket.h>
 
int main()
{
    struct sockaddr_un add_server;
    int fd_server;
    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");
    return 0;
}

Read More Section(Linux)

Each Section contains maximum 100 MCQs question on Linux. To get more questions visit other sections.