Mac OS Top 50 Terminal commands/Mac常用50个终端指令(2/2)

Referenced from: http://www.mactricksandtips.com/2008/02/top-50-terminal-commands.html

上一篇写了前25个,这是接下来的25个,只写了中文题目,没写的是我也不知道干什么用,知道的可以留言告诉我是干什么用的。。。

26) Increase Time Machine Backups/调整Time Machine备份间隔

If you do a lot of work on you Mac, and you want time machine to back up more frequently you need to change the value. It is in seconds. The default is set to an hour which is 3600. Change this value to suit, half and hour is 1800 seconds.

sudo defaults write /System/Library/LaunchDaemons/com.apple.backupd-auto StartInterval -int 1800

27) Kill A Process/杀死一个进程

Sometimes you just need a process to stop running. If you want to kill it in Terminal with out using Activity Monitor, find the process ID (In Activity Monitor) and then use the following command. Only really useful if you don’t like much clicking or are writing a program.

kill PID 478

28) Let Terminal Talk/让终端将你的输入语音发声

If you are bored one day you can get Terminal to quickly talk anything back to you using the voice engine. Replace hello with anything you want.

say hello

29) Make Hidden Applications Icons Transparent/让隐藏的程序图标在Dock上透明

If you hide a lot of applications you can make there icons transparent in the dock. A very good visual clue.

defaults write com.apple.Dock showhidden -bool YES
killall Dock

30) Make The Dock Spring Loaded

Makes the dock spring loaded so you can open files or windows from within the dock.

defaults write com.apple.dock enable-spring-load-actions-on-all-items -boolean YES

31) Recent Applications Stack/添加一个Stack显示你最近使用的程序

This command creates a new stack in your dock so you can view the recently used Applications.

defaults write com.apple.dock persistent-others -array-add '{ "tile-data" = { "list-type" = 1; }; "tile-type" = "recents-tile"; }'

32) Change The Arrows In iTunes/修改iTunes里的箭头

Normally the arrows in iTunes link to the music store, adding this command enables you to search your library. You need to click on the song first for the arrows to appear.

defaults write com.apple.iTunes invertStoreLinks -bool YES

33) Pin The Dock To The Left/将Dock放在屏幕左侧

This command pins the dock to the left hand side of the screen. I’m not sure what happens if you have the dock on the left or right edge. Replace start with middle to revert.

defaults write com.apple.dock pinning -string start

34) Pin The Dock To The Right/放在右侧。。。

Exactly the same as above except it pins the dock to the right hand side of the screen.

defaults write com.apple.dock pinning -string end

35) Play Star Wars Episode IV/玩星球大战第4章

Using a simple telnet address you Terminal will connect in and play Star Wars Episode IV in its ASCII glory.

telnet towel.blinkenlights.nl

36) Quicklook A File/在终端中快速浏览一个文件

Quicklook is a great little application in Leopard. The command lets you quicklook a file right in Terminal. First you need to change the folder by using the “cd” command and then the folder you want. To enable this command to work you need to type the file name exactly.

qlmanage -p "Jaguar Aqua Graphite.jpg"

37) Disable The Spotlight Icon/取消Spotlight图标

This command removes the spotlight icon. Type 755 to re-enable it, instead of 0.

sudo chmod 0 /System/Library/CoreServices/Spotlight.app
killall Spotlight

38) Remove The Stripes In List View

A simple hack that removes the alternating stripes in list view in finder.

defaults write com.apple.finder FXListViewStripes -bool FALSE
killall Finder

39) Turn The Menu Bar White/将菜单栏变成白色

If you don’t like the menu bar in its cool transparent glory you can change it so it appears white. This requires a password and you will need to restart you mac.

sudo defaults write /System/Library/LaunchDaemons/com.apple.WindowServer 'EnvironmentVariables' -dict 'CI_NO_BACKGROUND_IMAGE' 1

40) Turn The Menu Bar Grey/变灰色

If you don’t like the white version of the menu bar you can change it so it appears gret.

sudo defaults write /System/Library/LaunchDaemons/com.apple.WindowServer 'EnvironmentVariables' -dict 'CI_NO_BACKGROUND_IMAGE' 0

41) Revert The Menu Bar Back To Default/将菜单条恢复默认设置

If you prefer the transparent menu bar and you want it back type the following into Terminal.

sudo defaults delete /System/Library/LaunchDaemons/com.apple.WindowServer 'EnvironmentVariables'

42) Set The Expanded Print Dialogue As Default

If you want access to a lot of the extra print menus on by default you can use the following command to enable you to do this. Requires restart.

defaults write -g PMPrintingExpandedStateForPrint -bool TRUE

43) Set The Expanded Save Dialogue As Default

Similar as the print dialogue this sets the save dialogue to the expanded view as default. Requires restart.

defaults write -g NSNavPanelExpandedStateForSaveMode -bool TRUE

44) Set The Screen Saver As The Wallpaper/将屏保设置成桌面背景

This command sets the currently selected screen saver as the desktop background. Use command + c or . to stop while in Terminal. Alternatively you can use wallsaver.

/System/Library/Frameworks/ScreenSaver.framework/Resources/ScreenSaverEngine.app/Contents/MacOS/ScreenSaverEngine -background

45) Set The History Limit In Safari To A Number Of Items/设置Safari中历史浏览条目上限

If you don’t want a massive history you can set it to a limited number of items. Change the number to suit.

defaults write com.apple.Safari WebKitHistoryItemLimit 2000

46) Set The History Limit In Safari To A Number Of Days/设置Safari中历史保留天数

Similar to the hack above you can set the number of days Safari keeps its history.

defaults write com.apple.Safari WebKitHistoryAgeInDaysLimit 30

47) Show Hidden Files In Finder/显示隐藏文件

 

A lot of the files in Finder are hidden. This is probably a wise choice by Apple as there are countless things you can screw up. But if you want to take a look at how many there are and what they are you can show them within Finder. Be careful as these files are needed by the system, if you screw something up don’t come complaining. Repeat the command with false to revert. The image above, click for larger version, show the amount of files there actually is, with these hidden there is only 4 shown normally.

 

defaults write com.apple.finder AppleShowAllFiles TRUE

48) Skip Disk Image Verification

If you want to save some time you can skip the disk image verification for a disk image. Potentially risky as a whole load of things could go wrong without you knowing.

com.apple.frameworks.diskimages skip-verify TRUE

49) Show SubFolders In Graphical Format In Terminal/在终端里以图形显示子目录

This is a very cool little hack that enables you to show an ASCII graphical view of sub folders. Use the cd command to change to a directory other wise the command will list every folder. For more information look here.

ls -R | grep ":$" | sed -e 's/:$//' -e 's/[^-][^\/]*\//--/g' -e 's/^/ /' -e 's/-/|/'

50) Speed Up Dialogue Boxes/加速对话框出现动画

Most dialogue boxes have a cool animation effect that looks cool. If you want to speed this up you can change the speed at which is renders so it appears almost instantly. The default is 0.2.

defaults write NSGlobalDomain NSWindowResizeTime 0.01

posted @ 2010-05-22 18:24  梳子  阅读(1530)  评论(0编辑  收藏  举报