标签:文件 curl 网络 netca files ash get 管理器 ctr
shell基础
帮助文档
man
--help
目录及文件的基本操作
intbjw@moew:~$ pwd
/home/intbjw
intbjw@moew:~$ cd /
intbjw@moew:/$ ls
bin boot dev etc home init lib lib64 media mnt opt proc root run sbin snap srv sys tmp usr var
intbjw@moew:/$ ls -la
total 580
drwxr-xr-x 1 root root 512 Mar 27 10:27 .
drwxr-xr-x 1 root root 512 Mar 27 10:27 ..
drwxr-xr-x 1 root root 512 Mar 27 10:33 bin
drwxr-xr-x 1 root root 512 Mar 5 00:08 boot
drwxr-xr-x 1 root root 512 Mar 30 10:42 dev
drwxr-xr-x 1 root root 512 Mar 30 10:42 etc
drwxr-xr-x 1 root root 512 Mar 27 10:27 home
-rwxr-xr-x 1 root root 591344 Jan 1 1970 init
drwxr-xr-x 1 root root 512 Mar 29 16:30 lib
drwxr-xr-x 1 root root 512 Mar 4 23:53 lib64
drwxr-xr-x 1 root root 512 Mar 4 23:52 media
drwxr-xr-x 1 root root 512 Mar 27 10:27 mnt
drwxr-xr-x 1 root root 512 Mar 28 14:43 opt
dr-xr-xr-x 9 root root 0 Mar 30 10:42 proc
drwx------ 1 root root 512 Mar 27 16:08 root
drwxr-xr-x 1 root root 512 Mar 30 10:42 run
drwxr-xr-x 1 root root 512 Mar 29 16:30 sbin
drwxr-xr-x 1 root root 512 Oct 30 20:17 snap
drwxr-xr-x 1 root root 512 Mar 4 23:52 srv
dr-xr-xr-x 12 root root 0 Mar 30 10:42 sys
drwxrwxrwt 1 root root 512 Mar 30 10:53 tmp
drwxr-xr-x 1 root root 512 Mar 27 18:26 usr
drwxr-xr-x 1 root root 512 Mar 5 00:02 var
intbjw@moew:/$ cd home/intbjw/
intbjw@moew:~$ touch hello.txt
intbjw@moew:~$ mkdir test
intbjw@moew:~$ mkdir -p test/sdasd
intbjw@moew:~$ ls
KDD99-CNN hello.txt test
intbjw@moew:~$ tree
.
├── KDD99-CNN
│?? ├── README.md
│?? ├── ids_kdd99.ipynb
│?? ├── ids_kdd99.py
│?? ├── models
│?? │?? └── resnet
│?? │?? ├── assets
│?? │?? ├── saved_model.pb
│?? │?? └── variables
│?? │?? ├── variables.data-00000-of-00001
│?? │?? └── variables.index
│?? ├── my_model.h5
│?? ├── my_model28.h5
│?? ├── run_mymodel.py
│?? └── save_models
├── hello.txt
└── test
└── sdasd
8 directories, 10 files
intbjw@moew:~$ cp hello.txt hello.txt.bak
intbjw@moew:~$ rm hello.txt.bak
intbjw@moew:~$ mv hello.txt hello.doc
intbjw@moew:~$ mv hello.doc test/
intbjw@moew:~$ find -name hello.doc
./test/hello.doc
intbjw@moew:~$ du -sh /home/intbjw/
2.9G /home/intbjw/
intbjw@moew:~$ df -hT
Filesystem Type Size Used Avail Use% Mounted on
rootfs lxfs 115G 102G 14G 89% /
none tmpfs 115G 102G 14G 89% /dev
none tmpfs 115G 102G 14G 89% /run
none tmpfs 115G 102G 14G 89% /run/lock
none tmpfs 115G 102G 14G 89% /run/shm
none tmpfs 115G 102G 14G 89% /run/user
cgroup tmpfs 115G 102G 14G 89% /sys/fs/cgroup
C:\ drvfs 115G 102G 14G 89% /mnt/c
D:\ drvfs 51G 31G 20G 61% /mnt/d
E:\ drvfs 138G 39G 99G 29% /mnt/e
F:\ drvfs 140G 11G 129G 8% /mnt/f
G:\ drvfs 140G 95G 45G 69% /mnt/g
查看文件内容
cat
more
less
head
tail
wc
grep
echo
命令别名
alias
unlias
环境变量
env
set
export
declare
排序命令
sort
uniq
wc
cat /etc/passwd | sort -t":" k -3
IO和重定向
0 1 2
stdout
多重指令
cmd;cmd cmd&&cmd cmd||cmd
vim
三种状态
安装包安装
rpm install
rpm -qa
rpm -Va
rpm erase
网络
ifconfig traceroute
scp 从远端->近端
ssh
rsync 同步,网络命令
namp
netcat
a:nc -lp port
b:nc ip port -c bash
wget curl ss
tcpdump iptables ping
SUID权限 S权限
file查看文件的类型
压缩及解压
gzip
gzip hello.txt
gzip -d hello.txt
bzip2
bzip2 hello.txt
bzip2 -d hello.txt
tar
tar -cf etc.tar /etc/
tar -czf boot.tar.gz /boot/
tar -xvf
命令使用技巧
善用Tab键
使用命令历史 !500
适时清屏 Ctrl+l或者clear
查找常用命令存储位置 which
账户与安全
useradd 创建新用户
groupadd 创建组用户
id 显示账户及组信息
passwd 更新账号认证信息
usermod 修改用户信息
userdel 删除账户及相关文件
groupdel 删除组账户
账户与组文件解析
cat /etc/passwd #账户信息
cat /etc/shadow #账户密码文件
cat /etc/group #组账户信息
cat /etc/gshadow#组账户密码
gpasswd admin
gpasswd -A mail admin
修改Linux文件属性
intbjw@moew:/$ ls -la
total 580
drwxr-xr-x 1 root root 512 Mar 27 10:27 .
drwxr-xr-x 1 root root 512 Mar 27 10:27 ..
drwxr-xr-x 1 root root 512 Mar 27 10:33 bin
drwxr-xr-x 1 root root 512 Mar 5 00:08 boot
drwxr-xr-x 1 root root 512 Mar 30 10:42 dev
drwxr-xr-x 1 root root 512 Mar 30 10:42 etc
drwxr-xr-x 1 root root 512 Mar 27 10:27 home
-rwxr-xr-x 1 root root 591344 Jan 1 1970 init
drwxr-xr-x 1 root root 512 Mar 29 16:30 lib
drwxr-xr-x 1 root root 512 Mar 4 23:53 lib64
drwxr-xr-x 1 root root 512 Mar 4 23:52 media
drwxr-xr-x 1 root root 512 Mar 27 10:27 mnt
drwxr-xr-x 1 root root 512 Mar 28 14:43 opt
dr-xr-xr-x 9 root root 0 Mar 30 10:42 proc
drwx------ 1 root root 512 Mar 27 16:08 root
drwxr-xr-x 1 root root 512 Mar 30 10:42 run
drwxr-xr-x 1 root root 512 Mar 29 16:30 sbin
drwxr-xr-x 1 root root 512 Oct 30 20:17 snap
drwxr-xr-x 1 root root 512 Mar 4 23:52 srv
dr-xr-xr-x 12 root root 0 Mar 30 10:42 sys
drwxrwxrwt 1 root root 512 Mar 30 10:53 tmp
drwxr-xr-x 1 root root 512 Mar 27 18:26 usr
drwxr-xr-x 1 root root 512 Mar 5 00:02 var
#权限主要分为读、写、执行三种控制
r(读权限)、w(写权限)、x(执行权限)
chgrp
chown #修改文件或目录的拥有者与所属组
chmod #修改文件属性
umask
chattr
进程查看
ps -l
ps -aux
资源管理器
top
系统服务
crontab #计时任务
kill #杀进程
等等
系统资源
free #查看内存
uname #核心
dmesg #分析核心
vmstat#系统资源变化
未完待续
标签:文件 curl 网络 netca files ash get 管理器 ctr
原文地址:https://www.cnblogs.com/intbjw/p/12597708.html