I would like to ask how to print name of (for example) third subdirectory of /home directory in Bash?
I have this from Chat GPT, but I am not sure about that.
ls -d /home/*/ | sed -n '3p' | xargs basename
I would like to ask how to print name of (for example) third subdirectory of /home directory in Bash?
I have this from Chat GPT, but I am not sure about that.
ls -d /home/*/ | sed -n '3p' | xargs basename