创建文件夹
mkdir japan
创建文件
touch guizi
touch rikou hanjian
touch "bash file"
查看文件
cat filename
cat -n filename
tac filename
more filename
less filename
head -n filename
tail -n filename
tail -f filename
链接文件
ln -s filename filename.soft
ln filename filename.hard
硬链接 = cp -p + 同步更新
权限管理命令
chmod u/g/o/a +/-/= r/w/x filename
chmod u/g/o/a +/-/= r/w/x dir -R
r = 4
w = 2
x = 1
chmod 640 filename
r : cat/more/tail/head/less
w : vim
x : script/command
r : ls
w : touch/mkdir/rm
x : cd
文件所有者
chown username filename
chown username dir
hn ```
# 文件group
` ``bash
chgrp groupname filename/dir
文件搜索
find 搜索范围 匹配条件
find dir -name file
find dir -name *init*
find dir -name init???
find dir -iname *init*
fina dir -size +/= /- 2048
find dir -user username
fin /etc -size +163840 -a -size -204800;
文件查找
locate filename
命令查找
which commandname
whereis commandname
找到某st r
grep string filename
grep -i string filename
grep -v string filename
帮助命令
man command
man ls
info command
info ls
help if
用户
useradd name
passwd name
who
w
uptime
压缩
gzip filename
gzip -d filename.gz
tar -cvf dir.tar dir
tar -xvf dir.tar dir
tar -cvf dir.tar dir
gzip dir.tar
tar -zcvf dir.tar.gz dir
tar -zxvf dir.tar.gz
zip filename.zip filename
zip -r dir.zip dir
unzip filename.zip
unzip -r dir.zip
bzip2 -k dir
bunzip2 -k dir.bz2
网络命令
ping ip
ping -c number ip
ifconfig
关机重启
shutdown -h 时间
shutdown -r 时间
shutdown -c 时间