1.
tty - print the file name of the terminal connected to standard input
2.
批量替换文件中的字符串:
sed -i "s/hello/DM/g" `grep hello -rl .`
3.
如何判断CPU是否为64位?
uname -a
getconf LONG_BIT
判断CPU是否支持64位:cat /proc/cpuinfo | grep flags | grep lm 如果有lm,则表示支持64
4.
who: who "show logined user"
whoami: whoami "show who am I"
whereis: whereis command "show where is the command" programer command
5. time program "calculate program run time"
$ time cd
real 0m0.001s
user 0m0.000s
sys 0m0.000s
6.route:
route del default “delete default router”
route add default gw 192.168.1.1 metric 1 “add 192.168.1.1 as a default route”
7.
adduser: adduser id "add a new user"
userdel: userdel id "delete user id"
userlist: userlist "list logined user"
passwd:
passwd id "change id's login password"
passwd -d id "delete id's login password"
8. sudo dhclient eth0
9. chown xufeng:xufeng <filename>