Skip to main content

How to Open files in Mac directly from terminal?

Well, Guys Today we will be learning on how to open files in Mac directly from terminal?

First of all,

Open terminal.

Use cmd + space to open spotlight and type terminal and hit enter.

Opening Terminal Using spotlight















Now, that you have opened it , you will see something like this
Terminal















Now, type open.
In this tutorial i will try to open name.cpp from desktop
Terminal- using command open




In my MBP, it launches Xcode to open the file name.cpp. Xcode is the default application to open .cpp files.
However, if you want to open it in a different application like I have a text editor named atom and i want to open it in atom so i will hit a command like this
Terminal- using command open -a "<application-name>" filename




So, in short the command to open application is like this,

open -a "application-name" filename
and then hit enter.

Don't forget to like and comment. And post any doubts or corrections.
Video of How to's like this are in progress. In a month you will be able to watch these helpful How to's. Thank you. Don't forget to share ;).


Comments

Popular posts from this blog

Why your Disk Utility is showing wrong used storage space on Mac?

Hello, Friends today we will be talking about the most common problems on MacBooks these days. As I remember , last week I was so upset that my disk Utility was showing the size of Apps as 103 Gigs even when the used storage was just 38 gigs . I searched the internet and found out this solution and decided to share it. All we have to do is to rebuild the index of spotlight. To do so follow these steps: First of all, open spotlight , then type, Hit enter, Now, click on  spotlight and click on the Tab Privacy Now, click the '+' button and add Your whole hard drive to it. In this case it is Macintosh HD Once you restrict spotlight's access, just select the drive and click the '-' button and exit. After exiting spotlight will rebuild index and your disk utility will show correct size of the drive and all. Thanks for reading. keep coming for more. Don't forget to share and like ;). Vide...

How to run C++ program directly from compiler?

Today, we will be learning on how to run a C++ program directly from compiler.So let's start. Hit cmd + space and type terminal , Now, hit enter. I will be running a simple hello world program named hello.cpp placed on my desktop. So, first of all change the directory to Desktop . Now, type g++ <filename.cpp> -o <filename> and hit enter If the file is with no errors, it will do nothing otherwise give you details about the error. Now, type ./<filename> like this and your program will run in the same terminal window. Otherwise you can check the current directory and find a file named <filename.exec> . Hit enter to run directly. Thank you for reading. Keep coming for more. Don't forget to like and share ;). Videos in progress. 

Quadratic Equations

A Quadratic Equation is an polynomial equation with highest degree 2. For e.g.: 5x 2  + 2=0 2x 2  + x + 1=0 General form of the equation is: ax 2  + bx + cx = 0 where a is not equal to 0 Normal form of Quadratic equation can also be represented by two parameters. (say m and n) x 2  + mx + n = 0 Normally , We are asked to find the roots  of the equation. The roots of the equation can be  found using three methods. Let us take the example x 2 -6x + 8=0 and solve this equation using these methods separately. Let's Start: 1.) The Grouping Method or that's what i call it    In this method we try to split the middle term or 'b' such that it is equal to the product of the rest of the terms or 'ac'. Now, let us apply this method on the above equation. x 2  -6x + 8=0 As, it is easily visible, the term -6 has to be split in a such a way that it's product equals to 8. x 2  -6x + 8=0...