1.
Type response below
2.
41. Argument „c“ u komandi „tar cvf myfile.tar myfile“ oznacava ?
Correct Answer
E. E. Kreiranje nove arhive
Explanation
The correct answer is e. Kreiranje nove arhive. In the given command "tar cvf myfile.tar myfile", the "c" option is used to create a new archive file named "myfile.tar" and the "v" option is used to display verbose output while creating the archive. Therefore, the command is used for creating a new archive file.
3.
42. Kada zadajemo komandu sa arhiviranje sa sledecim parametrima:
tar -uvf arhiva.tar ./backup/*
izvršavamo sledece operacije:
Correct Answer
C. C. Dodajemo fajlove iz direktorijuma "backup" u arhivu samo ako su noviji od vec postojecih.
Explanation
The correct answer is c. Dodajemo fajlove iz direktorijuma "backup" u arhivu samo ako su noviji od vec postojecih. This is because the -u option in the tar command is used to update the archive by adding files from the specified directory only if they are newer than the existing files in the archive. The -v option is used to display the progress of the operation, and the -f option is used to specify the name of the archive file. The command "./backup/*" specifies the directory from which the files should be added to the archive.
4.
43. Koja je razlika izmeu komandi „tar tvf myfile.tar“ i „tar xvf myfile.tar“ ?
Correct Answer
D. D. Komanda „tar tvf myfile.tar“ raspakuje arhivu a „tar xvf myfile.tar“ prikazuje sadržaj arhive
Explanation
The correct answer is d. The command "tar tvf myfile.tar" extracts the archive, while the command "tar xvf myfile.tar" displays the contents of the archive.
5.
44. Koliko nacina rada ima „cpio“?
Correct Answer
C. 3
Explanation
There are three ways to use the "cpio" command.
6.
45. Nakon unošenja sledecih komandi
touch a.a b.b c.c
tar -cf arhiva.tar a.a b.b c.c
cat /etc/fstab > a.a
tar -uf arhiva.tar a.a b.b c.c
Correct Answer
A. A. na kraj arhive je dodat fajl "a.a"
Explanation
After executing the given commands, the "tar -cf arhiva.tar a.a b.b c.c" command creates a tar archive named "arhiva.tar" and adds the files "a.a", "b.b", and "c.c" to it. Then, the "cat /etc/fstab > a.a" command overwrites the content of file "a.a" with the contents of "/etc/fstab". Finally, the "tar -uf arhiva.tar a.a b.b c.c" command updates the tar archive by adding the updated file "a.a" to the end of it. Therefore, the correct answer is that the file "a.a" is added to the end of the archive.
7.
46. Nakon unošenja sledecih komandi:
touch a.a b.b c.c
tar -cf arhiva.tar a.a b.b c.c
tar -rf arhiva.tar a.a b.b c.c
U arhivi "arhiva.tar" ce biti:
Correct Answer
B. B. 6 datoteka
Explanation
After executing the commands "touch a.a b.b c.c", three files named a.a, b.b, and c.c will be created. Then, the command "tar -cf arhiva.tar a.a b.b c.c" will create a tar archive named arhiva.tar containing these three files. Finally, the command "tar -rf arhiva.tar a.a b.b c.c" will append the same three files to the existing tar archive. Therefore, the arhiva.tar archive will contain a total of six files.
8.
47. Nakon unosenja sledecih komandi
touch fajl
chmod 777 fajl
tar -cf arhiva.tar fajl
tar -tvf arhiva.tar
izlaz na ekranu ce nam biti:
Correct Answer
E. E. -rwxrwxrwx student/student 0 2011-11-09 20:38 fajl
Explanation
After executing the given commands, the output on the screen will be the details of the "fajl" file. The "-tvf" option is used with the "tar" command to display the contents of the "arhiva.tar" file, and since "fajl" is the only file included in the archive, its details will be displayed. The details mentioned include the file permissions, owner, size, and timestamp.
9.
48. Niz komandi
mkdir proba
cd proba
touch a.a b.b c.c
ls ?.? > fajlovi
cpio –ocvB >arhiva <fajlovi
izvršava sledece operacije:
Correct Answer
B. B. Kreira arhivu “arhiva” i u nju smešta fajlove “a.a”, “b.b” i “c.c”
Explanation
The given command sequence first creates a directory named "proba" using the "mkdir" command. Then it navigates into the "proba" directory using the "cd" command. After that, it creates three files named "a.a", "b.b", and "c.c" using the "touch" command.
The next command "ls ?.? > fajlovi" lists all the files in the current directory that have a single character followed by a dot and another single character. The output of this command is redirected to a file named "fajlovi".
Finally, the command "cpio -ocvB >arhiva
10.
49. Prilikom kreiranja arhive komandom "tar", "gzip" kompresovanje se vrši:
Correct Answer
E. E. Dodavanjem "-z" parametra
Explanation
The correct answer is e. Dodavanjem "-z" parametra. This means that when creating an archive using the "tar" command, compression is done automatically by adding the "-z" parameter. This parameter tells the "tar" command to use the "gzip" compression algorithm to compress the files in the archive.
11.
50. Sta radi komanda „tar cvf myfile.tar myfile“ ?
Correct Answer
B. B. Arhivira datoteku “myfile” u arhivu “myfile.tar”
Explanation
The command "tar cvf myfile.tar myfile" is used to archive the file "myfile" into the archive "myfile.tar".
12.
52. Šta radi sledeca komanda?
cpio -ivB < backup
Correct Answer
C. C. Raspakuje sav sadržaj iz arhive "backup"
Explanation
The given command "cpio -ivB < backup" is used to extract the contents of the archive "backup". The "-i" option is used to extract files from the archive, and the "-v" option is used to display the progress of the extraction. The "-B" option is used to handle binary files. Therefore, the correct answer is c. Raspakuje sav sadržaj iz arhive "backup".
13.
54. Dat je deo programskog koda:
readlink (link_path, target_path, sizeof (target_path));
Šta predstavlja promenljiva link_path?
Correct Answer
D. D. Putanju do simbolickog linka
Explanation
The variable "link_path" represents the path to the symbolic link.
14.
53. Komanda „tar tf“ prikazuje imena datoteka koja se nalaze u arhivi?
Correct Answer
A. True
Explanation
The command "tar tf" is used to list the names of files in an archive. Therefore, the correct answer is true.
15.
55. Dat je deo programskog koda:
fd = open (filename, O_WRONLY | O_CREAT);
writev (fd, vec, 2 * argc);
close (fd);
free (vec);
return 0;
šta predstavlja promenljiva (fd)?
Correct Answer
E. E. Deskriptor datoteke
Explanation
The variable "fd" represents the file descriptor, which is a unique identifier for an open file in a computer system. In this code snippet, "fd" is used to store the file descriptor returned by the "open" function, which opens the specified file with the given flags. The file descriptor is then used as an argument in the "writev" and "close" functions to write data to the file and close the file respectively. Therefore, option e. Deskriptor datoteke (File descriptor) is the correct answer.
16.
56. Dat je deo programskog koda:
sendfile (write_fd, read_fd, &offset, stat_buf.st_size);
close (read_fd);
close (write_fd);
return 0;
šta predstavlja (&offset)?
Correct Answer
E. E. Pomeraj u odnosu na pocetak fajla koji se cita
Explanation
The correct answer is e. Pomeraj u odnosu na pocetak fajla koji se cita (Offset represents the offset from the beginning of the file being read). In the given code snippet, the sendfile function is used to transfer data from the file represented by the read_fd file descriptor to the file represented by the write_fd file descriptor. The offset parameter is used to specify the starting position in the file being read from where the data should be transferred.
17.
57. Dat je deo programskog koda:
sendfile (write_fd, read_fd, &offset, stat_buf.st_size);
close (read_fd);
close (write_fd);
return 0;
šta je (stat_buf.st_size)?
Correct Answer
A. A. Dužina podataka koju je potrebno prebaciti
Explanation
The correct answer is a. Dužina podataka koju je potrebno prebaciti. In the given code, the function sendfile is used to transfer data from one file descriptor to another. The third argument of the function, &offset, is a pointer to a variable that specifies the offset in the source file from where the data transfer should start. The fourth argument, stat_buf.st_size, is the size of the data to be transferred. Therefore, the correct answer is that stat_buf.st_size represents the length of the data that needs to be transferred.
18.
58. Dat je deo programskog koda:
fd = open (filename, O_WRONLY | O_CREAT);
writev (fd, vec, 2 * argc);
close (fd);
free (vec);
return 0;
šta predstavlja promenljiva (vec)?
Correct Answer
B. B. Niz elemenata strukture iovec
Explanation
The variable "vec" represents an array of elements of the structure iovec. In the given code, this array is passed as an argument to the writev function, which is used to write data to a file. The writev function takes the file descriptor (fd), the array (vec), and the number of elements in the array (2 * argc) as arguments. Therefore, the variable "vec" represents an array of elements that will be written to the file.
19.
59. Koja je mana sistemskog poziva write?
Correct Answer
B. B. Može da zapiše samo kontinualnu oblast memorije u datoteku.
Explanation
The correct answer is b. Može da zapiše samo kontinualnu oblast memorije u datoteku. This means that the write system call can only write a continuous area of memory to a file. It is unable to write non-continuous areas of memory to a file.
20.
60. Kombinovanje funkcija opendir, readdir i closedir omogucava:
Correct Answer
C. C. Izlistavanje sadržaja direktorijuma
Explanation
The combination of opendir, readdir, and closedir functions allows for the listing of the contents of a directory. These functions are commonly used in programming to navigate and manipulate directories in a file system. opendir is used to open a directory, readdir is used to read the contents of the directory one by one, and closedir is used to close the directory after the listing is complete. Therefore, the correct answer is c. Izlistavanje sadržaja direktorijuma, which translates to listing the contents of a directory.
21.
61. Sistemski poziv access služi za:
Correct Answer
D. D. Odreivanje prava pristupa pozivnog procesa datoteci
Explanation
The correct answer is d. Određivanje prava pristupa pozivnog procesa datoteci. This means that the access system call is used to determine the access rights of the calling process to a file. It allows the process to check if it has the necessary permissions to perform certain operations on the file, such as reading, writing, or executing.
22.
62. Sistemski poziv readlink služi za:
Correct Answer
C. C. Prikaz imena objekta na koji pokazuje simbolicki link
Explanation
The correct answer is c because the readlink system call is used to display the name of the object that a symbolic link points to. It does not display the content of the file or open the file, but rather retrieves the name of the target object.
23.
63. Sistemski poziv sendfile služi za kopiranje podataka iz jednog deskriptora datoteke u
drugi.
Prednost ove funkcije je:
Correct Answer
D. D. Eliminiše posrednicki bafer
Explanation
The correct answer is d. Eliminiše posrednicki bafer. This means that the sendfile system call eliminates the need for a intermediary buffer when copying data from one file descriptor to another. This can improve performance and efficiency by reducing the number of data copies and memory operations required.
24.
64. Sistemski poziv stat omogucava:
Correct Answer
D. D. Prikazivanje informacija o datoteci iz i-node strukture
Explanation
The correct answer, d, states that the system call "stat" allows for displaying information about a file from the i-node structure. This means that when the "stat" system call is used, it retrieves and displays various information about a file, such as its size, permissions, owner, creation and modification dates, and more. It provides detailed metadata about the file stored in the i-node structure, allowing users to access important information about the file.
25.
65. U koliko zadata datoteka postoji, posle izvršavanja sledeceg dela programskog koda
rval = access (path, F_OK)
promenljiva rval ima vrednost:
Correct Answer
B. B. 0
Explanation
After executing the given code, the variable "rval" will have the value of 0 if the file specified by the "path" variable exists. This is because the "access" function with the "F_OK" flag checks if the file exists, and returns 0 if it does.
26.
66. U koliko posle izvršavanja sledeceg dela programskog koda
rval = access (path, W_OK)
promenljiva rval ima vrednost 0 proces:
Correct Answer
E. E. Ima pravo upisivanja u zadatu datoteku
Explanation
After executing the given code, if the variable "rval" has a value of 0, it means that the access function was successful and the program has the permission to write to the specified file. Therefore, the correct answer is e. Ima pravo upisivanja u zadatu datoteku (It has the permission to write to the specified file).
27.
67. Funkcija chdir omogucava:
Correct Answer
B. C. Promenu trenutnog radnog direktorijuma
Explanation
The correct answer is c. Promenu trenutnog radnog direktorijuma. The chdir function in programming allows for changing the current working directory. This means that the function can be used to navigate to a different directory within the file system, making it the correct answer in this context.
28.
68. Funkcije mkdir i rmdir omogucavaju:
Correct Answer
E. E. Pravljenje i brisanje direktorijuma
Explanation
The functions mkdir and rmdir enable the creation and deletion of directories.
29.
69. Upotreba sistemskog poziva sendfile prilikom kopiranja je efikasnija od pozivanja
Linuks programa cp?
Correct Answer
A. True
Explanation
Using the system call sendfile for copying is more efficient than calling the Linux program cp.
30.
70. Povratna vrednost sistemskog poziva iovec je broj upisanih bajtova.
Correct Answer
A. True
Explanation
The given statement is true. The return value of the system call iovec is the number of bytes written. This means that when the iovec system call is executed, it will return the total number of bytes that have been successfully written to the output.
31.
71. Prilikom korišcenja sistemskog poziva fcntl za zakljucavanje datoteka ista datoteka
MOŽE biti u isto vreme zakljucana i za citanje i za pisanje (read-lock i write-lock).
Correct Answer
B. False
Explanation
When using the fcntl system call for file locking, the same file CANNOT be locked for both reading and writing at the same time.
32.
72. Funkcija getcwd omogucava ispis putanje trenutnog radnog direktorijuma.
Correct Answer
A. True
Explanation
The statement is true because the function getcwd in programming allows for the retrieval and printing of the current working directory path.
33.
73. Funkcija sendfile pri kopiranju podataka može iskljucivo da kopira celokupni sadržaj
datoteke u novu.
Correct Answer
B. False
Explanation
The statement is false because the sendfile function can copy a specified portion of the file's content to a new file, rather than copying the entire content.
34.
74. Shell programi (shell script) se pre izvršavanja moraju prevoditi (compile).
Correct Answer
A. True
Explanation
Shell programs, also known as shell scripts, do not need to be compiled before execution. They are interpreted by the shell, which reads and executes the commands directly. This is different from compiled languages like C or Java, where the source code needs to be compiled into machine code before it can be executed. Shell scripts are written in a scripting language, such as Bash, and can be executed directly by the shell without the need for compilation. Therefore, the statement "Shell programs se pre izvršavanja moraju prevoditi (compile)" is false.
35.
75. Napisali smo sledeci shell program:
#!/bin/bash
case $1 in
"smer") echo "RT";;
"godina") echo "II";;
"status") echo "SF";;
*) echo "*** Pogresan argument ***";;
esac
koji argument treba da damo pri pokretanju ovog programa da bi izlaz bio "RT"?
Correct Answer
E. E. smer
Explanation
The correct answer is e. smer. In the given shell program, the case statement checks the value of $1 (the first argument passed to the program). If it matches "smer", it will echo "RT". Therefore, to get the output "RT", we need to pass "smer" as the argument when running the program.
36.
76. Komanda koja nam omogucava ispisivanje vrednosti neke sistemske promenljive je:
Correct Answer
D. D. echo $IMEPROMENLJIVE
Explanation
The correct answer is d. echo $IMEPROMENLJIVE. The echo command is used in programming languages to display text or the value of a variable. In this case, it is used to print the value of the system variable $IMEPROMENLJIVE.
37.
77. Pravilno dodeljivanje vrednosti promenljivoj u Linuksu je:
Correct Answer
B. B. VAR=10
Explanation
The correct answer is b. VAR=10. In Linux, variables are assigned values using the syntax variable_name=value. Therefore, to assign the value 10 to the variable VAR, the correct syntax is VAR=10.
38.
78. Moguci izlaz sledece komande echo "Današnji datum: `date`"
je:
Correct Answer
A. A. Današnji datum: Fri Apr 22 16:30:35 CEST 2011
Explanation
The correct answer is a. Današnji datum: Fri Apr 22 16:30:35 CEST 2011. This is because the command "echo" is used to display the output, and the portion "`date`" is a command substitution that will be replaced with the current date and time when the command is executed. Therefore, the output will be "Današnji datum: Fri Apr 22 16:30:35 CEST 2011".
39.
79. Komanda u Linuks terminalu
expr 5+8
ce po izvršavanju ispisati:
Correct Answer
C. C. 13
Explanation
The command "expr 5+8" in the Linux terminal is used to evaluate arithmetic expressions. In this case, it is adding 5 and 8 together. The result of this addition is 13, which is why the correct answer is c. 13.
40.
80. Ako izvršimo sledecu komandu u terminalu
cd ~
preci cemo u:
Correct Answer
E. E. Svoj home direktorijum
Explanation
The command "cd ~" is used to navigate to the user's home directory. The "~" represents the home directory shortcut. Therefore, the correct answer is e. Svoj home direktorijum, which translates to "your home directory" in English.
41.
81. Šta ce se desiti po izvršavanju sledece komande u Linuks terminalu:
read var1
Correct Answer
C. C. Sistem ce ocekivati da na tastaturi unesemo vrednost za promenljivu var1
Explanation
After executing the command "read var1" in the Linux terminal, the system will expect the user to enter a value for the variable var1 using the keyboard. This command is used to read input from the user and store it in the specified variable. It does not print the value of the variable or write it to a file. Therefore, option c is the correct answer.