Module 1, Day 4: moving and renaming linux files, directories::cindy: why oS is important Flashcards

1
Q

what command moves and renames files in linux?

A

mv

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

what is the format for using the mv command in linux? rename red_document.txt to blue_document.txt

A

mv red_document.txt blue_document.txt

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

what is the format for using the mv command in linux to move the blue_document.txt to the documents folder?

A

mv blue_document.txt ~/Documents

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

how can I use wildcards in bash to move multiple files at once, just like in Windows? move all _document.txt to Desktop?

A

mv *_document.txt ~/Desktop

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

What action is used in Windows GUI to remove files and directories?

A

right click and delete, file goes to recycle bin,

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

how can you restore files from the recycle bin?

A

go into the bin, right click, restore

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

What happens if you empty your bin?

A

You can’t access the files that were in it to retrieve them.

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

in powerShell, what is the command to remove files and directories?

A

RM, or remove

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

Does remove use the recycle bin?

A

no.

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

how do you remove a whole directory and its files in powershell?

A

rm filename.txt -recurse

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

how do you remove a file in powershell? what is the format for removing a file in the home folder called filename.txt?

A

rm ~\filename.txt

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

How are files protected from the rm command? powershell

A

the rm command has restricted access to certain users.

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

what can you do to protect something from the rm command? powershell

A

mark it as a system file, change permissions

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

What can you do to make rm remove something that is protected from removal? PowerShell

A

you can add the -Force parameter

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

What does adding the force parameter look like with the rm command in PowerShell?

A

rm ~\important_system_file -Force

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

What does it mean if, when you use the rm command with the -Force parameter, it still doesn’t work? PowerShell.

A

you probably don’t have administrator permissions, and you need to go in as admin

17
Q

when will PowerShell ask you to specify what you are doing with the rm command?

A

When you are deleting a directory that has children, and you didn’t specify that you want to recurse.

18
Q

what command removes files or directories in Bash?

A

rm

19
Q

What gives you an error if you try to remove it in Bash?

A

rm

20
Q

How can I use the rm command in Bash to remove the filename.txt file?

A

rm filename.txt

21
Q

How do you remove a directory in Bash?

A

rm -r foldername

22
Q

in Bash, what command can be used to view a list of all files in the home directory?

A

ls -l -a /home

23
Q

what is another way you can use flags in bash?

A

stack them next to each other. as in,
ls -la
rather than
ls -l -a