Workbook 5 Flashcards
What are the three structures associated with every Linux file?
Dentry, Inode, Data. [5/6]
What pieces of metadata are found in an inode?
The files metadata. [5/5]
What is a dentry?
The filename. [5/5]
What character abbreviation does the ls command use to identify (i) a regular file, (ii) a symbolic link, (iii) a directory, (iv) a block device node, (v) a character device node?
Regular Files: - (dash) Symbolic Link: l (lowercase L) Directory: d (lowercase D) Block Device Node: b (lowercase B) Character Device Node: c (lowercase C) [5/6]
What three timestamps are stored in an inode?
atime: Updates whenever the file’s data is read.
ctime: Updates whenever the file’s inode information changes.
mtime: Updates whenever the file’s data changes. [5/8]
When does a file’s atime change?
Updates whenever the file’s data is read. [5/8]
What is the difference between a file’s ctime and mtime?
ctime updates whenever the file’s data is read.
mtime updates whenever the file’s data changes. [5/8]
Where is a file’s creation time stored in Linux?
Linux doesn’t store an initial point of creation time for files. [5/8]
What is the difference between a file’s size and its length?
Length is how large the file is in bytes.
Size is the amount of disk space the file consumes. [5/8]
What two commands display the metadata stored in an inode?
ls and stat [5/9]
What is the difference between the –r and the –R options of the ls command?
- r (lower case): Reverses the sorting order.
- R (upper case): Lists the subdirectories as well. [5/10]
Write a command line that outputs /etc’s contents in order of modification time.
ls /etc -t [5/10]
What does the ls command’s –h and –F options do?
- h: “Human Readable” mode uses abbreviations when reporting file lengths.
- F: Decorates filenames with symbols to indicate file type. [5/10]
Using an ls command option, give a command line that outputs the inode of /etc’s files.
ls /etc -i [5/10]
What is a hard link and why would you create one?
Multiple Dentries are assigned to a single inode as you can exist in two places or have two names. [5/17]
What is a soft (a.k.a. symbolic) link?
Distinct inodes that refer to other files. [5/17]
What does a soft link contain?
A reference to another file to link to.[5/20]
What happens if you only provide 1 argument to the ln command?
the ln command will effectively assume
a last argument of “.”. [5/21]
How can you create a recursive link?
Having two or more links, that all link to each other. [5/22]
When is a hard link appropriate and when is a soft link appropriate?
Soft links can refer to directories while Hard links cannot. More reasons on [5/23]
How do the locate and find commands operate differently?
The locate command uses a database to quickly locate files on the system by filename.
The find command performs a real time, recursive search of the filesystem. [5/55]
Using the locate command, give a command line that lists all .gif files on the system that have fish in their name.
locate “fish.gif” [5/56]
What does the following command line do? find /etc/sysconfig/networking
Prints out all files that have /etc/sysconfig/networking in their path. [5/56]
Give a command line to find all .conf files in /etc
locate /etc/”*.conf” [5/56]