- Learn Linux Quickly
- Ahmed AlKabary
- 224字
- 2021-06-11 18:43:44
Hidden Files
The current directory . and the parent directory .. exist under each directory in the Linux filesystem. But how come we can't see them when we run the ls command?
elliot@ubuntu-linux:~/Desktop$ pwd
/home/elliot/Desktop
elliot@ubuntu-linux:~/Desktop$ ls
hello.txt
elliot@ubuntu-linux:~/Desktop$ ls -l
total 4
-rw-r--r-- 1 elliot elliot 37 Jan 19 14:20 hello.txt
As you can see, I even tried to run ls -l and still can't see the current directory or the parent directory.
You need to use the -a option with the ls command as follows:
elliot@ubuntu-linux:~/Desktop$ ls -a
. .. hello.txt
Hooray! Now you can see all the files. The -a option shows you all the files, including hidden files and of course you can use the full option name --all, which will do the same thing:
elliot@ubuntu-linux:~/Desktop$ ls --all
. .. hello.txt
It turns out that any filename that starts with . (a dot) is hidden.
Hidden filenames start with .
Any filename that starts with a dot is hidden. That's why current and parent directories are hidden.
To demonstrate further, go to your user home directory and run the ls command:
angela@ubuntu-linux:~$ ls
Music
Now run the ls -a command:
angela@ubuntu-linux:~$ ls -a
. .. .bash_logout .bashrc Music .profile
You can now see the hidden files in your home directory! Notice all the hidden filenames start with a dot.
- 數(shù)據(jù)庫系統(tǒng)原理及MySQL應(yīng)用教程(第2版)
- ASP.NET Web API:Build RESTful web applications and services on the .NET framework
- C/C++算法從菜鳥到達人
- Scratch 3游戲與人工智能編程完全自學(xué)教程
- C語言程序設(shè)計實踐教程
- Oracle JDeveloper 11gR2 Cookbook
- Mastering Linux Network Administration
- 速學(xué)Python:程序設(shè)計從入門到進階
- Linux Shell核心編程指南
- Arduino計算機視覺編程
- FPGA嵌入式項目開發(fā)實戰(zhàn)
- Learning Splunk Web Framework
- Java Hibernate Cookbook
- Shopify Application Development
- Learning WordPress REST API