常用命令:
cd
ll / ls / ls -ld
查看进程:
杀掉某个进程:
kill -9 进程号
killall -9 服务名
查看端口占用情况:
创建目录:mkdir 名称
创建文件:
删除:
移动:
拷贝
切换用户:su root ---root用户切换到其他用户不需要密码
whoami:当前用户
ifconfig:查看ip
测试连接情况:ping
清屏:clear
一.查找类命令:
find: find 查找位置 查找参数
参数有:
-name find / -name *conf
-perm find / -perm 777
-user
-group
-ctime
-type find / -type d
-size
which python 查找系统命令
whereis python whereis命令只能用于程序名的搜索
二.查看:
cat 显示所有的文件内容
head -n 不指定-n默认为10行 ---练习
more 向下翻页 ---练习
less 向上翻页 ---练习
tail -f / tail -n 显示的行数
vim
二.归档类:
tar
tar -cvf 归档后的名 文件路径
tar -xvf 解归档的tar文件
-z参数是对归档的文件进行gzip的压缩以减少大小
gzip gzip myfile.txt 原来的文件则没有了,压缩文件为myfile.txt.gz
zip zip xxx.zip xxx路径
unzip unzip xxx.zip
三.关机重启:
关机:
poweroff 立即关机
shutdown -h now 立即关机
shutdown -h+10 10分钟后关机
shutdown -h 23:00 23点关机
四.日期时间:
date 显示当前时间
date -s "2019-08-22 11:11:11" 修改日期时间,日期和时间要用双引号引起来,只修改时间可以不用引起来
五:权限