-4

My homework asked me to find what ls .. does.

I tried to search the internet but I couldn't find any answer to the question.

Does someone know what this command does?

agc
  • 7,973
  • 2
  • 29
  • 50
omersk
  • 109
  • 1
  • 10

1 Answers1

-1

.. is an entry in the current directory that refers to the parent of the current directory. It's not a special convention used just by ls. For example:

$ cd /usr/bin
$ pwd
/usr/bin
$ cd ..
$ pwd
/usr
$ [ -d .. ] && echo "It's a directory"
It's a directory
$ stat ..
<output specific to your installed version of stat>
chepner
  • 497,756
  • 71
  • 530
  • 681