用户操作:
adduser xxx
userdel -r xxx
usermod -g 1003 terry
su - 用户名:切换用户
文件操作:
mkdir dir1
mkdir dir1 dir2
mkdir -p dir/dir1
touch a.txt
touch a.txt b.txt
touch dir/a.txt
echo “hello” >> a.txt
stat a.txt
rm a.txt
rm -r dir
cp a.txt b.txt
cp -r dir1 dir2
mv e.txt dir1
mv dir1 dir2
.gz
gzip a.txt
gunzip a.gz
.bz2
bzip2 a.txt
bunzip2 a.bz2
zip
zip all.zip *.txt
unzip all.zip
其他格式
tar xvf node.tar.xz
x:解压/拆档
v:打印过程
f:指定文件
软件安装:
apt:
apt install xxx
解压安装:
1.本地
1.下载
2.上传到linux上
3.解压
2.在linux下载
1.复制下载链接
2.$ wget 链接地址
3.解压
权限的操作:
1.表达式
chmod o/g/u +/- /w/r/x a.txt
2.数字
644
6:user:rw-
4:group:r–
4:other:r–
chmod -R 644 demo:
其他命令:
ls
ls /home
ls -l
ls -a
cd ~/ …/ /home
clear
more
more a.txt >> b.txt
tail
head
pwd
man
find /etc -name ‘a.txt’
grep terry a.txt
sleep 1000s &
ps -ef:
ps -ef | grep xxx
kill -9 pid
sudo:
sudoers:
root All
vi:
1.打开vi
vi
:w a.txt
vi a.txt
vi +n a.txt
2.三种模式
命令行
:插入
ioas/IOAS
:底行模式
: /
命令:
dd
ndd
yy
p
u
插入模式:
:命令行
esc
底行模式
1.切换
:命令行:esc
2.命令
:w
:q
:wq
:q!
:wq!
:set nu
:set nonumber
/tom
n
:1,5co10/$
:1,5m10/$
1,5s/tom/8888/ig
3.配置vi
1>
手动
~/.vimrc
set nu
...
2>
自动
github:第三方插件