标签:pack apr str package libs 小数 word 在线 pcre
[root@lei ~]# cat a /
123
456
789
[root@lei ~]# sed ‘s/123/321/g‘ a
321
456
789
[root@lei ~]# cat a
123
456
789
[root@lei ~]# sed -i ‘s/123/321/g‘ a
[root@lei ~]# cat a
321
456
789
[root@lei ~]# sed -i ‘1alei‘ a
[root@lei ~]# cat a
321
lei
456
789
[root@lei ~]# sed ‘/^lei/ahaha‘ a
321
lei
haha
456
789
[root@lei ~]# sed -i ‘1ihehe‘ a
[root@lei ~]# cat a
hehe
321
lei
456
789
[root@lei ~]# sed -i ‘1c123456‘ a
[root@lei ~]# cat a
123456
321
lei
456
789
[root@lei ~]# sed -i ‘1d‘ a
[root@lei ~]# cat a
321
lei
456
789
[root@lei ~]# cat a
321
lei
456
789
[root@lei ~]# sed -n ‘1p‘ a
321
[root@lei ~]# sort -n ab
1 2 3
1 3 5
1 5 6
4 5 6
8 9 1
10 11 12
[root@lei ~]# sort -nr ab
10 11 12
8 9 1
4 5 6
1 5 6
1 3 5
1 2 3
[root@lei ~]# sort -nk2 ab
1 2 3
1 3 5
1 5 6
4 5 6
8 9 1
10 11 12
[root@lei ~]# cat abc
a:x:1:2:3
b:x:0:8:5
c:x:5:6:3
d:c:4:2:0
[root@lei ~]# sort -n -t: -k3 abc
b:x:0:8:5
a:x:1:2:3
d:c:4:2:0
c:x:5:6:3
[root@lei ~]# cat ab
10 11 12
1 3 5
1 2 3
4 5 6
1 2 3
1 5 6
4 5 6
8 9 1
[root@lei ~]# sort -nu ab
1 3 5
4 5 6
8 9 1
10 11 12
[root@lei ~]# sort -n ab|uniq -c
1 1 2 3
1 1 2 3
1 1 3 5
1 1 5 6
2 4 5 6
1 8 9 1
1 10 11 12
[root@lei ~]# cat ab
1 3 5
1 2 3
1 3 5
1 5 6
8 9 1
10 11 12
[root@lei ~]# sort -n ab|uniq -d
1 3 5
[root@lei ~]# cat ab
1 3 5
1 2 3
1 3 5
1 5 6
8 9 1
10 11 12
[root@lei ~]# sort -n ab|uniq -u
1 2 3
1 5 6
8 9 1
10 11 12
[root@lei ~]# wc ab
6 18 39 ab
[root@lei ~]# cat ab
1 3 5
1 2 3
1 3 5
1 5 6
8 9 1
10 11 12
[root@lei ~]# cat ab|wc -c
39
[root@lei ~]# cat ab|wc -l
6
[root@lei ~]# cat ab|wc -w
18
[root@lei ~]# dd if=/dev/zero of=test bs=1024M count=1
1+0 records in
1+0 records out
1073741824 bytes (1.1 GB, 1.0 GiB) copied, 3.05442 s, 352 MB/s
[root@lei ~]# ls
a ab abc anaconda-ks.cfg test
[root@lei ~]# du -h test //-h是human-readable 可读
1.0G test
[root@lei ~]# du -s /root/
1048616 /root/
[root@lei ~]# du -sh /tmp/
4.0K /tmp/
[root@lei ~]# df
Filesystem 1K-blocks Used Available Use% Mounted on
devtmpfs 904116 0 904116 0% /dev
tmpfs 921916 0 921916 0% /dev/shm
tmpfs 921916 8784 913132 1% /run
tmpfs 921916 0 921916 0% /sys/fs/cgroup
/dev/mapper/rhel-root 52403200 2733576 49669624 6% /
/dev/nvme0n1p1 1038336 182824 855512 18% /boot
/dev/mapper/rhel-home 49209880 376152 48833728 1% /home
tmpfs 184380 0 184380 0% /run/user/0
[root@lei ~]# df -h
Filesystem Size Used Avail Use% Mounted on
devtmpfs 883M 0 883M 0% /dev
tmpfs 901M 0 901M 0% /dev/shm
tmpfs 901M 8.6M 892M 1% /run
tmpfs 901M 0 901M 0% /sys/fs/cgroup
/dev/mapper/rhel-root 50G 2.7G 48G 6% /
/dev/nvme0n1p1 1014M 179M 836M 18% /boot
/dev/mapper/rhel-home 47G 368M 47G 1% /home
tmpfs 181M 0 181M 0% /run/user/0
[root@lei ~]# df -i
Filesystem Inodes IUsed IFree IUse% Mounted on
devtmpfs 226029 350 225679 1% /dev
tmpfs 230479 1 230478 1% /dev/shm
tmpfs 230479 551 229928 1% /run
tmpfs 230479 17 230462 1% /sys/fs/cgroup
/dev/mapper/rhel-root 26214400 33438 26180962 1% /
/dev/nvme0n1p1 524288 301 523987 1% /boot
/dev/mapper/rhel-home 24616960 3 24616957 1% /home
tmpfs 230479 5 230474 1% /run/user/0
1.hostname //查看或临时修改主机名,重开终端有效,重启失效
[root@lei ~]# hostname
lei
[root@lei ~]# hostname lc
[root@lei ~]# bash
[root@lc ~]# reboot
[root@lei ~]#
[root@lei ~]# hostnamectl set-hostname lc
[root@lei ~]# bash
[root@lc ~]#
[root@lc ~]# time cat /etc/hostname
lc
real 0m0.002s
user 0m0.001s
sys 0m0.001s
2.clear //清屏 Ctrl+L
[root@lc ~]#clear
[root@lc ~]#
[root@lc ~]# whoami
root
[root@lc ~]# w
21:33:01 up 16 min, 1 user, load average: 0.00, 0.00, 0.00
USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT
root pts/0 192.168.91.1 21:16 1.00s 0.01s 0.01s w
[root@lc ~]# who
root pts/0 2020-11-05 21:16 (192.168.91.1)
6.which ls //显示指令的绝对路径
[root@lc ~]# which is
/usr/bin/which: no is in (/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin)
7.date //显示或设置日期时间,不带参数的date用于显示当前系统日期时间
[root@lc ~]# date
Thu Nov 5 21:32:21 CST 2020
8.y-m-d-H-M-S //显示:年月日-时分秒 date -s以字符串方式设置时间
[root@lc ~]# date -s ‘2020-11-5 21:34:10‘
Thu Nov 5 21:34:10 CST 2020
[root@lc ~]# date ‘+%y‘ //年
20
[root@lc ~]# date ‘+%m‘ //月
11
[root@lc ~]# date ‘+%d‘ //日
05
[root@lc ~]# date ‘+%H‘ //小时
21
[root@lc ~]# date ‘+%M‘ //分钟
35
[root@lc ~]# date ‘+%S‘ //秒钟
38
9.创建当前日期命名的文件
[root@lc ~]# mkdir $(date ‘+%y%m%d‘)
[root@lc ~]# ls
201105 a ab abc anaconda-ks.cfg test
[root@lc ~]# mkdir abc-$(date ‘+%H%M%S‘)
[root@lc ~]# ls
201105 a ab abc abc-214625 anaconda-ks.cfg test
10.cal //打印当前系统日历
[root@lc ~]# cal
November 2020
Su Mo Tu We Th Fr Sa
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30
[root@lc ~]# cal 10000 //一万年
10000
January February
Su Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa
1 1 2 3 4 5
2 3 4 5 6 7 8 6 7 8 9 10 11 12
9 10 11 12 13 14 15 13 14 15 16 17 18 19
16 17 18 19 20 21 22 20 21 22 23 24 25 26
23 24 25 26 27 28 29 27 28 29
30 31
March April
Su Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa
1 2 3 4 1
5 6 7 8 9 10 11 2 3 4 5 6 7 8
12 13 14 15 16 17 18 9 10 11 12 13 14 15
19 20 21 22 23 24 25 16 17 18 19 20 21 22
26 27 28 29 30 31 23 24 25 26 27 28 29
30
May June
Su Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa
1 2 3 4 5 6 1 2 3
7 8 9 10 11 12 13 4 5 6 7 8 9 10
14 15 16 17 18 19 20 11 12 13 14 15 16 17
21 22 23 24 25 26 27 18 19 20 21 22 23 24
28 29 30 31 25 26 27 28 29 30
July August
Su Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa
1 1 2 3 4 5
2 3 4 5 6 7 8 6 7 8 9 10 11 12
9 10 11 12 13 14 15 13 14 15 16 17 18 19
16 17 18 19 20 21 22 20 21 22 23 24 25 26
23 24 25 26 27 28 29 27 28 29 30 31
30 31
September October
Su Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa
1 2 1 2 3 4 5 6 7
3 4 5 6 7 8 9 8 9 10 11 12 13 14
10 11 12 13 14 15 16 15 16 17 18 19 20 21
17 18 19 20 21 22 23 22 23 24 25 26 27 28
24 25 26 27 28 29 30 29 30 31
November December
Su Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa
1 2 3 4 1 2
5 6 7 8 9 10 11 3 4 5 6 7 8 9
12 13 14 15 16 17 18 10 11 12 13 14 15 16
19 20 21 22 23 24 25 17 18 19 20 21 22 23
26 27 28 29 30 24 25 26 27 28 29 30
31
1.安装bc //记住先连接镜像,然后挂载光驱,ls查看有没有镜像然后用rpm -ivh安装
[root@lc ~]# mount /dev/cdrom /mnt
mount: /mnt: WARNING: device write-protected, mounted read-only.
[root@lc ~]# rpm -ivh /mnt/BaseOS/Packages/bc-1.07.1-5.el8.x86_64.rpm
warning: /mnt/BaseOS/Packages/bc-1.07.1-5.el8.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID fd431d51: NOKEY
Verifying... ################################# [100%]
Preparing... ################################# [100%]
Updating / installing...
1:bc-1.07.1-5.el8 ################################# [100%]
[root@lc ~]# which bc
/usr/bin/bc
[root@lc ~]# echo ‘scale=2;5/2‘|bc
2.50 //计算5除以2保留2位小数
[root@lc ~]# echo ‘scale=4;5/2‘|bc
2.5000 //计算2除以5保留5位小数
1.ldd查看ls命令依赖哪些库文件
[root@lc ~]# ldd /usr/bin/ls
linux-vdso.so.1 (0x00007ffe9c9fa000)
libselinux.so.1 => /lib64/libselinux.so.1 (0x00007f27b3bc2000)
libcap.so.2 => /lib64/libcap.so.2 (0x00007f27b39bc000)
libc.so.6 => /lib64/libc.so.6 (0x00007f27b35fa000)
libpcre2-8.so.0 => /lib64/libpcre2-8.so.0 (0x00007f27b3376000)
libdl.so.2 => /lib64/libdl.so.2 (0x00007f27b3172000)
/lib64/ld-linux-x86-64.so.2 (0x00007f27b4010000)
libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f27b2f
[root@lc ~]# mv /lib64/libselinux.so.1 /opt
[root@lc ~]# ls
ls: error while loading shared libraries: libselinux.so.1: cannot open shared object file: No such file or directory
[root@lc ~]# mv /opt/libselinux.so.1 /lib64/
mv: error while loading shared libraries: libselinux.so.1: cannot open shared object file: No such file or directory
[root@lc ~]# ldd /usr/bin/ls
linux-vdso.so.1 (0x00007ffd7375c000)
libselinux.so.1 => not found
libcap.so.2 => /lib64/libcap.so.2 (0x00007f2494f0a000)
libc.so.6 => /lib64/libc.so.6 (0x00007f2494b48000)
/lib64/ld-linux-x86-64.so.2 (0x00007f2495333000)
[root@lc ~]#
3.ln //软链接
[root@lc ~]# ln /opt/libselinux.so.1 /lib64/
[root@lc ~]# ls
201105 a ab abc abc-214625 anaconda-ks.cfg test
[root@lc ~]#
标签:pack apr str package libs 小数 word 在线 pcre
原文地址:https://www.cnblogs.com/leixixi/p/14202237.html