Outcome 3 Flashcards

(86 cards)

1
Q

What are inodes?

A

Inodes are structures that reference where the data in data blocks live and are referenced by their inode number in an inode table.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What does the command ‘ln’ do by default?

A

‘ln’ creates a hard link by default.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is a hard link?

A

A hard link is a label or name assigned to a file that refers to the same contents as the original file.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

True or False: Hard links can refer to files located on different computers linked by NFS.

A

False

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What happens when you delete a hard link?

A

The file contents will still exist as long as there is one name referencing the file.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is a symbolic link?

A

A symbolic link, or soft link, is a special kind of file that points to another file.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

How do you create a symbolic link?

A

You create a symbolic link using the command ‘ln -s’.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What happens to symbolic links when the target file is deleted?

A

The symbolic links become unusable.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Fill in the blank: Symbolic links are created using the ______ command.

A

ln -s

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is the purpose of the ‘chmod’ command?

A

‘chmod’ is used to change the permissions of a file or directory.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What do the permission bits ‘r’, ‘w’, and ‘x’ stand for?

A

r - read, w - write, x - execute

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What does ‘chmod 777’ do?

A

It gives full permissions (read, write, execute) to the user, group, and others.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

How is octal notation used in changing file permissions?

A

Each permission (read, write, execute) is assigned a number: r=4, w=2, x=1, and the total is used to establish permission.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What is the default permission for an ordinary file?

A

644 (-rw-r–r–)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What does the first ‘-‘ indicate in a permission string?

A

It indicates that the file is an ordinary file.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What does the command ‘chmod a-rwx file3’ result in?

A

It results in no permissions for all: ———-

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

What is the difference between changing permissions using octal notation and symbolic mode?

A

Octal notation uses numbers to set permissions, while symbolic mode uses letters and signs (+, -) to add or remove permissions.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

Fill in the blank: The command ‘chmod g-w,o-w file3’ results in permissions: ______.

A

-rwx r-x r-x

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

What command is used to list files with detailed information?

A

‘ls -l’

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

What does the letter ‘l’ indicate in file permissions?

A

It indicates a symbolic link.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

What does ‘chmod 000 file2’ do?

A

It removes all permissions for the file.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

What command is used to check the contents of a file?

A

‘cat’

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
Q

True or False: Hard links can refer to directories.

A

False

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
24
Q

What command is used to give executable permissions to the group for both files?

A

chmod g+x [file1] [file2]

Replace [file1] and [file2] with the actual file names.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
In symbolic mode, which permission would remove write permissions from the user for both files?
chmod u-w [file1] [file2] ## Footnote Replace [file1] and [file2] with the actual file names.
26
In symbolic mode, which permission would give all permissions to users, group, and others without using the ‘a’ option for both files?
chmod u+rwx,g+rwx,o+rwx [file1] [file2] ## Footnote Replace [file1] and [file2] with the actual file names.
27
In symbolic mode, which permission would remove the read and executable permissions for both the users and others for both files?
chmod u-rx,o-rx [file1] [file2] ## Footnote Replace [file1] and [file2] with the actual file names.
28
In symbolic mode, which permission would remove read permissions from the group and reinstate the executable permission for the others for both files?
chmod g-r,o+x [file1] [file2] ## Footnote Replace [file1] and [file2] with the actual file names.
29
Using octal notation, how do you return all .odt files to the default file permission?
chmod 644 *.odt ## Footnote 644 is the default permission for regular files.
30
What command sorts teams.odt in reverse alphabetical order and redirects the output to a new file called revsorted?
sort -r teams.odt > revsorted ## Footnote The 'sort' command sorts the contents of the file.
31
What command inserts a blank space between Hull and Gillingham in the revsorted file?
sed -i 's/Hull /Hull /' revsorted ## Footnote This uses 'sed' for in-place editing.
32
What is the command mode command used to exit the revsorted file?
:q ## Footnote This command is used in the 'vi' or 'vim' editor.
33
What command is used to display line numbers in the revsorted file?
cat -n revsorted ## Footnote The '-n' option numbers the output lines.
34
What command is used to display line numbers in the revsorted file using a different method?
nl revsorted ## Footnote 'nl' is used to number lines in a file.
35
What is the difference between the outputs of 'cat -n' and 'nl'?
'cat -n' shows line numbers for all lines, while 'nl' only numbers non-empty lines. ## Footnote This can affect files with many blank lines.
36
How do you create a backup of the football directory?
tar -cvf archive.tar football ## Footnote 'tar' is used to create an archive.
37
What command is used to view the contents of archive.tar?
tar -tvf archive.tar ## Footnote The '-t' option lists the contents of the archive.
38
What command deletes the football directory and its contents?
rm -r football ## Footnote The '-r' option allows for recursive deletion.
39
How do you compress archive.tar to create archive.tar.gz?
gzip archive.tar ## Footnote This command compresses the tar file.
40
What command shows the compression ratio for the newly created .gz file?
ls -lh archive.tar.gz ## Footnote This lists the file size and compression ratio.
41
What command is used to uncompress the .gz file?
gunzip archive.tar.gz ## Footnote This command decompresses the gzipped file.
42
How do you restore the football directory from the archive?
tar -xvf archive.tar ## Footnote The '-x' option extracts files from the archive.
43
What command deletes the .tar file?
rm archive.tar ## Footnote This removes the tar file.
44
What is the first partition called in Windows?
C: ## Footnote Windows partitions start with C: for the first partition.
45
What is the naming convention for the first hard drive in Linux?
hda or sda ## Footnote 'hda' is for IDE, 'sda' is for SATA drives.
46
What is the naming convention for the first partition on the first hard drive in Linux?
hda1 or sda1 ## Footnote The first partition follows the drive designation.
47
What is the path to grub.cfg?
/boot/grub/grub.cfg ## Footnote This is the configuration file for GRUB.
48
How does GRUB refer to the first drive?
(hd0) ## Footnote GRUB uses this notation for drives.
49
What is the purpose of a device map file in GRUB?
Maps BIOS drives to OS devices ## Footnote It helps GRUB understand the drive order.
50
How are filesystems typically mounted in Linux?
Using the mount command ## Footnote Filesystems are associated with directories.
51
What command mounts a filesystem as read-only?
mount -o ro [device] [directory] ## Footnote Replace [device] and [directory] with actual values.
52
What is the command to unmount a filesystem?
umount [device] ## Footnote Replace [device] with the actual device name.
53
What does /etc/fstab control?
Access to disk partitions and removable media ## Footnote It defines mount points and options.
54
What does the dump option in /etc/fstab do?
Determines if a filesystem should be backed up ## Footnote A value of zero means it will be ignored.
55
What does the fsck option in /etc/fstab control?
Order of filesystem checks on boot ## Footnote A value of zero means it won't be checked.
56
What command checks a filesystem for errors?
e2fsck [device] ## Footnote Replace [device] with the actual device name.
57
What is a journaling filesystem?
A filesystem that maintains a journal of operations ## Footnote It helps recover from crashes and errors.
58
What are common journaling filesystems in Linux?
* ext3fs * ext4fs * ReiserFS * XFS * JFS ## Footnote Ext3 is an enhanced version of ext2.
59
What is the command used to find information about filesystems?
dumpe2fs [device] ## Footnote Replace [device] with the actual device name.
60
What is the traditional Linux tool for disk partitioning?
fdisk ## Footnote This tool is used for managing disk partitions.
61
What command is used to create a filesystem?
mkfs ## Footnote This command formats a partition with a filesystem.
62
What is swap space in Linux?
A partition treated as an extension of memory ## Footnote It can also be a swap file.
63
What are disk quotas?
Limits on how much disk space a user can consume ## Footnote They help manage disk space in multi-user systems.
64
What command is used to define which partitions to use as swap space?
/etc/fstab
65
What are disk quotas?
Limits enforced by the OS on how many files or how much disk space a single user may consume.
66
What command is used to edit a user's disk quotas?
edquota [username]
67
What command is used to edit a group's disk quotas?
edquota -g [groupname]
68
What can a single user do in a multi-user system that can cause problems for others?
Consume too much disk space
69
What types of files can be defined in terms of shareable vs. unshareable?
Shareable files and unshareable files
70
What are shareable files?
Files that can be stored on one host and used on others.
71
What are unshareable files?
Files that are not shareable, such as device and system files.
72
Why should static and variable files be segregated?
Static files can be stored on read-only media and do not need to be backed up on the same schedule as variable files.
73
What types of files are considered static?
Binaries, libraries, documentation files, and files that do not change without administrator intervention.
74
What is an example of a static and unshareable file?
/boot
75
What types of files are considered variable?
Files that may differ in size from time to time, such as the contents of /var/mail.
76
Who can change the ownership of a file or directory?
Only the root user
77
What command is used to change the ownership of a file?
chown [newowner] [filename]
78
What happens to the group ownership when using chown?
The group ownership may remain unchanged.
79
Fill in the blank: To change ownership to user joe, the command is _______
chown joe /home/joe/memo.txt
80
What is the output of 'ls -l /home/joe/memo.txt' after changing the ownership to joe?
-rw-r--r--. 1 joe root 0 Dec 19 11:23 /home/joe/memo.txt
81
What is the uid of user tommy in the disk quotas example?
25736
82
What does the 'soft' limit in disk quotas represent?
The threshold that a user can temporarily exceed.
83
What does the 'hard' limit in disk quotas represent?
The maximum limit that cannot be exceeded.
84
True or False: The files in user home directories are considered unshareable.
False
85
List three examples of static files.
* Binaries * Libraries * Documentation files
86
List three examples of variable files.
* /var/mail * /var/run * /var/spool/news