# Terminal Quick Commands (for OSX) ###### tags: `unix` `osx` ### List files in directory `ls -la` or `la` as shorthand ### Copying/cutting files secure copy a single file (secure for ssh) ```scp file.txt root@165.22.103.122:/mnt/mc_volume``` secure copy an entire directory (requires recursive -r) ```scp -r dirname root@165.22.103.122:/mnt/mc_volume``` secure copy everything inside a directory ```scp dirname/* root@165.22.103.122:/mnt/mc_volume``` (the colon is required by the :/mnt because reasons) cut and pasting a file from another directory ```mv Documents/random/blondhair.jpg Documents/hairstyles``` cut + pasting a file in that directory ```mv blondhair.jpg ../hairstyles``` ### Renaming files mv can also be used to rename files/folders, given that the name you're giving it doesn't already exist in the folder rename a file ```mv oldname newname``` rename a folder ```mv -r olddirname newdirname``` ### Viewing files/inside folders View data folder in a docker container (itzg/mc-server) ```docker exec -it containername /bin/bash``` Go to directory (cd dirname) and view all top-down view ``` cd dirname ls -la ``` (-la shows hidden files) Viewing folders from another directory ```ls -la /Documents/dirname``` Same thing, but a folder that's one directory back ``` ls -la ../dirname``` viewing from *two* directories back (insert more ../'s to go back more directories) ``` ls -la ../../dirname``` ### Finding and deleting files of a specific type lists all of that file type in your current folder (replace jpg with jar, png, etc.) `find . -name "*.jpg" -type f` deletes all of that file type `find . -name "*.bak" -type f -delete` #### Unzipping files `unzip filename.zip` ### Misc Ping a website `curl websitename.com`