首页 > 系统相关 >linux 中 readlink、realpath、find输出软链接文件绝对路径的差异

linux 中 readlink、realpath、find输出软链接文件绝对路径的差异

时间:2023-09-15 12:11:46浏览次数:52  
标签:test1 realpath pc1 readlink home txt root find testfile

 

001、

[root@pc1 test1]# ls      ## 三个测试文件
a.txt  b.txt  testfile
[root@pc1 test1]# ll -h
total 4.0K
lrwxrwxrwx. 1 root root 20 Sep 16 12:03 a.txt -> /home/test1/testfile
lrwxrwxrwx. 1 root root 20 Sep 16 12:03 b.txt -> /home/test1/testfile
-rw-r--r--. 1 root root 21 Sep 16 12:03 testfile
[root@pc1 test1]# readlink -f a.txt     ## readlink输出原始文件
/home/test1/testfile
[root@pc1 test1]# realpath a.txt         ## 输出原始文件
/home/test1/testfile
[root@pc1 test1]# find $PWD -name "a.txt"     ## 输出查找文件
/home/test1/a.txt

。 

 

标签:test1,realpath,pc1,readlink,home,txt,root,find,testfile
From: https://www.cnblogs.com/liujiaxin2018/p/17704746.html

相关文章

  • linux 中 find命令忽略大小写查找文件
     001、 -iname选项实现忽略大小写查找[root@pc1test1]#ls##测试文件a.txta.TXTc.csvc.tXtd.txte.Txtf.csvk.map[root@pc1test1]#find./-name"*.txt"##一般查找./a.txt./d.txt[root@pc1test1]#find./-iname"*......
  • 利用find命令按照创建、修改时间删除文件
    使用touch命令修改文件访问时间和修改时间:touch-t202301011200 Example.txt删除三十天前创建的时间find/path/to/dir-typef-ctime+5-delete 目前还不确定如何修改文件创建时间,但是可以利用上述find语句删除修改时间和访问时间在条件内的文件 ......
  • 查看子文件夹中的文件个数及find命令解析
    查看子文件夹中的文件个数find/home/test-typef-printf'%h\n'|sort|uniq-c/home/test要查找的目录-type按文件类型查找f:指普通文件d:目录文件-printf打印输出%h文件目录\n新行sort排序uniq-c去重并统计次数测试创建文件当前目录/home/test,......
  • Linux之查找过滤(tail、grep、find)
    参考:https://www.cnblogs.com/caoweixiong/p/15218826.htmltail基本格式tail[-f][-cNumber|-nNumber|-mNumber|-bNumber|-kNumber][File]参数解释-f该参数用于监视File文件增长。-cNumber从Number字节位置读取指定文件-nNumber从Number行......
  • python中字符串内置函数find和index
     001、find>>>str1="xyabmnabkj"##测试字符串>>>foriinenumerate(str1):...print(i)##列出每个字符的索引...(0,'x')(1,'y')(2,'a')(3,'b')(4,'m'......
  • 出现在pom.xml文件的依赖出现了关于jdk的tools.jar的问题--Could not find artifact j
    问题描述在我调整了好几次的dependency依赖之后,还是会爆出这个错误,项目五花八门,错误千篇一律可还行;问题解决看到Maven的插件那里显示红色下划线,就一直向下找,发现就是这里出现了问题(现在已经解决了):再根据查阅的相关资料,得知有的依赖里面涵括了jdk-tools依赖的功能,需要在那里涵......
  • 解决错误:unable to find valid certification path to requested target
    maven编译老报错 unabletofindvalidcertificationpathtorequestedtarget解决方法将服务端证书添加到Java证书信任库中 keytool-import-aliascasserver-keystore$JAVA_HOME/lib/security/cacerts-fileserver.crt-storepasschangeit-nopromptalias,证书别名,可以任......
  • mac上的find与gnu find
    linux上用的find属于gnufind,如果是查找当前路径是可以省略.的,只需要find-name"xxx"而mac上自带的find是bsdfind,.不可以省略,否则会报错/usr/bin/find:illegaloption--n可以手动安装https://www.gnu.org/software/findutilsbrewinstallfindutilsIfyouneedtouse......
  • LOOKUP函数和FIND函数套用实例
    LOOKUP函数和FIND函数套用,主要是通过LOOKUP函数的查找区域是模糊查找,找到小于或等于查找值的最大值,且忽略错误数据,再用0除以FIND函数查找到的结果数组,使其成为一组包含0和错误值的数组。这样LOOKUP函数查找值只需要比0大或者等于0都能够匹配到FIND函数找到的那行数据,然后通过LOOK......
  • configure: error: Can't find GL/gl.h. Look for Mesa devel packages for your dist
    1.安装文件查询工具 sudoaptinstallplocate  2.查询头文件地址,shell命令:locateGL/gl.h     3.为编译时指定其他的头文件查询地址:exportCPLUS_INCLUDE_PATH=/usr/include  ======================================= ......