顯示具有 apple command 標籤的文章。 顯示所有文章
顯示具有 apple command 標籤的文章。 顯示所有文章

2008年3月27日 星期四

pdisk

Apple partition table editor
(the disk must use Apple_partition_scheme. If it uses GUID_partition_scheme, pdisk can not use)

(1) input e
edit device's map
input /dev/disk2
the name of device to change is /dev/disk2

(2input c)
create a partition, with default= Apple_HFS
First block: 64
Length in blocks: 20000
Name of partition: par1

input t
change partition type
input MyPartitionType

(3) input w
write the partition table

2008年3月14日 星期五

chown

change directory or file的權限:

ex: sudo chown -R root AppleRAID.kext
AppleRAID.kext的user變成root
-R表示從AppleRAID開始,以下的hierarchy也跟著改變。

2008年3月13日 星期四

diskutil

show disk information

show information of each disk:
diskutil list

create new RAID set:
createRAID mirror|stripe|concat setName format devices ...
ex: diskutil createRAID mirror MyArray JHFS+ disk2s4 disk2s5

Started RAID setup operation on disk disk2s4 Data_2_1
Adding booter for RAID partition 'disk2s4 Data_2_1'
Adding booter for RAID partition 'disk2s5 Data_2_2'
Adding disk 'disk2s4 Data_2_1' to new RAID set
Adding disk 'disk2s5 Data_2_2' to new RAID set
Creating RAID set (
disk2s4 Data_2_1,
disk2s5 Data_2_2
)
Bringing RAID partitions online
Waiting for new RAID to come online "C36FAD58-EF80-4DC7-AA4E-BAA85F15A222"
Creating file system on RAID volume "disk3"
[ + 0%..10%..20%..30%..40%..50%..60%..70%..80%..90%..100% ]
Finished RAID setup operation on disk disk3 MyArray

2008年3月4日 星期二

ls color under MAC

讓ls顯示color
輸入alias ls='ls -G' 於.bash_profile

2008年2月26日 星期二

netstat

show network status

-r:
Show the routing tables

-a:
顯示在本地機器上的外部連接

-p:
Show the PID and name of the program to which each socket belongs.

2008年1月31日 星期四

svn

co:
co = checkout,將程式donwload下來
svn co http://SVN_PATH/svn_project

svn import . svn://192.168.1.200/projects/tickets --message "initial import" –username eldon
將程式存放到repository

svn checkout svn://192.168.1.200/projects/tickets tickets
將repository上的程式download下來

svn remove log/*
svn commit --message "removing all log files from subversion"
移除repository上log/下的files

svn propset svn:ignore "*.log" log/
svn commit –message "Ignore all log files in the log directory"
除止log下的files上傳到repository

2008年1月29日 星期二

killall

killall -9 test
終止所有叫test的process

sudo

sudo -s
輸入自己的密碼,獲得root權限

s: The -s (shell) option runs the shell specified by the SHELL envi-ronment environment
ronment variable if it is set or the shell as specified in
passwd

SystemStarter

Start, stop, and restart system services

SystemStarter [-gvxdDqn] [action [service]]

Actions:
start, stop, restart

2008年1月23日 星期三

ping6

測試IPv6是否可正常使用
ping6 ::1


用local-addresses 作為ping6 目標必需指定一個界面. 否則核心將不知道數據包發往哪個設備
ping6 -I lo0 fe80:0:0:0:0:0:0:1

lsof

lsof (lists open files)

Show all connections with -i
lsof -i

Show only TCP (works the same for UDP)
lsof -iTCP

Show IPv6 connection
lsof -i 6

2008年1月22日 星期二

root 權限

啟動root權限
sudo passwd root

ln

建立link,project指到 /Volumes/1222/Users/deeplove/Documents/project
ln -s /Volumes/1222/Users/deeplove/Documents/project project

ls -l
lrwxr-xr-x 1 pan staff 46 Jan 22 18:06 project -> /Volumes/1222/Users/deeplove/Documents/project

2008年1月21日 星期一

Enable hidden disk image formats in Disk Utility

defaults write com.apple.DiskUtility advanced-image-options 1