-1

Ubuntu server 20.04 TLS Q: why when i enter to the directory /ok/oky the cmd ls -l test1.txt work why it does'nt work directly "ls -l /ok/oky/test1.txtenter image description here

1 Answers1

0

ls -l /ok/oky/test1.txt references to file starting from root "/" directory, aka absolute path. This file seems to not exist.

With cd ok/oky, you are changing directory relative to your current directory, aka relative path. You can tell the current directory with command pwd.

To correct your first command, you should use: ls -l ok/oky/test1.txt

Learn more about relative and absolute paths: https://linuxhandbook.com/absolute-vs-relative-path/

ethcz
  • 249