Shell scripts must be executable files in order to run. You can use the chmod command to indicate that the text file is executable (that is, its contents can be run as a shell script). In the Terminal app on your Mac, use the cd command to move into the directory that contains the file you want to make executable. The long ribbon of icons at the bottom of the Mac's screen is called the Dock. Clicking apps in the Dock is the primary method of launching them. The Dock also shows the status of applications—for example, whether they're running or needing your attention.
- Opening Eps Files With Preview?
- How To Launch And Quit Applications In OS X Using The Terminal
- How To Run An App From Mac Terminal File
- Open App From Terminal Mac
I can give you some partial answers. If you are running in Terminal, the location of the Applications folder is Applications. Indeed, this is not in the standard unix path, so you cannot normally run an app in the Applications folder just by typing its name.
However, you can run at least some of the GUI apps from Terminal if you know the proper path. For instance, if you enter the following command into a Terminal window:
/Applications/Preview.app/Contents/MacOS/Preview
the Preview application will start.
If you look at this path name, you can start to see some of the problems with trying to add GUI apps to your unix path. These apps are not directly in the /Applications directory. In general, each GUI app will be in its own directory. So, if you wanted to run lots of GUI apps from Terminal by typoing only the name of the app, you would have to add something to your path for each app. Another issue is that it might not always be clear what is actually the proper file to invoke. For instance, I have tried to start Microsoft Office from Terminal but have failed. It is possible that I did not find the correct file to use. I am also wondering if all GUI applications can be started from the Terminal - I am not convinced that that is the case.
There is one nice feature of the Terminal that is germane to this discussion. If you are in Terminal and your working directory contains some document, you can use the open utility to open that file in the correct GUI application. For instance, if I have a pdf file called test.pdf in my directory, I can issue the Terminal command
open test.pdf
and this will cause Preview (or perhaps Acrobat) to start up and to open the file.
I hope this helps to answer your question. You did not say what it is that you want to do. If you there is a specific task that you would like to accomplish, please let us know and perhaps someone can help. Also, you can get very good help in the unix forum.
Rich
EMAC G4 1.0 GHz Mac OS X (10.4.8)
However, you can run at least some of the GUI apps from Terminal if you know the proper path. For instance, if you enter the following command into a Terminal window:
/Applications/Preview.app/Contents/MacOS/Preview
the Preview application will start.
If you look at this path name, you can start to see some of the problems with trying to add GUI apps to your unix path. These apps are not directly in the /Applications directory. In general, each GUI app will be in its own directory. So, if you wanted to run lots of GUI apps from Terminal by typoing only the name of the app, you would have to add something to your path for each app. Another issue is that it might not always be clear what is actually the proper file to invoke. For instance, I have tried to start Microsoft Office from Terminal but have failed. It is possible that I did not find the correct file to use. I am also wondering if all GUI applications can be started from the Terminal - I am not convinced that that is the case.
There is one nice feature of the Terminal that is germane to this discussion. If you are in Terminal and your working directory contains some document, you can use the open utility to open that file in the correct GUI application. For instance, if I have a pdf file called test.pdf in my directory, I can issue the Terminal command
open test.pdf
and this will cause Preview (or perhaps Acrobat) to start up and to open the file.
I hope this helps to answer your question. You did not say what it is that you want to do. If you there is a specific task that you would like to accomplish, please let us know and perhaps someone can help. Also, you can get very good help in the unix forum.
Rich
EMAC G4 1.0 GHz Mac OS X (10.4.8)
Jan 3, 2007 7:20 PM
Terminal is not for mere mortals, you're probably thinking. It's a kind of a sacred knowledge that only geeks and Mac geniuses possess. But if you get through your first command line you'll find it's not that terrifying. In fact, using Terminal is like applying Harry Potter wizardry to your tasks. Once you know the right spells you can break any laws of how applications behave and do some unbelievable things that even the most experienced Mac people can't. Isn't it seducing to try?
We've chosen just a few of Terminal's most impressive features. For more serious take on Mac terminal commands, check out this article. Okay, are you ready to type in your first code? To start the journey, learn how to open Terminal app on Mac: Click Launchpad and then type Terminal in the search bar.
1) Make your Mac talk to you
One of the simplest commands which can be very fun, especially when you are planning a prank on somebody. Just type any text in Terminal and your computer will speak it in your Mac's default voice. But there's about 20 voices and intonations to choose from plus the ability to convert an entire text file into speech. So here's a slick audiobook maker at your hand.
Open up Terminal, type in:
say followed by a space and any text you want to hear
say followed by a space and any text you want to hear
2) Customize Login Message
This is what makes Mac more personal and humanized. For example, you can write an inspirational motto or helpful information for other users, if it's a public library computer. It might even be a way to retrieve your MacBook if you lose it — if you set a login message with your contact information. Once again there's much room for pranking other people, but we won't go deep into that.
Open up Terminal, type in:
Open up Terminal, type in:
sudo write /Library/Preferences/com.apple.loginwindow LoginwindowText 'Custom Text Here'
3) Watch Star Wars in Terminal app
Opening Eps Files With Preview?
In Terminal symbols, of course. This could be the greatest trick which makes no particular sense, but even if just for the coolness alone you should try it. The Death Star, R2D2, spaceships and the rest of the Episode 4 story retold in Terminal graphics will blow your friends away at the party. And there is no sound by the way.
Open up Terminal, type in:
telnet towel.blinkenlights.nl
On macOS Sierra and higher macOS versions, you should use a different command:
telnet towel.blinkenlights.nl
On macOS Sierra and higher macOS versions, you should use a different command:
nc towel.blinkenlights.nl 23
4) Show hidden files in Finder
This isn't as funny as the previous one, but searching for important files is no joke. With this command, you'll be able to see everything on your Mac, even files which were omitted from standard display.
Open up Terminal, type in: Sharing mac to mac.
How To Launch And Quit Applications In OS X Using The Terminal
defaults write com.apple.finder AppleShowAllFiles TRUE
killall Finder
killall Finder
This should summon Finder with previously hidden files shown grayed out.
To reverse this operation (be aware that you may be swamped with lots of irrelevant system files) just substitute TRUE for FALSE in the command line above:
To reverse this operation (be aware that you may be swamped with lots of irrelevant system files) just substitute TRUE for FALSE in the command line above:
defaults write com.apple.finder AppleShowAllFiles FALSE
killall Finder
killall Finder
5) Pay a visit to a psychiatrist
Funny Mac terminal commands are many. This is a classic Easter egg type of joke macOS developers are famous for. When you're feeling stressful, talking to friendly chatbot will at least make you smile. Strangely enough, this therapy may be actually working because you are asked to verbalize your emotions, by giving them a closer look. And the psychiatrists (the real ones) will confirm that sometimes it works.
Open up Terminal, type in:
emacs and then hit Return. Press Esc, then x, and finally type doctor
emacs and then hit Return. Press Esc, then x, and finally type doctor
6) See iTunes songs notification via Terminal app
A clever addition if you normally work with the music on the background. If you fell in love with a particular track from your playlist you don't need to open iTunes to find out the artist's name. It will pop up on your Mac Dock from now on. Though a bit strange this feature isn't included by default because it's really a timesaver.
64 bit mac apps. Open up Terminal, type in:
defaults write com.apple.dock itunes-notifications -bool TRUE
How To Run An App From Mac Terminal File
Close the dock using the following command:
killall Dock
7) Play simple games
This is another retro cool feature to cheer you up once in a while. You can play Tetris, Pong, Snake and a dozen of other arcade games. Once you have unlocked these nice hidden toys, you'll surely get to love your Mac more. Prepare to use your arrow keys.
Open App From Terminal Mac
Open up Terminal, type in:
emacs. Press Enter to open it up, press Esc then x. Now you have to type the name of the particular game and that's it.
Game names:
emacs. Press Enter to open it up, press Esc then x. Now you have to type the name of the particular game and that's it.
Game names:
- tetris
- pong
- snake
- solitaire
- 5x5
- landmark
- doctor
What you learn from using Mac Terminal commands is that nothing is really impossible if you're on a Mac. But it's better to start your Terminal experience with these funny little tricks and then go to something serious. This program has a nearly infinite number of magic spells to choose from.
8) Make your Mac faster and more responsive
Okay, this has nothing to do with Terminal. But who wouldn’t want their MacBook as speedy and efficient as back then, on its first day? Surprisingly, this can be achieved easily, Terminal-style way — with aid of CleanMyMac X.
- Remove up to 74 GB of junk from your Mac
- Uninstall unwanted apps completely
- Speed up Mac with maintenance scripts
- Fully clean browsers and messengers
Download the app from developer’s site for free
Hope you found this article helpful, stay tuned for more!
Hope you found this article helpful, stay tuned for more!