Home »
Aptitude Questions and Answers »
Linux Aptitude Questions and Answers
Linux File Commands Aptitude Questions and Answers
Linux File Commands Aptitude Questions and Answers: This section contains aptitude questions and answers on Linux File Commands.
Submitted by Nidhi, on May 20, 2020
This section contains Aptitude Questions and Answers on Linux File Commands.
1) There are the following statements that are given below, which of them are correct about files in Linux?
- The file can be a text, image, audio, and video file.
- A device is also represented as a file in the Linux operating system.
- A directory is also a file.
- Disk partitions are also represented as a file.
Options:
- A and B
- A and C
- A, B, C, and D
- B, C, and D
Correct answer: 3
A, B, C, and D
All given statements are correct about files in Linux Operating System.
2) There are the following statements that are given below, which of them are correct types of files in Linux?
- Executable file
- Device file
- Named pipe file
- Block file
Options:
- A and B
- C and D
- A, B, and C
- A, B, C, and D
Correct answer: 4
A, B, C, and D
All given options are the correct types of files.
3) There are the following statements that are given below, which of them are correct about the Linux File System?
- File System is a layer in the Linux operating system, which is used to control the management of storage data.
- It provides the arrangement of files in the disk storage.
- It is used to manage information about files like name, size, creation, and modification time.
- Linux File System is the software that runs only on Intel architecture.
Options:
- A and B
- C and D
- A, B, and C
- A, B, C, and D
Correct answer: 3
A, B, and C
Statements A, B, and C are correct about the Linux File System.
4) Can we create a file in the Linux operating system without any file extension?
- Yes
- No
Correct answer: 1
Yes
Yes, we can create files in Linux without any extension.
5) In the Linux File System, what is used to separate components of paths?
- Forward Slash ('/')
- Backward Slash ('\')
Correct answer: 1
Forward Slash ('/')
In the Linux File System, the forward slash is used to separate components of a path, like "/home/user/".
6) In Linux File System, which symbol is used before filename in case of hidden files?
- #
- $
- Dot (.)
- @
Correct answer: 3
Dot (.)
The dot (.) is used before filename in hidden files.
7) What are the correct types of file systems used in the Linux operating system?
- Ext3
- Ext4
- JFS
- XFS
Options:
- A and B
- C and D
- A, B, and C
- A, B, C, and D
Correct answer: 4
A, B, C, and D
All given options are the correct types of Linux File System.
8) What is the full form of JFS?
- Just File System
- Journaled File System
- Joint File System
- Joker File System
Correct answer: 2
Journaled File System
The "JFS" stands for "Journaled File System".
9) There are the following statements that are given below, which of them are correct about Btrfs File System in Linux?
- This file system does not use for production purposes.
- It is used for fault tolerance.
- It is used for extensive storage configuration.
- It is used the extended version of JFS.
Options:
- A and B
- C and D
- A, B, and C
- A, B, C, and D
Correct answer: 3
A, B, and C
Statements A, B, and C are correct about Btrfs File System.
10) Which of the following commands are used to create files in the Linux Operating System?
- cat
- echo
- touch
- printf
Options:
- A and B
- C and D
- A, B, and C
- A, B, C, and D
Correct answer: 4
A, B, C, and D
All given commands are used to create files in the Linux Operating System.
11) There are the following statements that are given below, which of them are correct about touch command in Linux?
- It is used to create empty files.
- It is used to update the timestamp of the existing file.
- It is used to write formatted data into the file.
- It is used to view the content of the file.
Options:
- A and B
- B and C
- A, B, and C
- A, B, C, and D
Correct answer: 1
A and B
Statements A and B are correct about touch command.
12) What are the popular editors are used in the Linux operating system?
- Vi
- Vim
- Gedit
- Nano
Options:
- A and B
- C and D
- A, B, and C
- A, B, C, and D
Correct answer: 4
A, B, C, and D
All given options are popular editors are used in the Linux operating system.
13) Which command is used to check the type of file?
- type
- file
- filetype
- filetypes
Correct answer: 2
file
The file command is used to check the type of files.
14) Which exact command is used to change the only modification time of a file in the Linux operating system?
- touch -m
- touch -k
- touch -p
- touch –l
Correct answer: 1
touch -m
The touch -m is used to change the only modification time of a file in the Linux operating system.
15) Which command is used to check the access and modification time of a file in Linux?
- check
- filetimes
- state
- file
Correct answer: 3
state
The state command is used to check the access and modification time of a file in Linux.
16) Which of the following redirection operator is used to append the content in a file?
- >
- <
- >>
- <>
Correct answer: 3
>>
The >> operator is used to append the content in a file.
17) Which command is used to print file content in reverse order line wise, it means, the last line will print first and then print the second last line and so on?
- reverse
- tac
- cat
- gedit
Correct answer: 2
tac
The tac command is used to print file content in reverse order line wise.
18) Which command is used to view the specified lines from the start of a file?
- start
- head
- beg
- first
Correct answer: 2
head
The head command is used to view the specified lines from the start of a file.
19) By default, how many last lines shown by tail command?
- 5
- 8
- 10
- 12
Correct answer: 3
10
By default, the tail command is used to display 10 last lines of a file.
20) Which of the following commands are used to view the content of file screen wise?
- more
- less
- cat
- tac
Options:
- A and B
- C and D
- A and C
- B and C
Correct answer: 1
A and B
The more and less command is used to view the content of file screen wise, because if the file is large, the scroll bar is used in case of cat command.
21) Which command is used to remove a file?
- remove
- rm
- rmfile
- delete
Correct answer: 2
rm
The rm command is used to remove the file.
22) Which command is used to rename a file?
- rename
- ren
- name
- None of the above
Correct answer: 1
rename
The rename command is used to rename the file.
23) Which command is used to copy a file from one location to another location?
- copy
- copyfile
- cp
- None of the above
Correct answer: 3
cp
The cp command is used to copy a file from one location to another location.
24) Which command is used to cut a file from one location and paste to the other location?
- cut
- ct
- move
- mv
Correct answer: 4
mv
The mv command is used to cut a file from one location and paste it to the other location.
25) Sometimes can we use the mv command to rename a file or directory?
- Yes
- No
Correct answer: 1
Yes
Yes, it can be done.