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
What does it mean if, when you use the rm command with the -Force parameter, it still doesn’t work? PowerShell.
you probably don’t have administrator permissions, and you need to go in as admin
when will PowerShell ask you to specify what you are doing with the rm command?
When you are deleting a directory that has children, and you didn’t specify that you want to recurse.
what command removes files or directories in Bash?
rm
What gives you an error if you try to remove it in Bash?
rm
How can I use the rm command in Bash to remove the filename.txt file?
rm filename.txt
How do you remove a directory in Bash?
rm -r foldername
in Bash, what command can be used to view a list of all files in the home directory?
ls -l -a /home
what is another way you can use flags in bash?
stack them next to each other. as in,
ls -la
rather than
ls -l -a