Linux 常用命令

来源:互联网 发布:88端口的作用是什么 编辑:程序博客网 时间:2024/05/16 11:59

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>


 


 

原创粉丝点击