mac使用初级
imac使用的是login shell,所有开启一个terminal的时候,不会运行.bashrc文件,而是运行.bash_profile文件,因此只需要中home目录新建一个.bash_profile文件,然后在.bash_profile里source .bashrc即可。
imac的terminal中默认没有使用彩色来显示output,可以在.bashrc里输入:
export CLICOLOR=1 export LSCOLORS=ExFxCxDxBxegedabagacad #you can use this if you are using a black background: export LSCOLORS=gxBxhxDxfxhxhxhxhxcxcx
截至2015-02-09日,我的.bashrc配置文件如下:
#! /bin/sh #alias ls='ls -G' alias grep='grep --color=auto' export CLICOLOR=1 export LSCOLORS=gxBxhxDxfxhxhxhxhxcxcx # Terminal colours (after installing GNU coreutils) NM="\[\033[0;38m\]" #means no background and white lines HI="\[\033[0;36m\]" #change this for letter colors HII="\[\033[0;32m\]" #change this for letter colors SI="\[\033[1;33m\]" #this is for the current directory IN="\[\033[0m\]"#export PS1="$NM[ $HI\u $HII\h $SI\w$NM ] $IN"
export PS1="$HI\u@$HII\h: $SI\w $NM\$ "
OS X Terminal to move the cursor word by word
Out of the box you can use the quite bizarre Esc+F to move to the beginning of the next word and Esc+B to move to the beginning of the current word.
control-w works just fine for me for deleting a word backwards.
还可以在终端的配置中设置 map option key as meta key.
mac os运行sshd:
运行 /usr/sbin/sshd ,系统报错:
Could not load host key: /etc/ssh_host_rsa_key
Could not load host key: /etc/ssh_host_dsa_key
生成所需的密钥
/usr/bin/ssh-keygen -t rsa -f /etc/ssh_host_rsa_key
/usr/bin/ssh-keygen -t dsa -f /etc/ssh_host_dsa_key
然后就可以启动 sshd 服务了:
/usr/sbin/sshd
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
支付宝扫一扫捐赠
支付宝扫一扫捐赠
微信公众号: 共鸣圈
欢迎讨论,邮件: 924948$qq.com 请把$改成@
QQ群:263132197
QQ: 924948