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
B
Correct answer
Explanation
Unix permission strings like r--r-xrwx are divided into three sets of three characters: first three (r--) for owner (read only), middle three (r-x) for group (read and execute), and last three (rwx) for others (read, write, execute). The group permissions are r-x.
-
gunzip/expand
-
gzip
-
zip
-
winzip
A
Correct answer
Explanation
The gunzip command decompresses files compressed with gzip (.gz extension), and expand decompresses files compressed with the compress utility (.Z extension). These are the standard Unix tools for uncompressing files. gzip and zip are compression tools, while winzip is a Windows-specific program.
-
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 an archive (create, verbose, file), while tar -xvf extracts (extract, verbose, file). The syntax requires naming the .tar archive file explicitly before listing files to add. Options A and B show incorrect syntax - they reference 'file' inconsistently and omit the .tar extension or use forward slashes incorrectly.
-
fsck
-
fsmount
-
mount
-
mountfs
C
Correct answer
Explanation
The mount command is used to attach a filesystem to a directory tree, making it accessible. fsck is for filesystem checking, fsmount and mountfs are not standard Linux commands.
-
executable, text, documents, directories
-
directories, scripts, executables, normal files
-
Normal files, special files, hidden files, device files
-
ordinary files, directories, symbolic links, block and character device files
D
Correct answer
Explanation
Linux has four fundamental file types: ordinary files (regular data), directories (folders), symbolic links (pointers to other files), and device files (block and character special files for hardware devices). The other options mix concepts incorrectly or omit special files.
-
SQL Process Used File Input.
-
SQL Processing Using Format Input
-
SQL Processing Using File Input
-
SQL Processing Using File Information.
C
Correct answer
Explanation
SPUFI (SQL Processing Using File Input) is an IBM DB2 tool that allows users to execute SQL statements by providing them in an input file. It's a mainframe DB2 utility for running SQL queries from file input rather than interactive input.
-
lseek(), open(), write(), close()
-
open(), write(), lseek(), close()
-
open(), lseek(), open(), , write() close()
-
None
B
Correct answer
Explanation
To perform file operations, a file must first be opened using open(). Once open, you can write data to it using write(), reposition the file offset using lseek(), and finally release the file descriptor using close().
-
Its not possible
-
use isused() function
-
Try to open file with locking enabled
-
Try to write the file after opening
C
Correct answer
Explanation
To detect if a file is already open by another process, the standard approach is to attempt opening it with file locking enabled. If the lock fails, another process likely has it open. Options A, B, and D are incorrect - there's no standard isused() function, and writing after opening doesn't detect existing locks.
-
Use filelock()
-
use lockfile()
-
Use lockfd()
-
use fcntl()
D
Correct answer
Explanation
File locking in Unix/Linux is typically done using fcntl() system call with F_SETLK or F_SETLCK commands. Options A, B, and C refer to non-standard functions. The fcntl() system call is the POSIX-standard method for advisory file locking.
-
Use ls -l
-
Use sizeof()
-
Use filesize()
-
Use fstat()
D
Correct answer
Explanation
The fstat() system call retrieves status information about an open file descriptor, including its size in bytes, which is stored in the st_size field of the stat structure.
-
duplicate()
-
dup()
-
cp()
-
mknod()
B
Correct answer
Explanation
The dup() system call duplicates an open file descriptor, returning a new descriptor that refers to the same open file description.
-
The process file name of init
-
The proc file name of RAM
-
Invalid file
-
The core dump file
B
Correct answer
Explanation
/proc/kcore is a file in the /proc filesystem that represents the system's physical RAM in core dump format. It provides a virtual view of the entire system memory, similar to how a core dump captures process memory. Options A and D are incorrect because /proc/kcore is not related to the init process or individual program core dumps.
-
Resolve by update PATH variable
-
Resolve by setting SHELLPATH variable
-
Resolve by updating LD_LIBRARY_PATH
-
Resolve by setting LIBRARY_PATH variable
C
Correct answer
Explanation
The error indicates the dynamic linker cannot find a required shared library at runtime. The LD_LIBRARY_PATH environment variable tells the dynamic linker where to search for shared libraries beyond the default paths. Options A, B, and D are incorrect: PATH is for executables, SHELLPATH doesn't exist for this purpose, and LIBRARY_PATH is used at compile time, not runtime.
-
A core file is created when a program terminates unexpectedly, due to a bug,
-
A core represents the RAM memory (core)
-
core file contains the entire process information
-
A text file
A
Correct answer
Explanation
A core file is generated when a program crashes abnormally due to signals like SIGSEGV, SIGABRT, or SIGBUS. It contains the process's memory image at the time of the crash for debugging purposes. Option B is incorrect because /proc/kcore represents RAM, not individual core files. Option C is too broad and option D is simply wrong.
-
sed 's/[ ][^ ]*$//' test2
-
sed 's/[ ][ ]*$//' test2
-
sed 's/[ ][ ]*$/' test2
-
sed 's/[ ][ $]*$//' test2