Unix/Linux Flashcards

1
Q

What is a command to change directory to directory name?

A

cd directory_name

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

What is a command to change permissions?

A

chmod [permissions] [file/directory]

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

What is a command to copy?

A

cp [options] source_file destination

cp -r directory_name destination/

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

What is a command to display information about file type?

A

file [filename]

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

What is a command to search files?

A

find search_path -name filename

grep “hello” *.txt

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

What is a command to create a new directory?

A

mkdir directory_name

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

What is a command to move a file to a different location?

A

mv file_name directory_name

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

What is a command to remove a file?

A

rm example.txt

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

What is a command to remove a directory?

A

rm -rf my_folder

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

What is vi?

A

Visual editor is a command-line editor that allows users to create, edit, and manipulate text files.

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

How to save changes in vi editor?

A

:w
:wq - save and quit
:q! - quit without saving

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