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

Multiple choice technology operating systems
  1. cat *.txt -length=10

  2. disp 10 .txt

  3. head -10 *.txt

  4. print 10 *.txt

Reveal answer Fill a bubble to check yourself
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.

Multiple choice technology operating systems
  1. ren FILE1 FILE2 - i

  2. ren FILE1 FILE2

  3. cp FILE1 FILE2

  4. mv FILE1 FILE2

Reveal answer Fill a bubble to check yourself
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.

Multiple choice technology operating systems
  1. fchmode()

  2. fchmod()

  3. chmod()

  4. All the above.

Reveal answer Fill a bubble to check yourself
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.

Multiple choice technology programming languages
  1. A. FORDER IF E DISK

  2. B. FORDER IPE F 41 DISK

  3. C. FORDER IF E 41 DISK

  4. D. FORDER IF F DISK

Reveal answer Fill a bubble to check yourself
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).

Multiple choice technology programming languages
  1. No difference, they function the same

  2. /COPY cannot be used as a conditional directive

  3. /INCLUDE files cannot contain embedded SQL

  4. Nesting /INCLUDE directives is not allowed

Reveal answer Fill a bubble to check yourself
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.

Multiple choice technology programming languages
  1. No difference, they function the same

  2. /COPY cannot be used as a conditional directive

  3. /INCLUDE files cannot contain embedded SQL

  4. Nesting /INCLUDE directives is not allowed

Reveal answer Fill a bubble to check yourself
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.

Multiple choice technology programming languages
  1. No difference, they function the same

  2. /COPY cannot be used as a conditional directive

  3. /INCLUDE files cannot contain embedded SQL

  4. Nesting /INCLUDE directives is not allowed

Reveal answer Fill a bubble to check yourself
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.

Multiple choice technology programming languages
  1. No difference, they function the same

  2. /COPY cannot be used as a conditional directive

  3. /INCLUDE files cannot contain embedded SQL

  4. Nesting /INCLUDE directives is not allowed

Reveal answer Fill a bubble to check yourself
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.

Multiple choice technology programming languages
  1. No difference, they function the same

  2. /COPY cannot be used as a conditional directive

  3. /INCLUDE files cannot contain embedded SQL

  4. Nesting /INCLUDE directives is not allowed

Reveal answer Fill a bubble to check yourself
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.

Multiple choice technology programming languages
  1. No difference, they function the same

  2. /COPY cannot be used as a conditional directive

  3. /INCLUDE files cannot contain embedded SQL

  4. Nesting /INCLUDE directives is not allowed

Reveal answer Fill a bubble to check yourself
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.

Multiple choice technology operating systems
  1. NUL

  2. CON1

  3. AUX1

  4. REG

Reveal answer Fill a bubble to check yourself
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.

Multiple choice technology operating systems
  1. ls -m

  2. ls -mlrt

  3. ls -mrt

  4. Both A(ls -m) and C(ls -mrt)

Reveal answer Fill a bubble to check yourself
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.

Multiple choice technology operating systems
  1. The entry is a local socket

  2. The entry is a first-in,first-out (FIFO) special file

  3. The entry is an ordinary file

  4. Purged Permissions

Reveal answer Fill a bubble to check yourself
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).

Multiple choice technology operating systems
  1. 1 A device file to represent that the current file system is full

  2. 2 A device file to test scenarios of testing a /dev/full

  3. 3 Invalid device

  4. 4 None

Reveal answer Fill a bubble to check yourself
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.