Skip to Content

Question on file directory and file name

Hi,

Before posting this question, i searched in sdn, but could not find any answer.

What is the difference between giving File path as

1. ~/ ( i guess this is home or root directory)

2. ./ (there is dot infront of slash)

3. / (just slash)

what is the meaning of giving the file name as below, i don't understand why dots are specified, as i checked the actual file name coming in as with out dots, ex: Test_20170101_XYZ.csv

Test_.*._.*.csv

Thanks

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Jan 26, 2017 at 08:47 PM

    Hi Vijay!

    ~ in most cases is interpreted by Shell as home directory ($HOME variable).

    . It's a link to directory itself. /usr/tmp/./texts equals to /usr/tmp/texts. Another example: ls dir and ls ./dir gives you the same result.

    .. points to parent directory. So, path /usr/tmp/../texts equals to /usr/texts.

    / means absolute path. /usr/bin equals to ROOT/usr/bin where ROOT is the root directory of each Unix file system.

    Regards, Evgeniy.

    Add comment
    10|10000 characters needed characters exceeded

  • Jan 27, 2017 at 01:19 PM

    Thank you very much for explaining with examples. Could you please let me know, purpose of dot used in file names:

    what is the meaning of giving the file name as below, i don't understand why dots are specified, as i checked the actual file name coming in as with out dots, ex: Test_20170101_XYZ.csv

    Test_.*._.*.csv

    Thanks,

    Add comment
    10|10000 characters needed characters exceeded