Os2 Prva Odbrana 2/2

Reviewed by Editorial Team
The ProProfs editorial team is comprised of experienced subject matter experts. They've collectively created over 10,000 quizzes and lessons, serving over 100 million users. Our team includes in-house content moderators and subject matter experts, as well as a global network of rigorously trained contributors. All adhere to our comprehensive editorial guidelines, ensuring the delivery of high-quality content.
Learn about Our Editorial Process
| By Dejannrt15416
D
Dejannrt15416
Community Contributor
Quizzes Created: 1 | Total Attempts: 626
| Attempts: 626 | Pitanja: 40
Please wait...

Question 1 / 40
0 %
0/100
Score 0/100
1. 44. Koliko nacina rada ima „cpio"?

Explanation

There are three ways to use the "cpio" command.

Submit
Please wait...
About This Quiz
Os2 Prva Odbrana 2/2 - Quiz

Personalize your quiz and earn a certificate with your name on it!
2. 68. Funkcije mkdir i rmdir omogucavaju:

Explanation

The functions mkdir and rmdir enable the creation and deletion of directories.

Submit
3. 74. Shell programi (shell script) se pre izvršavanja moraju prevoditi (compile).

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.

Submit
4. 53. Komanda „tar tf" prikazuje imena datoteka koja se nalaze u arhivi?

Explanation

The command "tar tf" is used to list the names of files in an archive. Therefore, the correct answer is true.

Submit
5. 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)?

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.

Submit
6. 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)?

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.

Submit
7. 77. Pravilno dodeljivanje vrednosti promenljivoj u Linuksu je:

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.

Submit
8. 72. Funkcija getcwd omogucava ispis putanje trenutnog radnog direktorijuma.

Explanation

The statement is true because the function getcwd in programming allows for the retrieval and printing of the current working directory path.

Submit
9. 79. Komanda u Linuks terminalu expr 5+8 ce po izvršavanju ispisati:

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.

Submit
10. 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)?

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.

Submit
11. 69. Upotreba sistemskog poziva sendfile prilikom kopiranja je efikasnija od pozivanja Linuks programa cp?

Explanation

Using the system call sendfile for copying is more efficient than calling the Linux program cp.

Submit
12. 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"?

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.

Submit
13. 76. Komanda koja nam omogucava ispisivanje vrednosti neke sistemske promenljive je:

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.

Submit
14. 70. Povratna vrednost sistemskog poziva iovec je broj upisanih bajtova.

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.

Submit
15. 78. Moguci izlaz sledece komande echo "Današnji datum: `date`" je:

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".

Submit
16. 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:

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.

Submit
17. 49. Prilikom kreiranja arhive komandom "tar", "gzip" kompresovanje se vrši:

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.

Submit
18. 80. Ako izvršimo sledecu komandu u terminalu cd ~ preci cemo u:

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.

Submit
19. 41. Argument „c" u komandi „tar cvf myfile.tar myfile" oznacava ?

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.

Submit
20. 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

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.

Submit
21. 63. Sistemski poziv sendfile služi za kopiranje podataka iz jednog deskriptora datoteke u drugi. Prednost ove funkcije je:

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.

Submit
22. 64. Sistemski poziv stat omogucava:

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.

Submit
23. 65. U koliko zadata datoteka postoji, posle izvršavanja sledeceg dela programskog koda rval = access (path, F_OK) promenljiva rval ima vrednost:

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.

Submit
24. 60. Kombinovanje funkcija opendir, readdir i closedir omogucava:

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.

Submit
25. 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).

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.

Submit
26. 61. Sistemski poziv access služi za:

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.

Submit
27. 48. Niz komandi mkdir proba cd proba touch a.a b.b c.c ls ?.? > fajlovi cpio –ocvB >arhiva <fajlovi izvršava sledece operacije:

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
Therefore, the correct answer is that the command sequence creates an archive named "arhiva" and it stores the files "a.a", "b.b", and "c.c" into the archive.

Submit
28. 59. Koja je mana sistemskog poziva write?

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.

Submit
29. 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:

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.

Submit
30. 67. Funkcija chdir omogucava:

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.

Submit
31. 81. Šta ce se desiti po izvršavanju sledece komande u Linuks terminalu: read 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.

Submit
32. 73. Funkcija sendfile pri kopiranju podataka može iskljucivo da kopira celokupni sadržaj datoteke u novu.

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.

Submit
33. 66. U koliko posle izvršavanja sledeceg dela programskog koda rval = access (path, W_OK) promenljiva rval ima vrednost 0 proces:

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).

Submit
34. 50. Sta radi komanda „tar cvf myfile.tar myfile" ?

Explanation

The command "tar cvf myfile.tar myfile" is used to archive the file "myfile" into the archive "myfile.tar".

Submit
35. 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)?

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.

Submit
36. 54. Dat je deo programskog koda: readlink (link_path, target_path, sizeof (target_path)); Šta predstavlja promenljiva link_path?

Explanation

The variable "link_path" represents the path to the symbolic link.

Submit
37. 43. Koja je razlika izmeu komandi „tar tvf myfile.tar" i „tar xvf myfile.tar" ?

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.

Submit
38. 52. Šta radi sledeca komanda? cpio -ivB < backup

Explanation

The given command "cpio -ivB

Submit
39. 62. Sistemski poziv readlink služi za:

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.

Submit
40. 42. Kada zadajemo komandu sa arhiviranje sa sledecim parametrima: tar -uvf arhiva.tar ./backup/* izvršavamo sledece operacije:

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.

Submit
View My Results

Quiz Review Timeline (Updated): Mar 22, 2023 +

Our quizzes are rigorously reviewed, monitored and continuously updated by our expert board to maintain accuracy, relevance, and timeliness.

  • Current Version
  • Mar 22, 2023
    Quiz Edited by
    ProProfs Editorial Team
  • Dec 06, 2018
    Quiz Created by
    Dejannrt15416
Cancel
  • All
    All (40)
  • Unanswered
    Unanswered ()
  • Answered
    Answered ()
44. Koliko nacina rada ima „cpio"?
68. Funkcije mkdir i rmdir omogucavaju:
74. Shell programi (shell script) se pre izvršavanja moraju...
53. Komanda „tar tf" prikazuje imena datoteka koja se nalaze u...
55. Dat je deo programskog koda: ...
57. Dat je deo programskog koda: ...
77. Pravilno dodeljivanje vrednosti promenljivoj u Linuksu je:
72. Funkcija getcwd omogucava ispis putanje trenutnog radnog...
79. Komanda u Linuks terminalu ...
58. Dat je deo programskog koda: ...
69. Upotreba sistemskog poziva sendfile prilikom kopiranja je...
75. Napisali smo sledeci shell program: ...
76. Komanda koja nam omogucava ispisivanje vrednosti neke sistemske...
70. Povratna vrednost sistemskog poziva iovec je broj upisanih...
78. Moguci izlaz sledece komande echo "Današnji datum:...
46. Nakon unošenja sledecih komandi: ...
49. Prilikom kreiranja arhive komandom "tar",...
80. Ako izvršimo sledecu komandu u terminalu ...
41. Argument „c" u komandi „tar cvf myfile.tar myfile"...
45. Nakon unošenja sledecih komandi ...
63. Sistemski poziv sendfile služi za kopiranje podataka iz jednog...
64. Sistemski poziv stat omogucava:
65. U koliko zadata datoteka postoji, posle izvršavanja...
60. Kombinovanje funkcija opendir, readdir i closedir omogucava:
71. Prilikom korišcenja sistemskog poziva fcntl za...
61. Sistemski poziv access služi za:
48. Niz komandi ...
59. Koja je mana sistemskog poziva write?
47. Nakon unosenja sledecih komandi ...
67. Funkcija chdir omogucava:
81. Šta ce se desiti po izvršavanju sledece komande u...
73. Funkcija sendfile pri kopiranju podataka može iskljucivo da...
66. U koliko posle izvršavanja sledeceg dela programskog koda ...
50. Sta radi komanda „tar cvf myfile.tar myfile" ?
56. Dat je deo programskog koda: ...
54. Dat je deo programskog koda: ...
43. Koja je razlika izmeu komandi „tar tvf myfile.tar" i...
52. Šta radi sledeca komanda? cpio -ivB < backup
62. Sistemski poziv readlink služi za:
42. Kada zadajemo komandu sa arhiviranje sa sledecim parametrima: ...
Alert!

Advertisement