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
-
2> filename
-
1> filename
-
&> filename
-
2> /dev/null
A
Correct answer
Explanation
In Unix and Linux shell scripting, file descriptor 2 represents standard error. Using 2> filename redirects error messages to the specified file.
-
rm filename
-
less filename
-
touch filename
-
dl filename
A
Correct answer
Explanation
The rm (remove) command is the standard command-line utility used to delete files and directories in Unix-like operating systems.
-
pico filename
-
cat filename
-
more filename
-
touch filename
D
Correct answer
Explanation
The touch command creates an empty file without opening it for editing. Pico is a text editor that opens files, cat displays file contents to stdout, and more is a pager for viewing files - all of these involve opening or reading the file.
-
App Srv
-
Batch Srv
-
Web Srv
-
File Srv
C
Correct answer
Explanation
Report output files generated by PeopleSoft are stored on the Web Server (PSAPPSRV generates them, but they're served through the web). The Application Server processes requests, Batch Server runs background jobs, and File Server isn't a standard PeopleSoft server component in this context. Web Server handles report distribution and viewing.
-
mcells
-
fragments
-
inodes table
-
cylinder group
C
Correct answer
Explanation
Journaling file systems like JFS and ext3/ext4 maintain an inode table to track file metadata and locations. The journal itself is a circular log that records changes before they're committed to the main file system. Options like 'mcells' and 'fragments' are not standard file system structures, while 'cylinder group' is specific to BSD Unix File System (UFS), not journaling file systems.
-
an ASCII file that contains an entry for each user
-
File which is created and maintained by a server of activity performed by it.
-
short python program that prints the list of all files inside the current directory
-
File which is created and maintained by the operating system
B
Correct answer
Explanation
A log file is a file created and maintained by a server (or application) to record the activities performed by it. Option A describes system-wide user logs, not application logs. Option C is a program, not a log file. Option D describes system-level logs, not server/application logs.
-
It is a file permission that allows the program's text part to stay in swap memory after its execution
-
UNIX don’t have sticky bit
-
It’s a Linux only feature
-
None of above
A
Correct answer
Explanation
Historically, the sticky bit on executable files instructed the operating system to retain the program's text segment in swap memory after execution to speed up subsequent loads.
-
No
-
Yes
-
Yes;using touch command
-
Yes;using time system call
C
Correct answer
Explanation
A file's modification timestamp can be updated in UNIX/Linux systems using the touch command, which updates the access and modification times of a file to the current system time by default.
-
an ASCII file that contains an entry for each user
-
File which is created and maintained by a server of activity performed by it
-
short python program that prints the list of all files inside the current directory
-
File which is created and maintained by the operating system
B
Correct answer
Explanation
A log file is a file automatically created and maintained by a server or application that records events, transactions, and activities performed by it for auditing and troubleshooting.
-
a) Use filelock()
-
b) use lockfile()
-
c) Use lockfd()
-
d) use fcntl()
D
Correct answer
Explanation
fcntl() is the POSIX system call used for advisory and mandatory file locking in Unix/Linux systems. It operates on file descriptors and provides mechanisms like shared and exclusive locks through the F_SETLK and F_SETLKW commands. The other options (filelock(), lockfile(), lockfd()) are not standard POSIX system calls.
-
a) Creates File
-
b) Does nothing
-
c) Return error
-
d) Not allowed.
C
Correct answer
Explanation
When using the open() system call in read-only mode (O_RDONLY) on a file that does not exist, the system cannot create the file and will return an error (setting errno to ENOENT).
-
a) sed 's/[ ][^ ]*$//' test2
-
b) sed 's/[ ][ ]*$//' test2
-
c) sed 's/[ ][ ]*$/' test2
-
d) sed 's/[ ][ $]*$//' test2
A
Correct answer
Explanation
The sed command sed 's/[ ][^ ]*$//' matches a space followed by any non-space characters at the end of a line and removes them, effectively stripping trailing spaces from each line of the file.
-
a) duplicate()
-
b) dup()
-
c) cp()
-
d) mknod()
B
Correct answer
Explanation
dup() is the POSIX system call used to duplicate file descriptors. It creates a new file descriptor that refers to the same open file description as the original, sharing the file offset and status flags. dup2() is a related call that allows specifying the descriptor number. cp() is for file copying, mknod() creates device nodes.
-
list the files
-
check the process status
-
substitute one word with another
-
copy the contents of one file to another
C
Correct answer
Explanation
sed (stream editor) is primarily used for text transformation and substitution. It can search for patterns and replace them with specified text using commands like s/old/new/ to substitute one word or phrase with another.
D
Correct answer
Explanation
Both touch and vi can create files. touch creates an empty file immediately, while vi opens the text editor and creates the file when you save. Since both A and B are valid methods, D (a&b) is correct.