首页 > 系统相关 >Shell - readlink

Shell - readlink

时间:2023-07-26 09:11:32浏览次数:26  
标签:Shell name -- readlink mode canonicalize output

$>info coreutils 'readlink invocation'

File: coreutils.info,  Node: readlink invocation,  Next: rmdir invocation,  Prev: mknod invocation,  Up: Special file types

12.6 'readlink': Print value of a symlink or canonical file name
================================================================

'readlink' may work in one of two supported modes:

'Readlink mode'

     'readlink' outputs the value of the given symbolic links.  If
     'readlink' is invoked with an argument other than the name of a
     symbolic link, it produces no output and exits with a nonzero exit
     code.

'Canonicalize mode'

     'readlink' outputs the absolute name of the given files which
     contain no '.', '..' components nor any repeated separators ('/')
     or symbolic links.

     readlink [OPTION]... FILE...

   By default, 'readlink' operates in readlink mode.

   The program accepts the following options.  Also see *note Common
options::.

'-f'
'--canonicalize'
     Activate canonicalize mode.  If any component of the file name
     except the last one is missing or unavailable, 'readlink' produces
     no output and exits with a nonzero exit code.  A trailing slash is
     ignored.

'-e'
'--canonicalize-existing'
     Activate canonicalize mode.  If any component is missing or
     unavailable, 'readlink' produces no output and exits with a nonzero
     exit code.  A trailing slash requires that the name resolve to a
     directory.

'-m'
'--canonicalize-missing'
     Activate canonicalize mode.  If any component is missing or
     unavailable, 'readlink' treats it as a directory.

'-n'
'--no-newline'
     Do not print the output delimiter, when a single FILE is specified.
     Print a warning if specified along with multiple FILEs.

'-s'
'-q'
'--silent'
'--quiet'
     Suppress most error messages.

'-v'
'--verbose'
     Report error messages.

'-z'
'--zero'
     Separate output items with NUL characters.

   The 'readlink' utility first appeared in OpenBSD 2.1.

   The 'realpath' command without options, operates like 'readlink' in
canonicalize mode.

   An exit status of zero indicates success, and a nonzero value
indicates failure.

 

标签:Shell,name,--,readlink,mode,canonicalize,output
From: https://www.cnblogs.com/zhangzhihui/p/17581529.html

相关文章

  • 03 shell 编程
    变量语言型编译型语言解释型语言shell脚本语言是解释型语言shell脚本的本质:shell命令的有序集合shell编程的基本过程基本过程分为三步:step1.建立shell文件包含任意多行操作系统命令或shell命令的文本文件;step2.赋予shell文件执行权限用chmod命令修改......
  • python调用shell脚本并传递参数
    Python调用Shell脚本并传递参数作为一名经验丰富的开发者,我将教会你如何使用Python调用Shell脚本并传递参数。这个过程可以分为以下几个步骤:步骤描述步骤1编写Shell脚本步骤2在Python中调用Shell脚本步骤3传递参数给Shell脚本下面我将逐步介绍每个步骤......
  • 使用 bat 脚本调用 powershell 脚本时遇到的问题
    如果powershell脚本中,有一些涉及相对路径的操作,会发现这样运行的powershell并不是在期望的目录中,需要重新设置一下当前工作目录:powershell-CommandSet-Location-LiteralPath"%cd%";".\test.ps1"通过Set-Location命令即可实现此需求。参考:https://stackoverflow.co......
  • Beanshell 替换和大小写转换
    #d15ac656-d917-4eb4-bf81-029080e16fad转成D15AC656D9174EB4BF81029080E16FADStringMEM_AcctId="d15ac656-d917-4eb4-bf81-029080e16fad";Stringnew_MEM_AcctId=MEM_AcctId.replaceAll("-","");StringUp_MEM_AcctId=new_MEM_Acc......
  • PowerShell实现Win11环境变量追加及备份
    最近重装了系统,之前配置的环境又得重新配置,感觉很繁琐所以查阅资料实现了用脚本配置环境变量,这样只要保留原先的JDK等环境文件夹就可以一键配置了。一开始我准备采用比较熟悉的bat脚本来实现setxPATH"%PATH%;%myPath%"/m但setx会覆盖原有path!!,故最后使用PowerShell实现,脚......
  • shell、terminal、console区别和联系
    这些概念之所以存在其实是历史传承的结果,想要理解本质区别,需要从计算机发展史入手去了解。首先,总的来说在以前,终端termial和控制台console都是具体的硬件设备,shell是软件程序目前,终端termial和控制台console基本已经不再细分且均为软件程序,shell仍然为软件程序无论以前......
  • MongoDB 教程二: 添加, 删除,查询 shell命令
       MongoDBShell常用操作命令MonoDB shell命令操作语法和JavaScript很类似,其实控制台底层的查询语句都是用JavaScript脚本完成操作的。 Ø数据库//1、Help查看命令提示helpdb.help();db.yourColl.help();db.youColl.find().help();rs.help();//2、切换/创建......
  • 从密码重置打到Getshell和其它漏洞打包
    前言前几天是准备上点edusrc的分的所以就准备用手上还没刷的Nday继续上分,然后就有了今天这个案例:信息收集之前在挖某体育学院证书的时候就挖到过一个通过修改html文件更改密码修改步骤的漏洞所以就准备测绘一下这个资产继续看看能不能上分挑一个打开:没有背景图了但还是......
  • 获取正在运行容器的shell
    获取容器的Shell在本练习中,你将创建包含一个容器的Pod。容器运行nginx镜像。下面是Pod的配置文件:application/shell-demo.yamlapiVersion:v1kind:Podmetadata:name:shell-demospec:volumes:-name:shared-dataemptyDir:{}containers:-name......
  • virtualbox "UEFI Interactive Shell... " 错误 virtualbox machine boots to efi she
    ItturnsoutthatasIwasmessingaroundwithgettingthemachinetoload(duetoVirtualizationtechnologiesbeingdisabled),Iclickedonetoomanyitemsontheimagesettingspage. Tofixthis,gotothe"Settings"pageforthevirtualmachi......