Monday, April 29, 2024
41
rated 0 times [  41] [ 0]  / answers: 1 / hits: 37495  / 2 Years ago, thu, july 21, 2022, 9:07:59

when I used ls -a to view hidden files in folder there were 2 hidden files created by default what is the significance of this two files . and ..?



ls -a


Produces



.  ..

More From » command-line

 Answers
1

. is the current folder.



.. is the folder above the current folder - the folder that contains the current folder.



You will sometimes see that single dot in use when someone wants to run a script from their home directory. For instance: ./install-app.sh. That means the file "install-app.sh" is in the current directory. It would be just as valid to do /home/username/directory/install-app.sh. The same way, you could also do ../install.app if the file is in the parent directory. The reason why it is this way, is not only for navigation, but also that it shouldn't be possible to accidentally hide system applications simply by misnaming a file in your home directory.


[#44073] Friday, July 22, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
sertold

Total Points: 445
Total Questions: 123
Total Answers: 113

Location: Burundi
Member since Wed, Sep 28, 2022
2 Years ago
;