LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   what does a dot character mean in linux? (https://www.linuxquestions.org/questions/linux-newbie-8/what-does-a-dot-character-mean-in-linux-4175531588/)

skoda 01-20-2015 02:34 AM

what does a dot character mean in linux?
 
Hi folks,
i was reading a tutorial about how to find files and folder sizes and came a cross this example

Quote:

root@host [5045 02:30:13 /home/johnc/public_html/wp-content]# du -h --max-depth=1
613M ./cache
4.0K ./reports
200K ./sedlex
24K ./wp-content
4.0K ./wppa-depot
40M ./backup-db
16K ./bps-backup
112K ./includes
57M ./plugins
8.0K ./ngg_styles
21M ./themes
362M ./gallery
4.0K ./banners
269M ./lg-gallery
4.1M ./ewww
4.0K ./upgrade
226M ./uploads
28K ./w3tc-config
1.7G .
You see at the bottom it indicates a 1.7G . (dot) . what does that dot mean?

astrogeek 01-20-2015 02:39 AM

The dot means "this directory".

So in the output of du it means the total for this directory.

For sub directories it means the subdirectory below this directory, like ./uploads = the subdirectory uploads below this directory.

skoda 01-20-2015 02:50 AM

Quote:

Originally Posted by astrogeek (Post 5303829)
The dot means "this directory".

So in the output of du it means the total for this directory.

For sub directories it means the subdirectory below this directory, like ./uploads = the subdirectory uploads below this directory.

Pretty clear !!! Thanks astro

grail 01-20-2015 09:39 AM

Please mark as SOLVED once you have an answer or solution.

Miati 01-20-2015 10:14 AM

In case you run into it in the future, while . means current directory, .. means previous directory.
This can be invoked multiple times,
Code:

../../test
means the file test up two directories.

If I am in my home directory
Code:

. == /home/Miati
.. == /home
../../ == /


To run executable scripts, they must be invoked with the current directory.
So if you have the script called foo, in the terminal typing foo would not work.
You would need to type ./foo

Code:

$ foo
foo: command not found
$ ./foo
Hello World!

Additionally, prefixing files with a dot, .config means a hidden file/folder.
So if you were trying to access a hidden folder in the same directory, something like this would be valid:
Code:

./.config/

average_user 01-20-2015 10:24 AM

To fully answer the question "what does a dot character mean in linux?" see this site. A dot can have multiple meanings.


All times are GMT -5. The time now is 07:01 PM.