What is the magic touch?
What if I told you that you have the power to create and destroy life with your very fingertips? You have such might that you can bring something into existence, and remove it from existence?
...
Okay, I might've gone a little overboard with the opening of this article. Although you may not be able to create and destroy an entire existence with just your fingertips, you CAN use certain commands to create new files!
"touch"
The touch command is how you create new files! You can create files of any sort, including Markdown, JavaScript, and Shell!
Using this command is very simple. In our terminal, let's test it out!
Using the "touch" command
For this example, we're going to create a file called "Hello" in our desktop directory.
Before using touch, be sure that you are in the correct directory. The desktop directory path should look like this...
Users/admin/Desktop
Now, in your terminal, simply input the following...
touch Hello
Easy enough!
Now, let's say we wanted to create a Markdown, JavaScript, or Shell file. All you would have to do is add the appropriate file type at the end of your file name.
Let's make Markdown file called "Hey".
touch Hey.md
This creates a Markdown file!
"rm"
The command "rm" is used to permanently delete any files created.
Now that we've created a couple completely useless files on our desktop, let's go ahead and clean that up. Input the commands below.
rm Hello
rm Hey.md
Now, be VERY careful with what you delete using "rm", as it cannot be recovered. Everything removed will be PERMANENTLY deleted.
Now you know Bash a little better!
Today we learned how to create life (files) using only our fingertips. How powerful do you feel?
Just remember to be careful when using the "rm" command. You can do some serious damage.
Leave a Reply