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
-
checks for the existence of a file
-
checks for existence of a directory
-
checks for read permission on a file
-
checks for write permission on a file
A
Correct answer
Explanation
The -f test operator checks whether a file exists AND is a regular file (not a directory or device). In shell scripting, [ -f filename ] returns true only if the specified path is an existing regular file.
-
*.idx and *.bat
-
*.idx and *.dat
-
*.che and *.txt
-
*.dat and *.err
B
Correct answer
Explanation
Informatica cache files consist of index files with the .idx extension and data files with the .dat extension.
-
*.idx and *.bat
-
*.idx and *.dat
-
*.che and *.txt
-
*.dat and *.err
B
Correct answer
Explanation
Informatica cache files are created in the cache directory and consist of index files with the .idx extension and data files with the .dat extension.
-
gunzip/expand
-
gzip
-
zip
-
winzip
A
Correct answer
Explanation
gunzip is the standard command to uncompress .gz files, and expand uncompresses files created with the compress command. gzip is for compression (not decompression), zip creates .zip archives, and winzip is not a Unix tool.
-
tar -cvf file/tar -xvf file
-
tar -xvf file /tar -cvf file
-
tar -cvf file.tar <file>/tar -xvf file.tar <file>/
-
tar -xvf file.tar <file>/tar -cvf file.tar <file>/
C
Correct answer
Explanation
To create a tar archive, the syntax is tar -cvf archive.tar. To extract (untar) it, the syntax is tar -xvf archive.tar. Option 510833 correctly represents this pair of commands.
-
Every one can read, group can execute only and the owner can read and write
-
Every one can read and write, but owner alone can execute
-
Every one can read, group including owner can write, owner alone can execute
-
None
C
Correct answer
Explanation
Permission 764 means: owner has 7 (rwx=read+write+execute), group has 6 (rw=read+write), others have 4 (r=read only). So everyone can read, group+owner can write, and only owner can execute.
-
vi -R <filename>
-
vi filename readonly
-
vi -r
-
Not possible
A
Correct answer
Explanation
The -R flag opens vi in read-only mode, preventing accidental modifications. Option B's 'readonly' is not a valid flag syntax, and option C's -r is for recovery mode after a crash. The 'view' command is equivalent to 'vi -R'.
-
Copies file1 to file2
-
Compares file1 and file2 and update file1 with file2 whereever differs
-
Compares file1 and file2 and update file2 with file1 whereever differs
-
None
D
Correct answer
Explanation
The cmp command compares two files byte-by-byte and reports the first location where they differ (with byte and line numbers). It performs read-only comparison and modifies neither file.
-
fsck
-
fsmount
-
mount
-
mountfs
C
Correct answer
Explanation
The mount command attaches a file system to a directory tree, making it accessible. fsck checks file system consistency, fsmount and mountfs are not standard Unix commands. mount is the fundamental utility for mounting file systems.
-
gunzip/expand
-
gzip
-
zip
-
winzip
A
Correct answer
Explanation
gunzip decompresses gzip archives (.gz files) and expand handles compressed files (.Z format). gzip is for compression, zip creates archives, and winzip doesn't exist on Unix systems. Both gunzip and expand are valid decompression tools.
-
tar -cvf file/tar -xvf file
-
tar -xvf file /tar -cvf file
-
tar -cvf file.tar <file>/tar -xvf file.tar <file>/
-
tar -xvf file.tar <file>/tar -cvf file.tar <file>/
C
Correct answer
Explanation
tar -cvf creates archives (c=create, v=verbose, f=file) and tar -xvf extracts them (x=extract). The correct syntax requires specifying the archive filename: tar -cvf archive.tar file(s) to create, tar -xvf archive.tar to extract. Option A and B reverse the create/extract order.
-
Every one can read, group can execute only and the owner can read and write
-
Every one can read and write, but owner alone can execute
-
Every one can read, group including owner can write, owner alone can execute
-
None
C
Correct answer
Explanation
Permission 764 in octal means: Owner (7) = read(4)+write(2)+execute(1), Group (6) = read(4)+write(2), Others (4) = read(4). So everyone can read, owner has full access, and group can read/write. Option C correctly states: everyone can read, group including owner can write, owner alone can execute.
-
sort -d
-
sort
-
sort -r
-
sort -R
C
Correct answer
Explanation
The sort -r command reverses the default ascending order to descending. Without -r, sort arranges lines from smallest to largest (alphabetically or numerically). The -r flag simply inverts this order arrangement.
B
Correct answer
Explanation
In r--r-xrwx, the middle three characters (r-x) represent group permissions. The first r-- is owner (user), and the last rwx is others. Group has read and execute but not write.
-
fsck
-
fsmount
-
mount
-
mountfs
C
Correct answer
Explanation
The mount command is used to attach file systems to the directory tree in Unix/Linux. fsck is for file system checking and repair, not mounting. fsmount and mountfs are not standard Unix/Linux commands.