linux点滴
為什么80%的碼農(nóng)都做不了架構(gòu)師?>>> ??
在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 #系統(tǒng)會(huì)提示你為test輸入密碼 你輸入123456 回車即可 usermod -G mail -a test #加入mail組 usermod -G new -a test #加入new組 #usermod -G new test (2013年8月26日22:01:00,昨晚我用這句執(zhí)行害我丟了 sudo 組,而我又沒(méi)激活 root 帳號(hào),花費(fèi)一個(gè)多小時(shí)查資料才解決)更改文件權(quán)限
chmod -R 775 filename #(linux中所有都是文件,dir)ubuntu設(shè)定默認(rèn)關(guān)聯(lián)程序
右鍵點(diǎn)擊所需要關(guān)聯(lián)打開(kāi)方式的文件,選擇“屬性” ,“打開(kāi)方式” 即可以選擇默認(rèn)打開(kāi)的程序
要進(jìn)入可執(zhí)行文件的目錄,比如 rails
cd $(dirname $(which rails))ubuntu terminal 顯示路徑太長(zhǎng),怎么設(shè)置變短
$: vi ~/.bashrc
這個(gè)文件記錄了用戶終端配置 找到
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由小寫(xiě)改成大寫(xiě),可以表示只顯示當(dāng)前目錄名稱.
代碼行數(shù)分析
代碼行數(shù)分析工具 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
記錄目錄使用的頻率,快速選擇、跳轉(zhuǎn)
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.
轉(zhuǎn)載于:https://my.oschina.net/xieyunzi/blog/160746
總結(jié)
- 上一篇: .net常見面試題(三)
- 下一篇: Linux Tomcat 安装