Computer Knowledge
Computer File Systems
1,249 Questions
Computer file systems dictate how data is stored, organized, and retrieved on storage devices. Important concepts include file allocation tables, access mechanisms, and various formats like sequential and video files. Candidates preparing for banking and government exams should practice these fundamentals thoroughly.
File access mechanismsVideo and password filesFile extensionsFile allocation tableSystem metadata
Computer File Systems Questions
-
cat *.txt -length=10
-
disp 10 .txt
-
head -10 *.txt
-
print 10 *.txt
C
Correct answer
Explanation
The head -10 command displays the first 10 lines of files. The *.txt glob pattern matches all files ending with .txt in the current directory. Combining them as head -10 *.txt correctly displays the first 10 lines of each .txt file. Options A, B, and D use nonexistent or incorrect command syntax.
-
ren FILE1 FILE2 - i
-
ren FILE1 FILE2
-
cp FILE1 FILE2
-
mv FILE1 FILE2
D
Correct answer
Explanation
In Unix/Linux, the 'mv' command both moves and renames files. 'mv FILE1 FILE2' renames FILE1 to FILE2 (or moves it to FILE2). 'ren' is a DOS/Windows command, not Unix. 'cp' copies files rather than renaming them. The '-i' flag (for interactive prompting) is not required for basic renaming.
-
fchmode()
-
fchmod()
-
chmod()
-
All the above.
B
Correct answer
Explanation
fchmod() is the Unix system call that changes file permissions using a file descriptor rather than a filename. chmod() uses a filename path instead. Option A 'fchmode()' is a typo - not a real system call. Option D is incorrect because only fchmod() uses file descriptor.
-
A. FORDER IF E DISK
-
B. FORDER IPE F 41 DISK
-
C. FORDER IF E 41 DISK
-
D. FORDER IF F DISK
A
Correct answer
Explanation
For externally-described input files in IBM i, the F-spec format uses IF (Input file, Externally-described). The record length is defined in the external file description, not in the F-spec, so no length parameter is needed. Option C includes an unnecessary 41 byte parameter, and option D incorrectly uses F (fixed-length) instead of E (externally-described).
D
Correct answer
Explanation
Output queues (*OUTQ) are IBM i objects that store spooled files waiting to be printed on output devices like printers. *PRTF is a printer file definition, not a queue object. *SPLQ and *PRTQ are not valid IBM i object types for this purpose.
-
No difference, they function the same
-
/COPY cannot be used as a conditional directive
-
/INCLUDE files cannot contain embedded SQL
-
Nesting /INCLUDE directives is not allowed
C
Correct answer
Explanation
In RPG programming, /INCLUDE and /COPY directives have specific differences. The key distinction is that /INCLUDE files cannot contain embedded SQL statements (C is correct). This is a documented limitation in RPG compilers where SQL preprocessor cannot handle /INCLUDE directives. Options A, B, and D are incorrect - there are functional differences between the directives, both can be conditional, and /INCLUDE can be nested.
-
No difference, they function the same
-
/COPY cannot be used as a conditional directive
-
/INCLUDE files cannot contain embedded SQL
-
Nesting /INCLUDE directives is not allowed
C
Correct answer
Explanation
In RPG programming, /INCLUDE and /COPY directives have specific differences. The key distinction is that /INCLUDE files cannot contain embedded SQL statements (C is correct). This is a documented limitation in RPG compilers where SQL preprocessor cannot handle /INCLUDE directives. Options A, B, and D are incorrect - there are functional differences between the directives, both can be conditional, and /INCLUDE can be nested.
-
No difference, they function the same
-
/COPY cannot be used as a conditional directive
-
/INCLUDE files cannot contain embedded SQL
-
Nesting /INCLUDE directives is not allowed
C
Correct answer
Explanation
In RPG programming, /INCLUDE and /COPY directives have specific differences. The key distinction is that /INCLUDE files cannot contain embedded SQL statements (C is correct). This is a documented limitation in RPG compilers where SQL preprocessor cannot handle /INCLUDE directives. Options A, B, and D are incorrect - there are functional differences between the directives, both can be conditional, and /INCLUDE can be nested.
-
No difference, they function the same
-
/COPY cannot be used as a conditional directive
-
/INCLUDE files cannot contain embedded SQL
-
Nesting /INCLUDE directives is not allowed
C
Correct answer
Explanation
In RPG programming, /INCLUDE and /COPY directives have specific differences. The key distinction is that /INCLUDE files cannot contain embedded SQL statements (C is correct). This is a documented limitation in RPG compilers where SQL preprocessor cannot handle /INCLUDE directives. Options A, B, and D are incorrect - there are functional differences between the directives, both can be conditional, and /INCLUDE can be nested.
-
No difference, they function the same
-
/COPY cannot be used as a conditional directive
-
/INCLUDE files cannot contain embedded SQL
-
Nesting /INCLUDE directives is not allowed
C
Correct answer
Explanation
In RPG programming, /INCLUDE and /COPY directives have specific differences. The key distinction is that /INCLUDE files cannot contain embedded SQL statements (C is correct). This is a documented limitation in RPG compilers where SQL preprocessor cannot handle /INCLUDE directives. Options A, B, and D are incorrect - there are functional differences between the directives, both can be conditional, and /INCLUDE can be nested.
-
No difference, they function the same
-
/COPY cannot be used as a conditional directive
-
/INCLUDE files cannot contain embedded SQL
-
Nesting /INCLUDE directives is not allowed
C
Correct answer
Explanation
In RPG programming, /INCLUDE and /COPY directives have specific differences. The key distinction is that /INCLUDE files cannot contain embedded SQL statements (C is correct). This is a documented limitation in RPG compilers where SQL preprocessor cannot handle /INCLUDE directives. Options A, B, and D are incorrect - there are functional differences between the directives, both can be conditional, and /INCLUDE can be nested.
A
Correct answer
Explanation
NUL is a reserved device name in Windows and cannot be used for files or folders. Other reserved names include CON, PRN, AUX, and COM1-9. These names date back to MS-DOS and are reserved for backward compatibility with legacy device drivers. CON1 and AUX1 work fine because they're not exact matches to the reserved names.
-
ls -m
-
ls -mlrt
-
ls -mrt
-
Both A(ls -m) and C(ls -mrt)
D
Correct answer
Explanation
Both ls -m and ls -mrt produce comma-separated output. The -m flag specifically formats output as comma-separated with stream spacing. The -mrt combination includes -m (comma format) with -r (reverse sort) and -t (sort by time). Both produce CSV format, just with different sorting options. Option B's -mlrt combines -m with -l (long format), -r, -t which doesn't make sense as -l and -m are mutually exclusive.
-
The entry is a local socket
-
The entry is a first-in,first-out (FIFO) special file
-
The entry is an ordinary file
-
Purged Permissions
B
Correct answer
Explanation
The permission string 'prwxrwxrwx' indicates a FIFO (first-in, first-out) special file, also known as a named pipe. The first character 'p' identifies the file type as a pipe. FIFOs are used for inter-process communication, where data written to the pipe is read in the same order. This is distinct from regular files (-), directories (d), or sockets (s).
-
1 A device file to represent that the current file system is full
-
2 A device file to test scenarios of testing a /dev/full
-
3 Invalid device
-
4 None
B
Correct answer
Explanation
/dev/full is a special device file that always returns ENOSPC (no space left on device) error when written to, simulating a full disk. It is used for testing how programs handle disk-full scenarios. While option B is circular in wording, it correctly identifies this as a testing device.