OSX Command Line

本文介绍如何在 MacOSX Tiger 中通过创建自动挂载脚本来实现用户登录时自动挂载网络共享。此外,还提供了获取无线 SSID 的方法及更改网络位置设置的步骤。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

a very useful e-book <<Mac OS X Tiger in a Nutshell>>: http://books.google.ca/books?id=4qniHcvZoCoC&printsec=frontcover

How to automatically mount network share when user login
1. create a automount script, save it, for example, to /usr/local/bin/. and enable to x for it
2. run this command to enable it to run when user login.
   sudo defaults write com.apple.loginwindow LoginHook /usr/local/bin/auto_mount_shares

wireless:
How to get wireless SSID:
AWK version: /System/Library/PrivateFrameworks/Apple80211.framework/Versions/A/Resources/airport -I | awk '/ SSID/ {print $2}'
SED Version: /System/Library/PrivateFrameworks/Apple80211.framework/Versions/A/Resources/airport -I | sed '/ SSID: /!d; s/^.* SSID: //'

How to Change Network Locations:
Location="Automatic"
/usr/sbin/scselect "$Location"


pmset

defaults

plutil

scselect:
scselect -- Select system configuration "location"

SYNOPSIS
scselect [-n] [new-location-name]

DESCRIPTION
scselect provides access to the system configuration sets, commonly referred to as "locations". When invoked with
no arguments, scselect displays the names and associated identifiers for each defined "location" and indicates
which is currently active. scselect also allows the user to select or change the active "location" by specifying
its name or identifier. Changing the "location" causes an immediate system re-configuration, unless the -n option
is supplied.


Edit XML (PList) File:
a opensource tools: XMLStarlet Command Line XML Toolkit

I/O统计:
iostat [-CUdKIoT?] [-c count] [-n devs] [-w wait] [drives]
DESCRIPTION: Iostat displays kernel I/O statistics on terminal, device and cpu operations. The first statistics that are
printed are averaged over the system uptime. To get information about the current activity, a suitable wait
time should be specified, so that the subsequent sets of printed statistics will be averaged over that time.

EXAMPLES
iostat -w 1 disk0 disk2
Display statistics for the first and third disk devices device every second ad infinitum.

iostat -c 2
Display the statistics for the first four devices in the system twice, with a one second display interval.

iostat -Iw 3
Display total statistics every three seconds ad infinitum.

iostat -odICTw 2 -c 9
Display total statistics using the old-style output format 9 times, with a two second interval between each mea-
surement/display. The -d flag generally disables the TTY and CPU displays, but since the -T and -C flags are
given, the TTY and CPU displays will be displayed.

SEE ALSO
fstat(1), netstat(1), nfsstat(1), ps(1), pstat(8)

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值