ubuntu常用命令记录

显示文件内容,less命令

[python] view plain copy
  1. > less /etc/passwd  

修改运行级别,init命令

[python] view plain copy
  1. # restart  
  2. > sudo init 6  
  3. # shutdown  
  4. > sudo int 0   

重启,reboot命令

[python] view plain copy
  1. > sudo reboot  
关机,shutdown命令
[python] view plain copy
  1. # now is shutdown time  
  2. > sudo shutdown now  

显示启动消息,dmesg命令

[python] view plain copy
  1. # | is pipeline  
  2. > dmesg | less  

显示工作目录名称,pwd命令

[python] view plain copy
  1. > pwd  
显示终端类型命令,echo命令
[python] view plain copy
  1. #TERM is env var  
  2. > echo $ TERM  
输出环境变量,printenv命令
[python] view plain copy
  1. # print stands for display.  
  2. > printenv  

查看文件,cat命令
[python] view plain copy
  1. > cat /etc/termcap  

显示键映射,stty命令
[python] view plain copy
  1. # stty is 'set terminal'  -a means 'all'  
  2. > stty -a  
  3. # stty show the changes  
  4. > stty  
  5. # change kill signal to ^U  
  6. > stty kill ^U  

将终端恢复为默认值,stty sane/reset命令
[python] view plain copy
  1. <Ctrl-J>stty sane<Ctrl-J>  
  2. <Ctrl-J>reset<Ctrl-J>  

查看系统是否安装特定程序,which命令

[python] view plain copy
  1. > which date  
  2. > which date less vi emacs  
查看系统是否安装特定程序,type命令
[python] view plain copy
  1. # for Bash  
  2. > type date  
查看系统是否安装特定程序,whence命令
[python] view plain copy
  1. # for Korn shell  
  2. > whence date  

显示时间和日期,date命令
[python] view plain copy
  1. # default  
  2. > date  
  3. # UTC  
  4. > date -u  
显示日历,cal命令
[python] view plain copy
  1. # this month  
  2. > cal  
  3. # some year  
  4. > cal 1952  
  5. # the year the month  
  6. > cal 12 1952  
  7. # the number day in the year  
  8. > cal -j 12 2009  

提醒服务,calendar命令
[python] view plain copy
  1. # for the calendar file  
  2. > calendar  
显示系统运行多长时间,uptime命令
[python] view plain copy
  1. > uptime  

查看计算机名称,hostname命令
[python] view plain copy
  1. > hostname  

显示操作系统名称,uname命令
[python] view plain copy
  1. > uname  
  2. # -a option for all information  
  3. > uname -a   

显示登录使用的用户标识,whoami命令
[python] view plain copy
  1. > whoami  
  2. > who am i  

显示自己信息的命令,quota命令

[python] view plain copy
  1. > quota  

查看登录用户,users命令
[python] view plain copy
  1. > users  

查看登录用户,who命令
[python] view plain copy
  1. > who  

查看登录用户,w命令
[python] view plain copy
  1. > w  

终端临时上锁,lock命令
[python] view plain copy
  1. > lock  
  2. # change the lock time  
  3. > lock -5  
离开提醒,leave命令
[python] view plain copy
  1. > leave  
  2. # add the time  
  3. > leave 1030  
  4. # interval  
  5. > leave +15  

内置计算器,bc命令
[python] view plain copy
  1. > bc  
  2. # -l option for library  
  3. > bc -l  
  4. # below in the bc  
  5.   
  6. 13 + 15  
  7.   
  8. 10 + 10;20 + 20  
  9. # scale factor  
  10. scale=3  
  11. scale  
  12. # for var  
  13. w=12  
  14. r=w*3  
  15. d=w/2  
  16. r+d  
  17. # ibase var,obase var  
  18. obase=2;ibase=16  
  19. FFC1  

桌面计算器,dc命令
[python] view plain copy
  1. # RPN Reverse Polish notation  
  2. > dc  
  3. # below in the dc  
  4.   
  5. 34 25 + 15 *  
  6. p  
  7. f  
  8. # precise  
  9. 14 k  
  10. K p  

显示命令的说明书页,man命令

[python] view plain copy
  1. > man kill  
  2. > man 2 kill  
  3. > man -s 2 kill  
  4. > man 3f kill  
  5. > man intro  

快速查询命令作用,whatis命令
[python] view plain copy
  1. > man -f time date  
  2. > whatis time date  
  3. > whatis intro  

搜索命令,apropos命令
[python] view plain copy
  1. > man -k manual  
  2. > apropos manual  

Info系统查看,info命令
[python] view plain copy
  1. > info date  
  2. > info --help | less  
  3. > man info  
  4. > info info  

改变登录shell,chsh命令
[python] view plain copy
  1. # change shell   
  2. # chsh [-s shell] [userid]  
  3. > chsh -s /bin/tcsh 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值