首页 » ORACLE 9i-23ai, 系统相关 » Meaning of an asterisk at the end of a FileName item?文件名后带星号(*)

Meaning of an asterisk at the end of a FileName item?文件名后带星号(*)

昨天看到oracle binary file 显示oracle执行文件名后带星号如oracle*,可能比较困惑,这样的文件名实例还是可用的, 实际这只是ls的显示问题,*并不是文件名的一部分。如下

[oracle@oel7db1 bin]$ ls
total 644084
drwxr-xr-x   2 oracle oinstall      8192 May 30  2020 ./
drwxrwxr-x. 70 oracle oinstall      4096 Apr  3  2020 ../
-rwxr-xr-x   1 oracle oinstall       727 Sep  8  2016 acfsremote*
-rwxr-xr-x   1 oracle oinstall       945 Jun 20  2016 acfsroot*
-rwxr-xr-x   1 oracle oinstall     13485 Mar 30  2019 adapters*
-rwxr-x--x   1 oracle oinstall     41840 Mar 20  2020 adrci*

[oracle@oel7db1 bin]$ file "oracle*"
oracle*: cannot open (No such file or directory)

实际上应该是
[oracle@oel7db1 bin]$ ls -l
total 644068
-rwxr-xr-x 1 oracle oinstall       727 Sep  8  2016 acfsremote
-rwxr-xr-x 1 oracle oinstall       945 Jun 20  2016 acfsroot
-rwxr-xr-x 1 oracle oinstall     13485 Mar 30  2019 adapters
-rwxr-x--x 1 oracle oinstall     41840 Mar 20  2020 adrci
...
-rwxr-x--- 1 oracle oinstall        46 Nov  7  2000 oracg
-rwsr-s--x 1 oracle oinstall 441253104 Mar 20  2020 oracle

给ls 加上"F"选项

[oracle@oel7db1 bin]$ alias ls="ls -laF"
[oracle@oel7db1 bin]$ ls
total 644084
drwxr-xr-x   2 oracle oinstall      8192 May 30  2020 ./
drwxrwxr-x. 70 oracle oinstall      4096 Apr  3  2020 ../
-rwxr-xr-x   1 oracle oinstall       727 Sep  8  2016 acfsremote*
-rwxr-xr-x   1 oracle oinstall       945 Jun 20  2016 acfsroot*
-rwxr-xr-x   1 oracle oinstall     13485 Mar 30  2019 adapters*
-rwxr-x--x   1 oracle oinstall     41840 Mar 20  2020 adrci*

[oracle@oel7db1 bin]$ which ls
alias ls='ls -laF'
        /bin/ls
[oracle@oel7db1 bin]$ alias ls
alias ls='ls -laF'
[oracle@oel7db1 bin]$

ls 
drwxr-xr-x   5 oracle oinstall    52 Apr 17  2019 R/
drwxr-xr-x   4 oracle oinstall    29 Apr 17  2019 racg/
drwxr-xr-x  13 oracle oinstall   140 Apr 18  2019 rdbms/
drwxr-xr-x   3 oracle oinstall    21 Apr 17  2019 relnotes/
-rwx------   1 oracle oinstall   610 Mar 20  2020 root.sh*
-rwx------   1 oracle oinstall   786 Apr 17  2019 root.sh.old*

Note:
ls -F选项在执行文件后面会以*星号结尾, 目录以/结尾等等。

info ls

`-F'
`--classify'
`--indicator-style=classify'
     Append a character to each file name indicating the file type.
     Also, for regular files that are executable, append `*'.  The file
     type indicators are `/' for directories, `@' for symbolic links,
     `|' for FIFOs, `=' for sockets, `>' for doors, and nothing for
     regular files.
打赏

对不起,这篇文章暂时关闭评论。