Linux Fundamentals PT1 Flashcards

(28 cards)

1
Q

What is the general syntax of a Linux command?

A

command [options] [arguments]

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

What does ‘cd’ command do?

A

Changes the current directory

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

What does ‘pwd’ show?

A

Prints the current working directory

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

What does ‘ls’ do?

A

Lists files and directories

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

How do you create a directory?

A

mkdir <directory_name></directory_name>

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

How do you create an empty file?

A

touch <file_name></file_name>

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

How do you copy a file?

A

cp <source></source> <destination></destination>

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

How do you move/rename a file?

A

mv <source></source> <destination></destination>

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

How do you delete a file?

A

rm <file_name></file_name>

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

How do you delete a directory?

A

rm -r <directory_name></directory_name>

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

What are the permission characters in ‘ls -l’?

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 are the user types in file permissions?

A

u (user), g (group), o (others), a (all)

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

How do you change file permissions using letters?

A

chmod u+x file

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

What is the numeric format for full permissions?

A

chmod 777 file

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

How to change file ownership?

A

chown user file

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

How to change group ownership?

A

chown :group file

17
Q

How to change user and group at once?

A

chown user:group file

18
Q

How do you get help for a command?

A

man <command></command>

19
Q

What does ‘–help’ do?

A

Displays basic help for a command

20
Q

What is the use of ‘info’ command?

A

Displays detailed documentation

21
Q

What does Tab do in the shell?

A

Auto-completes file or command names

22
Q

How do you add text to a file (overwrite)?

A

echo ‘text’ > file

23
Q

How do you append text to a file?

A

echo ‘text’&raquo_space; file

24
Q

What does ‘>’ do in Linux?

A

Redirects output to a file (overwrite)

25
What does '>>' do?
Appends output to a file
26
What does '<' do?
Takes input from a file
27
What does 'tee' do?
Reads from stdin and writes to file and stdout
28
What is the pipe '|' used for?
Passes output of one command as input to another