

To return to the directory we were last in:

If you want to print your working directory resolving symbolic links:īy convention, if we leave off the argument and just type cd we go HOME: We can save the current working directory in a variable with command substitution:Ĭd /somewhere/else # go somewhere else # do something elseĬd $d # go back to where the script originally started Sometimes in a script we change directories, but we want to save the directory in which we started. To see where we are, we can print working directory, which returns the path of the directory in which we currently reside: Note: Unix-like systems include Linux and Macintosh When this is the case, I make a note of it. I'll briefly introduce each one below along with a quick use case or hint.Ī few of the commands, mostly clustered at the end of the article, are not standard shell commands and you have to install them yourself (see apt-get, brew, yum). Here are my picks for the top 100(ish) commands. These are indispensable but, for anything more than the basics, a vocabulary of about 100 commands is where you want to be.

“~Library/Logs” is your current Mac user account’s user-specific application log folder, “/Library/Logs” is the system-wide application log folder, and “/var/log” generally contains logs for low-level system services. The search bar works to filter these log files, too.In An Introduction to the Command-Line (on Unix-like systems), which I'll borrow heavily from in this article, we covered my subjective list of the 20 most important command line utilities. To view the system log file, click “system.log.” To browse different application-specific logs, look through the other folders here. An application’s developer may need this information to fix a crash that occurs on your Mac, too.

If you need more information about why an application crashes on your system, you may be able to find it here. Click them to view them in the Info pane. You’ll see a variety of logs with file extensions like. To see application crash and freeze logs, click either “System Reports” for system applications or “User Reports” for user applications. You can also use the search box to search for a type of error message you want to see. You can click “Errors and Faults” in the toolbar to see only error messages, if you like. By default, you’ll see a list of console messages from your current Mac.
