I know I said my next post would be about XML, but I wanted to go ahead and share this cool thing I just learned about Unix and using my terminal on my MacBook Pro, as well as some basic refresher points.
I never knew about "shift-command-4". When you press these keys, a little circle with a cross in the middle (it kind of looks like a compass) appears where your mouse pointer is on the screen. If you position that "compass" to the top left of a picture you want to create (from another image) and then hold the mouse down and drag it to the bottom right corner of the image and then release the mouse, that image you just outlined will be saved to your desktop! Pretty cool huh?
2. Four different ways of naming files
So there are four different ways of naming files CORRECTLY. I say correctly because if you are like me, naming files on your computer the same way you would write it out on paper makes sense right? Well...not to computers. It is never good to use spaces or special characters when naming files because it could cause problems. So what CAN you use? You can use a hyphen(-), underscore(_), camelCase, or PascalCase to separate your words. As you can see, I gave you an example of what camelCase is and what PascalCase is. For me personally, I prefer PascalCase. It visually makes the most sense to me.
3. How to create directories and move files into directories using the mouse.
Even though I already knew how to create a new file and move files around in my finder, the cool thing I learned today was being able to directly click and drag a file from my desktop right into the directory I wanted it to go in while my finder window was open. It sure does save a lot of time when there are multiple files to move around. Another cool thing is to two-finger click on my mac mouse pad while I am on my desktop and options will pop up. One of those options is to create a "new folder".
4. Rename files using the Mac mouse trackpad
If you two finger click down on the track pad on the file you want to rename, options will pop up. One of those options is to rename your file. If you click that option, the previous name will be highlighted, and you will be able to rename your file.
5. Create Directories and move files into directories using the terminal
Okay... now for a little fun stuff. I don't know why, but I found this to be really cool. Instead of making folders and files in my finder, I was taught by my teacher/mentor/profesor/prof/magister 😏
how to make files and folders using the Unix language in my terminal!!!
* Create a NEW folder/directory:
In order to create/make a new folder/directory, I used the "mkdir" command. So if I wanted to create/make a new folder called "Pina Coladas", I would type: mkdir PinaColadas (notice how I have it in PascalCase? Remember we cannot use spaces between words when naming files/folders/etc.).
* Create an empty file (for purposes of testing):
To create an empty file named "TestFile" for the purpose of testing, I need to type:
touch TestFile This will give me an empty folder. To remove/delete it, I will need to do the steps below to remove it.
* To change into a directory:
To change into a directory (meaning to go into a directory) I will need to type the change directory command, which is: cd . So to change into the PinaColadas directory, I would type: cd PinaColadas .
* To back out of a directory:
To back out of the current directory to return to the parent directory, I will need to type:
cd ..
6. Rename and remove files using the terminal
* Rename a folder/directory:
What if I want to change the name of the folder: "PinaColadas" to "FavoriteDrinks"? I would use the "move" command. I know that sounds confusing, but I am telling the computer that I am moving a "what"(file) to a "what"(file). The computer will not be able to locate a folder/directory with FavoriteDrinks because I do not have one, so it will automatically know that I am renaming it by "moving" it to the new name. So I would type: mv PinaColadas FavoriteDrinks
* Remove/delete a directory/file:
What if I want to delete/remove my FavoriteDrinks folder/directory completely? I would need to use the "remove" command. To do that I need to type: rmdir FavoriteDrinks however, if I want to remove the PinaColadas FILE, then I need to type: rm PinaColadas
Follow me as I learn to build my website bit by bit! IronTreeDev.com
Follow me as I learn to build my website bit by bit! IronTreeDev.com
Comments
Post a Comment