Deleting, Copying, Moving, and Renaming files Flashcards

1
Q

What command should we use for removing a file?

A

rm

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

Can we use rm for deleting a directory?

A

Yes, rm -r will work

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

What is cp command for?

A

Copy a file

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

Can you copy multiple files at once with cp?

A

Yes, like this: cp file1 file2 dir

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

Can you copy directories with cp?

A

yes, cp -r source_dir dest_dir

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

What command should we use to move a file or a directory?

A

mv

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

does move works for renaming a file?

A

yes, if the argument provided in destination is a file/directory that already exist it will be rename with the source argument

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

What command should you use to sort the contents of a text file?

A

sort

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

If you want to archive a group of files or directories, what command should we use?

A

tar

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

If you want to zip a file, which command should we use?

A

gzip

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

If you want to unzip a file, which command should we use?

A

gunzip

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

What command should I use for know the disk usage of a file?

A

du (disk usage)

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