Get the App
SLTechnology News&Howtos  ›  Servers  › 

What do you mean by "/" and ". /" in linux

Shulou Source: shulou.com Published: 2022-06-03 01:40:11 10月05日 Update

There are a lot of special symbols in Linux Shell, which should be paid special attention to when we write Shell scripts: on the one hand, we should know the usage of these special symbols, these symbols can get twice the result with half the effort; on the other hand, we should avoid the excessive use of these special symbols which makes the script difficult to debug and read.

These special symbols are listed roughly as follows:

#;;. , / / 'string' |! $${} $? $$* "string" * *?: ^ $# $@ `command` {} [] [[]] () (()) | & & {xx,yy,zz,... } ~ + ~-& / + -% = =! =

Output / input redirection:

>

< &>

2 & 2 > & 2

~ represents the home directory, that is, the user directory of the currently logged in user.

For example: my login user is chen

Cd ~

~ stands for / home/chen/. Of course, the premise is that there is a user directory, and there will be more cases if there is no / home/chen directory.

/ refers to the root directory: the directory at the top of all directories.

. / indicates the current directory, and. / generally needs to be used in conjunction with other folders or files to refer to things in the current directory.

Cd. It doesn't make much sense to cd. / folder switch to a folder in the current directory

.. Represents the parent directory

Cd.. Switch to the parent directory cd.. / folder switch to a folder in the parent directory

These are the details of what "~", "/" and ". /" stand for in linux. Please pay more attention to other related articles!

Tags: Directories files folders symbols special users superiors that is switch represent script login get twice the result with half the effort one side something that is content premise on the other hand orientation Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Linux Apple Shulou Technology Docker Xiaomi