這篇文章是在工作上發(fā)現(xiàn)的一些Linux 的小技巧,不定時更新
修改bash提示符
/etc/profile 和 ~/.bashrc 或者直接在用戶的.bash_profile中添加 export PS1="[/u@/h /`pwd/`]$"
或export PS1='[\u@\h \W]$'
/u代表 用戶名; /h 代表機(jī)器名 /\
pwd/` 代表當(dāng)前路徑`
umount NFS 出現(xiàn) device busy
由于NFS的各種問題,經(jīng)常會出現(xiàn)umount NFS文件夾的時候出現(xiàn)device busy的error 而失敗。這時候可以用 mount -l
命令進(jìn)行umount. man umount 是這么說的:
-l Lazy unmount. Detach the filesystem from the filesystem hierarchy now, and cleanup all references to the filesystem as soon as it is not busy anymore. (Requires kernel 2.4.11 or later.)
翻譯成中文就是延遲umount, 會立即卸載目錄樹里面的文件系統(tǒng),等設(shè)備不再繁忙的時候才去清理所有的相關(guān)資源。所以用umount -l 從表面上看這個文件夾的確是被umount了。