Module 1, Day 4: moving and renaming linux files, directories::cindy: why oS is important Flashcards
what command moves and renames files in linux?
mv
what is the format for using the mv command in linux? rename red_document.txt to blue_document.txt
mv red_document.txt blue_document.txt
what is the format for using the mv command in linux to move the blue_document.txt to the documents folder?
mv blue_document.txt ~/Documents
how can I use wildcards in bash to move multiple files at once, just like in Windows? move all _document.txt to Desktop?
mv *_document.txt ~/Desktop
What action is used in Windows GUI to remove files and directories?
right click and delete, file goes to recycle bin,
how can you restore files from the recycle bin?
go into the bin, right click, restore
What happens if you empty your bin?
You can’t access the files that were in it to retrieve them.
in powerShell, what is the command to remove files and directories?
RM, or remove
Does remove use the recycle bin?
no.
how do you remove a whole directory and its files in powershell?
rm filename.txt -recurse
how do you remove a file in powershell? what is the format for removing a file in the home folder called filename.txt?
rm ~\filename.txt
How are files protected from the rm command? powershell
the rm command has restricted access to certain users.
what can you do to protect something from the rm command? powershell
mark it as a system file, change permissions
What can you do to make rm remove something that is protected from removal? PowerShell
you can add the -Force parameter
What does adding the force parameter look like with the rm command in PowerShell?
rm ~\important_system_file -Force