FAQ Database Discussion Community

pwd alias causing infinite loop in UNIX (bash)

I have an alias, dir, which works fine using $(pwd) to show me the current directory I'm in: alias dir='echo -e ${color1}jarvis: ${color2}you are currently in the ${color3}$(pwd)${color2} directory, sir.${NC}' I would rather this alias be pwd, or have an identical one for pwd (so i can use dir or...

using 'ls' with options and folder and get full path

i'm using ls myfolder and I've seen ls -lrt -d -1 $PWD/* which lists files with full path the question is how do i list files with full path in a folder? (without using cd to go inside that folder)...

Path of the current, parents and root directory

I need to print the path of the current, parent and root directory in UNIX. I can use commands, or a shell script. I managed to do that for the current and the parent directory, but I do not know how to print it for the root directory. Here is...