显示文件内容,less命令
- > less /etc/passwd
修改运行级别,init命令
- # restart
- > sudo init 6
- # shutdown
- > sudo int 0
重启,reboot命令
- > sudo reboot
- # now is shutdown time
- > sudo shutdown now
显示启动消息,dmesg命令
- # | is pipeline
- > dmesg | less
显示工作目录名称,pwd命令
- > pwd
- #TERM is env var
- > echo $ TERM
- # print stands for display.
- > printenv
查看文件,cat命令
- > cat /etc/termcap
显示键映射,stty命令
- # stty is 'set terminal' -a means 'all'
- > stty -a
- # stty show the changes
- > stty
- # change kill signal to ^U
- > stty kill ^U
将终端恢复为默认值,stty sane/reset命令
- <Ctrl-J>stty sane<Ctrl-J>
- <Ctrl-J>reset<Ctrl-J>
查看系统是否安装特定程序,which命令
- > which date
- > which date less vi emacs
- # for Bash
- > type date
- # for Korn shell
- > whence date
显示时间和日期,date命令
- # default
- > date
- # UTC
- > date -u
- # this month
- > cal
- # some year
- > cal 1952
- # the year the month
- > cal 12 1952
- # the number day in the year
- > cal -j 12 2009
提醒服务,calendar命令
- # for the calendar file
- > calendar
- > uptime
查看计算机名称,hostname命令
- > hostname
显示操作系统名称,uname命令
- > uname
- # -a option for all information
- > uname -a
显示登录使用的用户标识,whoami命令
- > whoami
- > who am i
显示自己信息的命令,quota命令
- > quota
查看登录用户,users命令
- > users
查看登录用户,who命令
- > who
查看登录用户,w命令
- > w
终端临时上锁,lock命令
- > lock
- # change the lock time
- > lock -5
- > leave
- # add the time
- > leave 1030
- # interval
- > leave +15
内置计算器,bc命令
- > bc
- # -l option for library
- > bc -l
- # below in the bc
- 13 + 15
- 10 + 10;20 + 20
- # scale factor
- scale=3
- scale
- # for var
- w=12
- r=w*3
- d=w/2
- r+d
- # ibase var,obase var
- obase=2;ibase=16
- FFC1
桌面计算器,dc命令
- # RPN Reverse Polish notation
- > dc
- # below in the dc
- 34 25 + 15 *
- p
- f
- # precise
- 14 k
- K p
显示命令的说明书页,man命令
- > man kill
- > man 2 kill
- > man -s 2 kill
- > man 3f kill
- > man intro
快速查询命令作用,whatis命令
- > man -f time date
- > whatis time date
- > whatis intro
搜索命令,apropos命令
- > man -k manual
- > apropos manual
Info系统查看,info命令
- > info date
- > info --help | less
- > man info
- > info info
改变登录shell,chsh命令
- # change shell
- # chsh [-s shell] [userid]
- > chsh -s /bin/tcsh