module 1, day 3: windows make directories in gui and cli) through windows moving a renaming files, directories Flashcards
How to make a new directory (folder) in the GUI Windows?
right click, new, folder
making a folder in the CLI Windows?
mkdir (name)
making a folder that you want to have spaces instead of underscores with the cli, but just adding spaces between the letters rather than specifying that you are not adding a parameter, will lead to what error? PowerShell
“a positional parameter cannot be found that accepts argument” The system will read the words as parameters.
How do you specify that a folder name with spaces is one single thing? PowerShell
Surround the name with quotes,
mkdir ‘my cool folder’
Use back ticks, escaping characters,
mkdir my cool
folder`, with the backticks telling the shell the space after the back tick is part of our filename.
what do escape characters mean?
the next character after the back tick, or other relevant escape character, should be treated literally
what command is used to make a new directory in Bash?
mkdir
how do you escape characters in Bash?
\
how can you encompass a file name you want to put spaces in in Bash?
quotes around the file name
what happens when you enter a command in PowerShell?
it gets saved in memory and added to a file.
Where are past recently used commands in PowerShell stored?
history
What does the simple use of history do in PowerShell?
displays a list of commands you entered earlier
How do you scroll through commands you see with history? PowerShell
up or down keys on the keyboard
what does using up and down keys on the PowerShell do?
rotates through the last commands used, which makes it easier to repeat commands and make small modifications to them.
What is ctrl-r in PowerShell?
the history shortcut. it’ll bring you down to another line, and then you can search for commands in history and it will show you matches. typing enter will input the command.
what is an alternate command to ctrl r in powershell’s older versions/
hash, followed by some part of your previous command, and then use tab completion to cycle through items in history.
How do you use the clear command in PowerShell?
to clear the output on your screen, input into the command line.
what is the history command in linux?
history
What can I use on the command line to cycle through previous commands in linux?
up and down arrow keys
what searches history in linux, alternative to history command?
ctrl r
what is the linux clear command?
clear
How to copy files and directories in Windows Gui?
right click the folder, copy, paste.
hotkeys to copy a folder in windows gui
ctrl-c and ctrl-v
define hotkey
a keyboard shortcut that does some kind of task
Powershell command for copy.
cp. Also need to add the file you need to copy and the path you want to copy it to.
What can help you copy multiple files at once? powrshell
wildcard
What is a character used to help select files based on a certain pattern?
Wildcard
how to get all jpegs and copy somewhere
go into the right directory, cp *.jpg, and then the path you want to copy the files to.
how to use the wildcard? What symbol? means all in powershell, for selecting directories.
*
what are you telling PowerShell when you put
cp *.jpg?
to copy all .jpg files
how to copy a folder to Desktop? Doesn’t copy the contents of the folder, just the folder.
go to the right directory,
cp ‘name of directory’ and list the file path you want it sent in.
ex:
cp ‘bird pictures’ ~\Desktop
what command parameter do you need to use to copy the contents of a directory as well as the directory itself?
-Recurse
What command parameter lists the contents of the directory?
Recurse
what is another word for recurse?
repeat
What happens if you recurse a directory?
it’ll list the contents, and if there are any subdirectories in the listing, it’ll recurse, repeating the directory listing process for each of those subdirectories.
What do you use with copy to copy the contents of a directory?
-Recurse parameter, with cp
What parameter, with cp in powershell, makes it so that copy doesn’t output anything to the CLI by default unless there are errors?
-Verbose
What happens in powershell when you use copy -Verbose?
it’ll output one line for each file of the directory being copied.
how to copy the file ‘bird pictures’ and its contents? to the desktop using PowerShell
cp ‘bird pictures’ ~\Desktop -Recurse -Verbose
how do you copy files in bash?
cp filename ~path
how to copy multiple files of the same type? Bash .png files, for example, to the desktop
cp *.png ~/Desktop
how to recursively copy a directory in Bash?
-r is the flag
how to copy cat pictures folder to a desktop
cp -r ‘cat pictures’ ~/Desktop
how to rename file in gui windows?
double click, rename
how to rename file PowrShell
mv command
what does mv stand for?
move item
how to move a file Windows PowrShell, without changing directory it is in
change blue_document.txt to yellow_document.txt
mv blue_document.txt yellow_document.txt
when you type it in, with tab completion, it’ll automatically add the .\ at the front, to signify that you are working in the current directory.
this is optional.
bare minimum:
mv blue_document.txt yellow_document.txt
what command lets us move files from one directory to another PowerShell?
mv
how to mv a document? move yellow_document.txt, which is currently in the directory we are in, from Desktop to the Documents directory
mv .\yellow_document.txt ~\Documents
you can move multiple files using what?
wildcards
how do you move multiple files using wildcards with the mv command? move all document.txt files.
mv *_document.txt ~\Documents
with the cp command, where do you put the -r flag if you are copying a file?
it goes after cp. It’s the second thing. Then you get the ‘directoryname’ and then you get ‘location name’