File and Directory Management Flashcards

1
Q

How do you list directory contents and what are the available options to go along with this command?

A

ls
-a to show all files including hidden ones
-l to use long listing format

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

How do you print the current working directory?

A

pwd

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

How do you change the working directory?

A

cd
- current working directory .
- the parent directory ..
- the previous working directory -
- the users home directory tilda

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

How do you concatenate files and print output?

A

cat

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

What command for visual display editor that can also be used to create files?

A

vi

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

Change the timestamp for existing files or create new files?

A

touch

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

Command to create a directory/ies if they do not already exist?

A

mkdir
-p option will create parent directories as needed

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

Command to copy files and directories

A

cp
-r/-R option is used to copy directories recursively

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

Command to move or rename files

A

mv

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

remove files or directories

A

rm
-r/-R option removes directories and their contents recursively.
-f option removes the prompt when deleting files or directories

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

rmdir

A

Remove empty directories

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

How to show all files long list option and hidden files?

A

ls -al

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

Show syntax for copying testfile to a new testfile2

A

cp testfile testfile2

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

Change the name of testfile1 to testfile4

A

mv testfile1 testfile4

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

Create two new files test01 and test02

A

touch test01 test02

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

Create a new directory

A

mkdir storage