标签:bsp tor 查看 boot tab 资料 文件 不用 根据
[root@localhost home]# stat passwd File: ‘passwd’ Size: 795 Blocks: 8 IO Block: 4096 regular file Device: fd00h/64768d Inode: 19087983 Links: 1 Access: (0644/-rw-r--r--) Uid: ( 0/ root) Gid: ( 0/ root) Context: unconfined_u:object_r:home_root_t:s0 Access: 2020-05-10 15:23:17.576572669 -0400 Modify: 2020-05-10 15:23:17.576572669 -0400 Change: 2020-05-10 15:23:17.579572669 -0400 Birth: -
[root@A /]# cp /etc/passwd /opt/ [root@A /]# cp /boot/vm* /opt/ [root@A /]# cp -r /boot/ /opt/ [root@A /]# cp -r /etc/shadow /mnt/ /opt/ [root@A /]# \cp -r /boot/ /opt/ #覆盖文件时,如果目标位置已经存在该文件,系统会询问我们是否覆盖,需要输入y来确认,加入\存在时就不用询问直接操作
[root@A /]# touch /opt/1.txt [root@A /]# mkdir /opt/abc [root@A /]# ls /opt/ 1.txt abc [root@A /]# rm -rf /opt/* [root@A /]# ls /opt/
[root@A /]# mkdir /opt/nsd01 [root@A /]# touch /opt/1.txt [root@A /]# ls /opt/ 1.txt nsd01 [root@A /]# mv /opt/1.txt /opt/nsd01 [root@A /]# ls /opt/ #移动后/opt下不存在1.txt文件 nsd01 [root@A /]# ls /opt/nsd01 1.txt #重命名:路径不变的移动 [root@A /]# mv /opt/test /opt/haha #/test另起文件名/haha
[root@localhost etc]# basename /usr/local/nginx/conf/nginx.conf nginx.conf [root@localhost etc]# dirname /usr/local/nginx/conf/nginx.conf /usr/local/nginx/conf
[root@localhost etc]# which ls alias ls=‘ls --color=auto‘ /usr/bin/ls [root@localhost etc]# which dirname /usr/bin/dirname [root@localhost etc]# which find /usr/bin/find
[root@localhost /]# whereis passwd passwd: /usr/bin/passwd /etc/passwd /usr/share/man/man1/passwd.1.gz
[root@localhost /]# locate passwd /etc/passwd /etc/passwd- /etc/pam.d/passwd /etc/security/opasswd /home/passwd
[root@server0 ~]# find /etc/ -name "*.conf" [root@server0 ~]# find /etc/ -name "passwd" [root@server0 ~]# find /boot -type d [root@server0 ~]# find /boot -type l [root@server0 ~]# find /boot -type f [root@server0 ~]# find /root/ -name "nsd*" [root@server0 ~]# find /root/ -name "nsd*" -type f [root@server0 ~]# find /root/ -name "nsd*" -type d [root@server0 ~]# find /boot/ -size +20M #查找20M以上的文件 [root@server0 ~]# ls -lh /boot/initramfs-* [root@server0 ~]# find /boot/ -size -20M [root@server0 ~]# useradd lisi [root@server0 ~]# useradd zhangsan [root@server0 ~]# ls -l /home/ [root@server0 ~]# find /home -user zhangsan [root@server0 ~]# find /home -user lisi [root@server0 ~]# find / -user lisi
# rm -rf /opt/* # find /boot/ -size +10M # find /boot/ -size +10M -exec cp {} /opt \; #找到的结果复制到/opt下 # ls /opt/ # mkdir /root/findfiles # find / -user lisi -type f -exec cp {} /root/findfiles \; # ls -A /root/findfiles/
[root@server0 ~]# grep ‘root‘ /etc/passwd [root@server0 ~]# grep -v ‘root‘ /etc/passwd #取反 [root@server0 ~]# grep ‘ROOT‘ /etc/passwd [root@server0 ~]# grep -i ‘ROOT‘ /etc/passwd #忽略大小写 [root@server0 ~]# grep ‘seismic‘ /usr/share/dict/words # grep ‘seismic‘ /usr/share/dict/words > /root/wordlist #找出来相匹配的并导出 # cat /root/wordlist
^word 以字符串word开头 word$ 以字符串word结尾 [root@server0 ~]# grep ‘^root‘ /etc/passwd [root@server0 ~]# grep ‘root$‘ /etc/passwd [root@server0 ~]# grep ‘bash$‘ /etc/passwd
匹配空行 [root@server0 ~]# grep -v ‘^$‘ /etc/default/useradd
标签:bsp tor 查看 boot tab 资料 文件 不用 根据
原文地址:https://www.cnblogs.com/cp-linux/p/12904667.html