Terminal

Terminal application is located on the following path:
Your hard driveApplications folderUtilities folderTerminal application
Mac is running on UNIX, which is nearly 40 (yes, forty) years old operating system. One of the major advantages and drawbacks of using UNIX is it's command line.

Everything that you know how to do with mouse and windows (clicking, dragging, etc.) can be done and achieved using the command line.

So what's the big deal?

Power of UNIX is the ability to direct input and output of these relatively simple commands and combine them into infinite structures. A bit like bricks and mortar.

Essentially simple, but put together, the only limit is your imagination.

Here are some examples of guides writen for some of my clients.

 Network traffic

Get a list of of all TCP/IP traffic your computer is currently making.

  • Open Terminal application
  • Type netstat -p tcp | grep tcp | awk '{ printf("%s %s", $4, $5)}'Return key

You will get a screen printout of all current network traffic.

 Slow Mac network

Disable writing of status files on the network.

  • Open Terminal application
  • Type defaults write com.apple.desktopservices DSDontWriteNetworkStores trueReturn key

This will stop your Mac from writing previews and caches on remote file systems.

 Reset spotlight

Every now and then Spotlight gets corrupt indexes and needs to be updated.

sudo mdutil -E /Return key
sudo mdutil -i on /Return key

 Disk usage

You can examine exactly what the system reads and writes to disk.

  • Open Terminal application
  • Type:
    sudo fs_usage -w > ~/Desktop/usage.txtReturn key
  • Perform activity on your system that you wish to inspect; like checking your email, or saving a document
  • After seeing the behaviour you were looking for, switch back to Terminal:
    Hold Control key and press C

You can now examine the contents of usage.txt file on your Desktop, and see what the system was doing...


 XML tag check

Most software is using XML files to store any application preferences.

XML is very similar to HTML, as it is plain text file, and its structure is based on pairing tags.

Checking the integrity of these tags ensures smooth behaviour of your applications.

  • Open Terminal application
  • Type sudo plutil ~/Library/Preferences/*.plistReturn key
  • Type your admin password when prompted

If every file in the list is followed by OK, then everything is fine.
If not, check the offending file name in a text editor.

 Remote access

Before doing remote access, configure your router to pass outside traffic to HOST machine on port 5900.

On HOST machine:

  • Apple menu, System Preferences... Sharing, Services
  • Tick Remote Login
  • Tick Apple Remote Desktop
  • In Access privileges... tick VNC viewers may control screen with password.
    Make sure you use a strong 15+ mixed alphanumerical password

On a CLIENT machine download Chicken of the VNC (COTVNC)

  • Open Terminal application
  • Type ssh -L 5900:127.0.0.1:5900 shortUserNameOnHost@rtr.pub.ip.no
  • Press "Return" and type HOST VNC password when prompted.
    This command starts encrypted secure connection between CLIENT and HOST on port 5900.
  • Open COTVNC
  • Connection menu, New connection command
  • Type HOST VNC password...

And there is the HOST screen. You might have to reduce screen resolution and colour depth depending on your upload speed.

 2D Dock

To change the Dock in Leopard to 2D appearance

defaults write com.apple.dock no-glass -boolean YESReturn key
killall DockReturn key

 Lock the Dock

To lock the contents of the Dock

defaults write com.apple.dock contents-immutable -bool trueReturn key
killall DockReturn key

To unlock the Dock use:

defaults write com.apple.dock contents-immutable -bool falseReturn key
killall DockReturn key

 Bonjour ScreenShare

To get a more friendly ScreenShare open dialog box

defaults write com.apple.ScreenSharing ShowBonjourBrowser_Debug YesReturn key

To get more options on the toolbar

defaults write com.apple.ScreenSharing 'NSToolbar Configuration ControlToolbar' -dict-add 'TB Item Identifiers' '(Scale,Control,Share,Curtain,Capture,FullScreen,GetClipboard,SendClipboard,Quality)'Return key

Get in touch

What is your call about?




Next

Let me know what you think and what you need.

Any information passed on is treated with strict confidence, and only for dealing with your particular request. Your details are never passed on to any third parties.

Name

email

 
Please pay attentionUsing any of these commands without appropriate skills can result in ruining your machine!
As Spiderman worked it out: "With great power comes great responsibility".