linux点滴
為什么80%的碼農都做不了架構師?>>> ??
在Linux中怎么把用戶添加到組中?
添加用戶test,初始密碼123456,該用戶的主目錄為/home/share,用戶的基本組為root,用戶的shell為/bin/tcsh,要求將該用戶加到mail和new組中。
useradd -m -d /home/share -g root -s /bin/tcsh test #建立test用戶 passwd test #系統會提示你為test輸入密碼 你輸入123456 回車即可 usermod -G mail -a test #加入mail組 usermod -G new -a test #加入new組 #usermod -G new test (2013年8月26日22:01:00,昨晚我用這句執行害我丟了 sudo 組,而我又沒激活 root 帳號,花費一個多小時查資料才解決)更改文件權限
chmod -R 775 filename #(linux中所有都是文件,dir)ubuntu設定默認關聯程序
右鍵點擊所需要關聯打開方式的文件,選擇“屬性” ,“打開方式” 即可以選擇默認打開的程序
要進入可執行文件的目錄,比如 rails
cd $(dirname $(which rails))ubuntu terminal 顯示路徑太長,怎么設置變短
$: vi ~/.bashrc
這個文件記錄了用戶終端配置 找到
if [ "$color_prompt " = yes ]; thenPS1 ='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\W \[\033[00m\]\$ ' elsePS1 ='${debian_chroot:+($debian_chroot)}\u@\h:\------這里------>W<------這里------\$'將w由小寫改成大寫,可以表示只顯示當前目錄名稱.
代碼行數分析
代碼行數分析工具 sloccount
類似 win8 的合并目錄,而不是替換
ditto from_folder destination_folder
http://superuser.com/questions/117621/how-to-merge-and-not-replace-folders-when-copying-on-the-mac
z - jump around
記錄目錄使用的頻率,快速選擇、跳轉
https://github.com/rupa/zhttps://github.com/rupa/z
The 10 most used commands stored in your history
history | sed -e 's/ *[0-9][0-9]* *//' | sort | uniq -c | sort -rn | head -10This gives you the most used command line entries by removing the history number (sed), counting (sort | uniq -c), sorting by frequency (sort -rn) and showing only the top ten entries.
If you just want the commands alone:
history | awk '{print $2;}' | sort | uniq -c | sort -rn | head -10Both of these strip the history number. Currently, I have no idea, how to achieve that in one line.
轉載于:https://my.oschina.net/xieyunzi/blog/160746
總結
- 上一篇: .net常見面試題(三)
- 下一篇: Linux Tomcat 安装