How to get full path of a file?

后端 未结 30 3336
走了就别回头了
走了就别回头了 2020-12-02 03:22

Is there an easy way I can print the full path of file.txt ?

file.txt = /nfs/an/disks/jj/home/dir/file.txt

The

30条回答
  •  没有蜡笔的小新
    2020-12-02 04:04

    fp () {
    PHYS_DIR=`pwd -P`
    RESULT=$PHYS_DIR/$1
    echo $RESULT | pbcopy
    echo $RESULT
    }
    

    Copies the text to your clipboard and displays the text on the terminal window.

    :)

    (I copied some of the code from another stack overflow answer but cannot find that answer anymore)

提交回复
热议问题