LFCS · Question #664
Which of the following commands can be used to display the inode number of a given file?
The correct answer is B. ls. The ls command can be used to display the inode number of a given file.
Question
Options
- Ainode
- Bls
- Cln
- Dcp
How the community answered
(39 responses)- A3% (1)
- B92% (36)
- D5% (2)
Why each option
The `ls` command can be used to display the inode number of a given file.
`inode` is a filesystem concept representing a data structure that stores information about a file or directory, not a command to display its number.
The `ls` command, when used with the `-i` option (`ls -i`), will display the inode number associated with a file or directory.
The `ln` command is used to create hard or symbolic links to files, it does not display inode numbers.
The `cp` command is used to copy files and directories, not to display their inode numbers.
Concept tested: Displaying file system metadata (inode)
Source: https://linux.die.net/man/1/ls
Topics
Community Discussion
No community discussion yet for this question.