博文

目前显示的是 九月, 2023的博文

Data Storage Types: File, Block, & Object

图片
        File stored in a hierarchical structure.(文件以层次结构存储) NFS和SAMBA都是通信协议,NFS比SAMBA服务器快速且方便 NFS:Network File System 主要配置文件:/etc/exports (导出) 重新处理exports里面的文件:exportfs 查看其它主机的可使用资源: # showmount -e 192.168.233.138 Export list for 192.168.233.138: /tmp *  NFS文件挂载: #umount /home/nfs #mount -t nfs -o nosuid,noexec,nodev,rz 192.168.233.138:/tmp /home/nfs # df -h Filesystem            Size  Used Avail Use% Mounted on .... 192.168.233.138:/tmp   18G  4.8G   12G  30% /home/nfs NFS主要通过RPC来进行文件共享,server和client都要启动rpcbind。 rpcbind启动的port在111,同时启动UDP与TCP。 NFS本身的服务启动在port 2049上。 exportfs用在NFS Server端,而showmount主要用在Client端。 CIFS:Common Internet File System, CIFS仅适用Windows,是公共的或开放的SMB协议版本,由微软公司使用,它使程序可以访问远程Internet计算机上的文件并要求此计算机提供服务。通过CIFS协议,可实现Windows系统主机之间的网络文件共享。 CIFS(Common Internet File System)是一种用于在计算机之间共享文件和打印机的网络协议。最初由微软开发,并成为Windows操作系统的默认文件共享协议。CIFS协议基于客户端/服务器模型,其中客户端通过CIFS协议向服务器请求访问共享资源。CIFS协议支持无域环境和域...

Robots.txt

 # curl https://blog.vben.site/robots.txt User-agent: Mediapartners-Google Disallow:  User-agent: * Disallow: /search Allow: / Sitemap: https://blog.vben.site/sitemap.xml 解析: Sitemap:列举网站的重要页面

find命令

$ find . -name "*.txt" -exec echo {} + ./tablename.txt ./ch05.txt ./file.txt $ find . -name "*.txt" -exec echo {} \; ./tablename.txt ./ch05.txt ./file.txt 结果分隔符使用加号(+):所有结果拼接(concatenated)一起传递,只会调用一次echo 结果分隔符使用分号(;):分别传递,对每个结果调用一次echo,须和\结合使用,不希望shell解析它

sed基础

图片
$ cat data5.txt  This is a test line. This is a different line.  设置sed选项和动作为空,直接输出到STDOUT: $ sed '' data5.txt  This is a test line. This is a different line. 按行执行,在默认输出的基础上p: $ sed 'p' data5.txt  This is a test line. This is a test line. This is a different line. This is a different line. p指明打印替换后的行: $ sed 's/test/trial/p' data5.txt  This is a trial line.  (p指明打印替换后的行) This is a trial line. This is a different line. silent/quiet 模式:指默认输出不要输出 $ sed -n 's/test/trial/p' data5.txt  😇 This is a trial line. $ echo "this is a test" | sed 'p' this is a test this is a test $ echo "this is a test" | sed -n 'p' this is a test 设置字符边界 use the word-boundary expression ( \b ) at both ends of the search string. This ensures the partial words are not matched. $ cat file.txt  123 Foo foo foo  foo /bin/bash Ubuntu foobar 456 $ sed -i 's/\bfoo\b/linux/g' file.txt $ cat file.txt  123 Foo linux linux  linux /bin/bash Ubuntu foobar ...