Module 4 Flashcards

1
Q

What command was given to change the permission to the file below? (Select two)

[before] -rw-rw-r–. 1 user1 user1 5494 Oct 11 14:20 file1

[after] -rwxr-xr–. 1 user1 user1 5494 Oct 11 14:20 file1

  • chmod 664 file1
  • chmod 754 file1
  • chmod u+x,g+x-w file1
  • chmod u=rwx,g=rx,o=x file1
A
  • chmod 754 file1

- chmod u+x,g+x-w file1

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

cp command will fail if you try to copy a directory unless you specify the -r option.

  • True
  • False
A

True

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

Which command is used to find the directories under user1’s home directory?

  • find ~user1 -name directories
  • find directories ~user1
  • find -type d ~user1
  • find ~user1 -type d
A

find ~user1 -type d

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

Directories have inodes, but they do not have their own data blocks.

  • True
  • False
A

False

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

What can other members do to the directory “Heros”?

drwxr-xr–. 2 user1 user1 4096 Oct 2 13:32 Heros

  • List the content of the directory
  • Add or remove files to and from the directory
  • Enter the directory
  • Nothing
A

Nothing

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

What can the group members do to the directory “Heros”? (Select two)

drwxr-xr–. 2 user1 4096 Oct 2 13:32 Heros

  • List the content of the directory
  • Add or remove files to and from the directory
  • Enter the directory
  • Nothing
A

List the content of the directory

Enter the directory

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

Which one describes a hard link?

  • A separate data block exists for a hard link
  • The target file can be on a different partition
  • Share the inode of the target file
  • Deleting the target file will make the linked file dysfunctional
A

Share the inode of the target file

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

Find the match.

  • /etc
  • /var
  • /dev
  • /usr/bin
A

/etc configuration files

/var log files and spool

/dev device files

/usr/bin Linux commands used by all users

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

Which command is used to find the location of a file? (Select three)

  • find
  • locate
  • which
  • where
A

find

locate

which

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

What can user1 do to “file1”? (Select two)

-rw-r—x. 1 user1 user1 5494 Oct 2 12:57 file1

  • Open and read the content of the file
  • Open, read, and edit the content of the file
  • Execute the file
  • Nothing
A

Open and read the content of the file

Open, read, and edit the content of the file

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

When applied to a directory, the SGID special permission____________________.

  • causes all new files created in the directory to have the same group
  • membership as the directory and not the entity that created them.
  • cannot be used, because it is applied only to files.
  • allows users the ability to use more than two groups for files that they create within the directory.
  • causes users to have their permissions checked before they are allowed to access files in the directory.
A

causes all new files created in the directory to have the same group

membership as the directory and not the entity that created them

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

You noticed a file in your home directory that has a + symbol appended to the mode. What does this indicate?

  • Special permissions have been set on the file.
  • The file has one or more files on the filesystem that are hard linked to it.
  • The sticky bit directory permission has been set on the file, and will remain inactive as a result.
  • Additional entries exist within the ACL of the file that can be viewed using the getfacl command.
A

Additional entries exist within the ACL of the file that can be viewed using the getfacl command.

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

Which of the following commands will change the user ownership and group ownership of file1 to user1 and root, respectively?

  • chown user1:root file1
  • chown user1 : root file1
  • This cannot be done because user and group ownership properties of a file must be modified separately.
  • chown root:user1 file1
  • chown root : user1 file1
A

chown user1:root file1

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

When you change the data in a file that is hard-linked to three others, __________.

  • only the data in the file you modified is affected
  • only the data in the file you modified and any hard linked files in the same directory are affected
  • the data in the file you modified and the data in all hard linked files are modified because they have different inodes
  • the data in the file you modified as well as the data in all hard-linked files are modified because they share the same data and all have the same inode and file size
A

the data in the file you modified as well as the data in all hard-linked files are modified because they share the same data and all have the same inode and file size

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

Which command do you use to rename files and directories?

  • cp
  • mv
  • rn
  • rename
A

mv

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

What are the three standard Linux permissions?

  • full control, read-execute, write
  • read, write, modify
  • execute, read, write
  • read, write, examine
A

execute, read, write

17
Q

After typing the command umask 731, the permissions on all subsequently created files and directories will be effected. In this case, what will be the permissions on all new files?

  • rw-rw-rw-
  • rwxrw-r–
  • —r–rw-
  • —-wx–x
A

—r–rw-

18
Q

The default permissions given by the system prior to analyzing the umask are ___________for directories and __________ for files.

  • rw-rw-rw- and rw-rw-rw-
  • rw-rw-rw- and r–r–r–
  • rw-rw-rw- and rwxrwxrwx
  • rwxrwxrwx and rw-rw-rw-
  • rwxrw-rw- and rwx-rw-rw-
A

rwxrwxrwx and rw-rw-rw-

19
Q

What must a user do to run cp or mv interactively and be asked whether to overwrite an existing file? (mark all that apply)

  • There is no choice as the new file will overwrite the old one by default.
  • Type interactive cp or interactive mv.
  • Type cp -i or mv -i.
  • Type cp –interactive or mv - interactive.
  • Just type cp or mv as they run in interactive mode by default.
A

Type cp -i or mv -i.

20
Q

Given the following output from the ls command, how many other files are linked with file1?

drwxr-xr-x 3 root root 4096 Apr 8 07:12 Desktop

  • rw-r–r– 3 root root 282 Apr 29 22:06 file1
  • rw-r–r– 1 root root 282 Apr 29 22:06 file2
  • rw-r–r– 4 root root 282 Apr 29 22:06 file3
  • rw-r–r– 2 root root 282 Apr 29 22:06 file4
  • rw-r–r– 1 root root 282 Apr 29 22:06 file5
  • rw-r–r– 1 user1 sys 282 Apr 29 22:06 file6
A

two