New Feature: Playlist Center! Pick a topic and let our playlists guide the way.

Easy-to-follow video tutorials help you learn software, creative, and business skills.Become a member

System configurations: Viewing and setting

From: Unix for Mac OS X Users

Video: System configurations: Viewing and setting

Mac OS X has hundreds of configurations and settings to control your environment that you work in. Some of these can be set in your system preferences but others are actually inaccessible to most users. But through Unix we can access those configurations and even modify them. In this movie we'll learn how to do that. Before we begin, keep in mind two things about setting configurations. The first is you want to be super careful that you don't accidentally change a configuration that you didn't mean to change. You might set something into an undesirable state. The second thing is that some changes are going to take effect immediately, but others are going to require either that you log out and back in or that you completely restart your Mac.

System configurations: Viewing and setting

Mac OS X has hundreds of configurations and settings to control your environment that you work in. Some of these can be set in your system preferences but others are actually inaccessible to most users. But through Unix we can access those configurations and even modify them. In this movie we'll learn how to do that. Before we begin, keep in mind two things about setting configurations. The first is you want to be super careful that you don't accidentally change a configuration that you didn't mean to change. You might set something into an undesirable state. The second thing is that some changes are going to take effect immediately, but others are going to require either that you log out and back in or that you completely restart your Mac.

So just because you don't see a change right away doesn't mean that it didn't actually take effect. It really just depends at what point the Mac loads in that particular preference, and that's going to vary from preference to preference. Let's start by seeing where the configurations are stored. I'll use Command+N to get a new window in the Finder and I'll open another Finder window here to put next to it, and then this one I'll use Command and click on the bar to go up to Macintosh HD. Now we have a Library folder here and we have a Library folder here. These are where the different configurations are stored.

These are the configurations which are global and apply to every user on the system. these are the ones that are just for me in my particular User. Inside the Library for each of them, there is also a Preferences folder. That's where these are typically stored. Now they may exist in other places in some cases. Here is the Preferences for this one, there we are. But most of the time these are the two places that you'll find them and they really depends on whether the preferences are global preference or user preference. Let's go inside the user one here and let's take a look at this. I'll actually close up the global one. And you notice almost all of these have the same format. The name is always com, period, the company name, followed by the application name, and then typically it ends in plist at the end.

Remember this format because we're going to need to use it. Plist let's you know that it's a preference list. We can open that up in a text document but if we double-click on one, we'll open up the Apple Property List Editor that they give you with your Mac. I've opened up the one is for the Finder. So do the same, just so you can follow along with me. Now what we she here are the keys and values for all the configuration options. So for example the Preferences window location has the following coordinates. My EmptyTrashProgressWindowLocation here will be placed at the following coordinates.

It remembers where we've moved that progress window as the trash is emptied. If we move it someplace else, it keeps track of those coordinates in its preference list and that's why it opens up in the same place every time. Now you can open up a lot of these, your SearchViewSettings, you see what's inside there. RecentFolders, DesktopVolumePositions, ComputerViewSettings, BrowserWindowState, and open up you can dig around and see what's there. If you double-click on something here you can actually change these values. So you can change them directly via the Property List Editor. We're going to do instead is learn to read and write these values directly from Unix without using the Property List Editor, and I'll show you why that's a better solution.

The way that we're going to do that is by using this Unix command called Defaults. It's a program that's a Mac only Unix program that will manage these default settings for us. One benefit is that it takes care of whether or not these are user preferences or global preferences. It goes and finds it in the right place and makes the change for us and we don't have to dig around at all. And after the defaults command we can put several other commands that we want defaults to run. We're going to be looking at read and write. There are few others and you can look at the man pages to see what those are, but read and write are the most useful.

So read the domain and the key that we want to read. That will return the value to us so we know what the current setting is. Or we can set a value by saying defaults write, the domain, the key, and the value. And that domain is typically in the format com.companyname.appname. Remember we just saw that, com.apple.Finder.plist. Well that's typically the domain and it's the same thing as the file name. So for example we can do defaults read com.apple.finder and then we can read CopyProgressWindowLocation and that gives us that same string that we saw in the plist editor right here, 169, 270, and it is a string.

Now we can change that value using write. So now instead of that let's use Ctrl+A to shoot to beginning of line, we'll change this from read to write, and use Ctrl+E to go to end of the line, and now we need to provide a value. So the value here is just going to be a string, which means it's in quotes, and inside there we'll just put 168, 270. Put a space between so it's really formatted the exact same way. Make sure we don't mess anything up. Now we just change that first value from being 169 to 168, essentially one pixel of difference for where that window will be located.

If we go back to the Property List Editor and let's close that up, just open that again, Finder, and now you see that the value is changed. 168, 270. So that's really all there is to it. It's just targeting the preference that you want with the right key name and then either reading or writing a value to it. Now the other thing that's nice about defaults though is that some settings won't be listed. Sometimes even the Config file itself won't exist. It won't even be in the Preferences folder. Defaults will take care of creating those files for you as needed and make sure that they are in the right format and everything.

Now how do you know about these settings and what to change, if you can't go in and see them in the plist files? Well quite honestly, you typically learn about them from the Internet. Word gets out from Mac software developers who know the Mac API really well and they know what these available options are and so then word gets out that this is the way you change something. It spreads on the Internet until people find about the sort of mysterious hidden options that they can then type the commands here into defaults and it will set it for them and create the files as needed. In the next movie we'll take a look at some popular changes.

Show transcript

This video is part of

Image for Unix for Mac OS X Users
Unix for Mac OS X Users

82 video lessons · 24975 viewers

Kevin Skoglund
Author

 
Expand all | Collapse all
  1. 3m 57s
    1. Introduction
      1m 14s
    2. Using the exercise files
      2m 43s
  2. 32m 2s
    1. What is Unix?
      7m 27s
    2. The terminal application
      4m 23s
    3. Logging in and using the command prompt
      5m 19s
    4. Command structure
      5m 22s
    5. Kernel and shells
      5m 25s
    6. Unix manual pages
      4m 6s
  3. 15m 58s
    1. The working directory
      2m 49s
    2. Listing files and directories
      3m 59s
    3. Moving around the filesystem
      4m 58s
    4. Filesystem organization
      4m 12s
  4. 1h 4m
    1. Naming files
      5m 41s
    2. Creating files
      2m 19s
    3. Unix text editors
      6m 39s
    4. Reading files
      5m 35s
    5. Reading portions of files
      3m 27s
    6. Creating directories
      2m 40s
    7. Moving and renaming files and directories
      8m 32s
    8. Copying files and directories
      3m 7s
    9. Deleting files and directories
      3m 38s
    10. Finder aliases in Unix
      4m 10s
    11. Hard links
      5m 30s
    12. Symbolic links
      6m 36s
    13. Searching for files and directories
      6m 32s
  5. 34m 58s
    1. Who am I?
      4m 3s
    2. Unix groups
      1m 52s
    3. File and directory ownership
      6m 41s
    4. File and directory permissions
      4m 27s
    5. Setting permissions using alpha notation
      6m 49s
    6. Setting permissions using octal notation
      3m 49s
    7. The root user
      1m 57s
    8. sudo and sudoers
      5m 20s
  6. 52m 34s
    1. Command basics
      4m 4s
    2. The PATH variable
      4m 13s
    3. System information commands
      3m 40s
    4. Disk information commands
      6m 8s
    5. Viewing processes
      5m 0s
    6. Monitoring processes
      3m 36s
    7. Stopping processes
      3m 19s
    8. Text file helpers
      6m 50s
    9. Utility programs
      7m 28s
    10. Using the command history
      8m 16s
  7. 20m 39s
    1. Standard input and standard output
      1m 24s
    2. Directing output to a file
      4m 13s
    3. Appending to a file
      2m 44s
    4. Directing input from a file
      5m 28s
    5. Piping output to input
      4m 40s
    6. Suppressing output
      2m 10s
  8. 41m 28s
    1. Profile, login, and resource files
      9m 11s
    2. Setting command aliases
      6m 59s
    3. Setting and exporting environment variables
      4m 54s
    4. Setting the PATH variable
      6m 10s
    5. Configuring history with variables
      6m 17s
    6. Customizing the command prompt
      6m 5s
    7. Logout file
      1m 52s
  9. 1h 25m
    1. grep: Searching for matching expressions
      5m 21s
    2. grep: Multiple files, other input
      4m 28s
    3. grep: Coloring matched text
      2m 57s
    4. Introduction to regular expressions
      3m 22s
    5. Regular expressions: Basic syntax
      3m 19s
    6. Using regular expressions with grep
      5m 20s
    7. tr: Translating characters
      8m 17s
    8. tr: Deleting and squeezing characters
      5m 30s
    9. sed: Stream editor
      7m 45s
    10. sed: Regular expressions and back-references
      7m 8s
    11. cut: Cutting select text portions
      7m 42s
    12. diff: Comparing files
      4m 35s
    13. diff: Alternative formats
      4m 30s
    14. xargs: Passing argument lists to commands
      7m 25s
    15. xargs: Usage examples
      7m 59s
  10. 42m 25s
    1. Finder integration
      4m 45s
    2. Clipboard integration
      5m 5s
    3. Screen capture
      3m 42s
    4. Shut down, reboot, and sleep
      3m 34s
    5. Text to speech
      2m 36s
    6. Spotlight integration: Searching metadata
      3m 41s
    7. Spotlight integration: Metadata attributes
      4m 24s
    8. Using AppleScript
      5m 23s
    9. System configurations: Viewing and setting
      5m 51s
    10. System configurations: Examples
      3m 24s
  11. 1m 26s
    1. Conclusion
      1m 26s

Start learning today

Get unlimited access to all courses for just $25/month.

Become a member
Sometimes @lynda teaches me how to use a program and sometimes Lynda.com changes my life forever. @JosefShutter
@lynda lynda.com is an absolute life saver when it comes to learning todays software. Definitely recommend it! #higherlearning @Michael_Caraway
@lynda The best thing online! Your database of courses is great! To the mark and very helpful. Thanks! @ru22more
Got to create something yesterday I never thought I could do. #thanks @lynda @Ngventurella
I really do love @lynda as a learning platform. Never stop learning and developing, it’s probably our greatest gift as a species! @soundslikedavid
@lynda just subscribed to lynda.com all I can say its brilliant join now trust me @ButchSamurai
@lynda is an awesome resource. The membership is priceless if you take advantage of it. @diabetic_techie
One of the best decision I made this year. Buy a 1yr subscription to @lynda @cybercaptive
guys lynda.com (@lynda) is the best. So far I’ve learned Java, principles of OO programming, and now learning about MS project @lucasmitchell
Signed back up to @lynda dot com. I’ve missed it!! Proper geeking out right now! #timetolearn #geek @JayGodbold

Are you sure you want to delete this note?

No

Thanks for signing up.

We’ll send you a confirmation email shortly.


Sign up and receive emails about lynda.com and our online training library:

Here’s our privacy policy with more details about how we handle your information.

Keep up with news, tips, and latest courses with emails from lynda.com.

Sign up and receive emails about lynda.com and our online training library:

Here’s our privacy policy with more details about how we handle your information.

   
submit Lightbox submit clicked
Terms and conditions of use

We've updated our terms and conditions (now called terms of service).Go
Review and accept our updated terms of service.