Terminal Flashcards
Shortcut to open up terminal on the mac?
CMD + Space
pwd
Printing Work Directory
ls
list files
cd ..
traverse to parent folder
cd /
root directory of computer
cd ~
root directory of current user
mkdir
will make a new directory, whatever argument you pass into this command will be the name of your new file.
rmdir
will try to delete a folder, but if there are files you’ll get an error
instead rm -rf where r stands for recursive, which is saying continue the remove function for all files and folders inside this directory. the f stands for force, the delete will happen regardless of permissions.
so empty folder:
rmdir [folder name]
non-empty folder:
rm -rf [folder name]
touch
creates a new, empty file with the nane and extension type that you specify.
rm
rm [file name]
Y for yes, and N for no
mv
two uses. firt you can rename a file by first providing the file’s name and then providing what you want the file to be renamed to. or move
mv renamedFile.html ../renamedFile.html
cp
The cp command will copy a file into the current directory with the new name you provide
cp -rf to copy a file folder recursively