|
以前学习linux的记录,备份到博客园
1.提权操作-》 su root
2.退出 exit
3.主机名 hostname
4.输出内核名称:(1)uname(等同于 uname -s) (2)uname -a (所有信息)(3)uname -r(内核release 版本)
5. command hou tai yunxing
6.历史操作记录 history
7.反向搜索命令 ctrl +r (tips:多条结果多按几次ctrl+r)
8.授权操作 sudo
9.当前所在路径 :pwd
10.创建新文件或者更新时间 touch {filename}
11. ls -a,-l,-R,-ld "dir"
12.查看文件信息(编码方式): file {filename}
13.复制文件命令 cp {origin_file} {after_file} 复制文件夹命令 cp -r -v(detail infomation) {origin_dir} {after_dir}
14. 移动或重命名一个文件mv
15.日期命令 date +%Y--%m--%d
hwclock(root 用户,获取硬件时间), cal(calendar 日历),uptime(查看系统负载的)
16.输出文件信息 cat file
more file ,less file
head -3 file(前三行)
tail -n file(最后n行)
17.查看PCI设备 lspci -v
18.查看usb设备 lsusb -v
19.查看所有模块 lsmod drivers
20。关机 shutdown -h ,-r(-r表示reboot)
shutdowm -h now,+10,23:30
shutdown -r now
poweroff
reboot
21.压缩命令 zip .zip from
unzip file
tar -cvf out.tar from//gui dang
tar -xvf out.tar//jie dang
tar -cvzf out.tar.gz from
22.locate fast find updatedb
23.查找命令 find "location" "attribution"
find . -name *first*
find / -perm 777
find / -type d
find / -l
find / -name "a*" -exec "option" {} \
24vim操作 vim three mode
1. i,oinsert new line,dddelete one
line,uchexiao,yyduplicate,pzhantie
vim => i ,esc =>
3.:enter ex mode :w,:q,:q!,:x,:wq,:set number,:!
"commmand",:sh
|