From

Long story short, to make for example an executable file from a C file “.c”, use the terminal tool xcrun with clang as an argument followed by the name of your “.c” fileThis will look something like xcrun clang helloworld.c. This in turn will generate the desired “Mach-O 64-bit executable x8664”. Open the terminal application on your macOS (Applications Utilities Terminal) Check for macOS update using the. Softwareupdate -l. Note down available updates names. Install new updates on macOS using the following command: sudo softwareupdate -i updatepkgname. Let us see how to update macOS using a terminal command in details. Update May, 2019. Now that there are SecureToken users, the command below no longer works to reset another user's password. Thanks to mario on the MacAdmins Slack for testing. Just a cleaned-up version of directions from Mac Script to change Administrator password. Changing a user password via terminal command. Terminal will not auto-update when new builds are released so you will need to regularly install the latest Terminal release to receive all the latest fixes and improvements! Via Windows Package Manager CLI (aka winget) winget users can download and install the latest Terminal release by installing the Microsoft.WindowsTerminal package. Downloading and using different Mac OS installers is very common for troubleshooting purposes, for IT staff and admins, and for tinkerers. This article will discuss where to download and access installers for macOS Big Sur, macOS Catalina, MacOS Mojave, MacOS High Sierra, macOS Sierra, Mac OS X El Capitan, OS X Yosemite, OS X Mavericks, Mac OS X Mountain Lion, Mac OS X Lion, Mac OS X Snow.

When you need to install software updates on your Mac, you probably head to the Mac App Store. Apple’s curated app store has long been the default method of not just finding and installing third party applications, but also of applying patches and updates for macOS and other Apple applications. But when it comes to macOS software updates, the Mac App Store is really just a front end for a UNIX command, and fans of the Mac’s Terminal can actually use this command to update their Mac and first party apps while bypassing the Mac App Store altogether.
The Mac software update command we’re talking about is helpfully well named: softwareupdate. Here’s how to use it.

  1. Launch the Terminal application (which can be found in the /Applications/Utilities folder or by searching for it with Spotlight).
  2. From the Terminal, type softwareupdate -l (that’s a lowercase “L” and not the number one). This will provide a list of all available updates along with their individual file sizes and a note indicating whether you’ll need to restart your Mac to complete the update process.
  3. To install an individual software update, enter the command sudo softwareupdate -i name, where “name” is the exact name of one of the available updates revealed by the list command. As this is a superuser (sudo) command, you’ll need to enter your admin account password when prompted.
  4. To install all available software updates, instead use the command sudo softwareupdate -i -a. The “-a” switch simply instructs the command to install all updates. Again, you’ll need to enter your admin password when prompted.
  5. There’s no traditional progress bar, but you will see updated text entries in the Terminal window as each step is completed, letting you know both when certain updates have been downloaded and when the entire installation process is complete. If you installed software updates that require a reboot, you’ll see a final message instructing you to restart your Mac. You can do this via the normal macOS interface, but since we’re already using UNIX commands in Terminal, you can also type sudo shutdown -r now, which instructs shutdown command to restart the Mac (“-r”) immediately (“now”).

Benefits of Using Software Update via the Terminal

Now that you know how to run the Mac Software Update from the Terminal, the likely question is why you’d want to use this method instead of simply clicking a few buttons in the Mac App Store. One big reason is automation and remote management. Users with multiple Macs to manage can create scripts or remotely initiate a software update via a method such as SSH without needing to manually use screen sharing or remote management software.
Another potential benefit is speed. While not universal, many users report that updates install faster when installed via Terminal, both in terms of the initial installation as well as the post-restart portion as the Mac reboots. While not every update will see a significant speed increase, the Terminal method at least won’t add any time compared to the Mac App Store.

The One Big Downside of Using Software Update via the Terminal

Despite its benefits for many users, there’s one big caveat of running the Mac Software Update via the Terminal. As mentioned at the beginning of this article, the Terminal method only works with macOS system updates and first party Apple apps like iTunes. This is compared to the Mac App Store, which will update your third party apps alongside the official Apple updates.
Longtime Mac users may recognize this limitation is the same as the original Mac Software Update utility. This utility, which is how Apple delivered system and first party updates to users prior to the launch of the Mac App Store, did not support third party applications. Since the softwareupdate UNIX command also served as the basis of the original Software Update utility, this limitation makes sense.
So, if you only want to quickly install macOS system and first party updates, or if you don’t use any third party apps from the Mac App Store, the Terminal method has you covered. If not, you may be better off sticking with the default Mac App Store method as it keeps both your first and third party app updates all in one place.

Java and the Mac OS X Terminal


This page is obsolete.


This document instructs you on how to use the Mac OS X Terminal with Java.

Java

You will use the Java compiler javac to compile your Java programs andthe Java interpreter java to run them.To verify that Apple's implementation of Java 2 Standard Edition (Java SE 6) isalready installed:

  • Run Software Update.
  • Run Applications/Utilities/Java/Java Preferencesand verify that the Java SE 6 - 64-bit entry is checked andfirst in the list; if not, drag to change the preferred order.
Command-line interface

You will type commands in an application called the Terminal.

  • Open a terminal window. You can find this underGo -> Applications -> Utilities. Drag the Terminal to your dock sinceyou will be using it frequently.
  • You should now have a Terminal window somewhere on the screen.It will have a prompt that looks something like:
  • To check that you are running the right version of Java, typethe commands in boldface below. You should see something similar to the information printed below. The importantpart is that it says 1.6 or 1.5 (and not 1.4).
    Then type
  • Since you will be using the Terminal frequently, you may want tocustomize the default window settings (e.g., Monaco 13pt font with antialiasing).
Update python mac from terminal
Compile the program

You will use the javac command to convert your Java program into a form moreamenable for execution on a computer.

Update
  • From the Terminal, navigate to the directory containing your .javafiles, say ~wayne/introcs/hello, by typing the cd commandbelow.
  • Assuming the file, say HelloWorld.java is in the currentworking directory, type the javac command below to compile it.
    If everything went well, you should see no error messages.
Execute the program

You will use the java command to execute your program.

  • From the Terminal, type the java command below.If all goes well, you should see the output of the program -Hello, World.
Input and Output

If your program gets stuck in an infinite loop, type Ctrl-c to break out.

If you are entering input from the keyboard, you can signifyto your program that there is no more data by typingCtrl-d for EOF (end of file).You should type this character on its own line.

Troubleshooting

How To Update Macos From Terminal

Terminal

When I try to run java I get: Exception in thread 'main' java.lang.NoClassDefFoundError.First, be sure that HelloWorld.class is in the current directory.Be sure to type java HelloWorld without a trailing .classor .java.If this was not your problem, it's possiblethat your CLASSPATH was set by some other program so that it no longerincludes the current working directory.Try running your program with the command line

Update Mac From Terminal

If this works, your classpath is set incorrectly.

I get the error 'class file has wrong version 50.0, should be 49.0' when I compilefrom the Terminal. What does this mean?It's probably because DrJava is configured to use Java 6.0 and and your Terminal is configured to use Java 5.0.To change the default version of Java in your Terminal, launchJava Preferencest. Drag the Java SE 6 - 64-bit entryto appear first.

How do I get the menu to display at the topof the screen instead of at the top of the frame?Execute with java -Dapple.laf.useScreenMenuBar=true

Update Python From Terminal Mac

Where can I learn more about the command line?Here is a short tutorial on thecommand-line.