Working with the File System and Permissions Flashcards

1
Q

Which command is used to print any human-readable strings from a file to the terminal?

A

strings {file}

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

How to create a copy of a file?

A

cp {file} {nameOfTheFileCopy}

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

How to determine what file type is a certain file?

A

file {file}

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

How to sort a file alphabetically and remove duplicate adjacent lines?

A

sort -u

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

How to sort a file alphabetically in a reverse order?

A

sort -r

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

How to sort a file alphabetically?

A

sort

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

How to push the entire file to the screen and reverse the order of items in the file?

A

tac

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

How to push the entire file to the screen?

A

cat

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

How to display information about files/directories in a directory?

A

ls -l

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

How to display content of a directory including hidden files?

A

ls -a

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

How to delete a non-empty directory?

A

rm -r {dirName}

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

How to delete an empty directory?

A

rmdir

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

How to create a directory?

A

mkdir {directory}

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

Which command is used to view permissions in the terminal?

A

ls -l

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

Expalain -rwxrw-r--

A
  • - indicates the type of file (e.g., - for a regular file, d for a directory)
  • rwx show the permissions for the user
  • rw- show the permissions for the group
  • r-- show the permissions for others
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Which command is used to change file permissions?

A

chmod

17
Q

What are the 2 different ways of chaning permissions?

A
  • Symbolic Mode
    • modify permissions using symbols to represent the user category and the action you want to take
  • Numeric (Octal) Mode
    • each permission type is assigned a number: read (4), write (2), and execute (1)
    • numbers are summed up for each user category (user, group, others)
18
Q

In Symbolic Mode, what character is used to add a permission?

A

+

19
Q

In Symbolic Mode, what character is used to remove a permission?

A

-

20
Q

In Symbolic Mode, what character is used to set exact permissions and override existing ones?

A

=