I would like to make an alias called Ls which prints out the current directory and file name when I try to list a specific file
unix> ls a.txt
unix> a.txt -> print out
I want it to print out the directory name too:
unix> /hier1/hier2/hier3/a.txt
When I do 'ls -d $PWD/a.txt'
it prints out
unix> /hier1/hier2/hier3/a.txt
When I make an alias of the above
alias Ls 'ls -d $PWD', it prints out the as below with a space.
unix> Ls a.txt
unix> /hier1/hier2/hier3 a.txt
How do I get the below print without the space and with a slash as below:
unix> Ls a.txt
unix> /hier1/hier2/hier3/a.txt -> THIS IS WHAT I WANT
Copyright Notice:Content Author:「jay」,Reproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/62904190/unix-shell-ls-d-pwd