为 Iemoga ix2-dl 的 root 账户添加 bashrc 和 bash_history 支持

Iemoga ix2-dl 啓用 SSH 後,用root賬戶登錄,默認沒有.bashrc,只有.bash_history且重啓後會丟失,多少有點不便。
.bashrc可以手動添加,但和.bash_history一樣重啓會丟失,因爲ix2-dl系統根目錄默認是不可寫的。解決辦法是把.bashrc和.bash_history放到其它位置並設置開機自動爲其作軟鏈接

移動位置

/mnt/system 是可讀寫掛載,所以我把它們放到這裏了:
mkdir -p /mnt/system/rootfs
touch /mnt/system/rootfs/.bashrc
cp /.bash_history /mnt/system/rootfs/

啓動腳本

編輯/etc/rc.loacl,在exit 0之前添加:
ln -s /mnt/system/rootfs/.bashrc /
ln -s /mnt/system/rootfs/.bash_history /

設置alias

在.bashrc裏添加一些有用的alias設置,以下是我添加的:
alias rm='rm -i'
alias cp='cp -i'
alias mv='mv -i'
alias ll='ls -l --color=tty'
alias lla='ls -la --color=tty'

立即使其生效:
source /.bashrc

“为 Iemoga ix2-dl 的 root 账户添加 bashrc 和 bash_history 支持”的3个回复

  1. I’m really impressed with your writing skills and also with the layout on your blog. Is this a paid theme or did you modify it yourself? Anyway keep up the nice quality writing, it is rare to see a great blog like this one today..

  2. Woah! I’m really digging the template/theme of this blog. It’s simple, yet effective. A lot of times it’s tough to get that “perfect balance” between superb usability and visual appeal. I must say you’ve done a very good job with this. Additionally, the blog loads very fast for me on Internet explorer. Superb Blog!

发表评论

电子邮件地址不会被公开。 必填项已用*标注