For the admirers of the console, “./” might be very familiar. It is widely regarded as one of the most common Linux features for making the command line easier to use. But, are you not sure about what ./ means in Linux terminal? Then, we have got you covered! In this post, we will clarify what ./ means and what its functionality is in Linux.
What is “./”?
./ symbolizes the current directory, but it has fascinating and valuable dimensions. The small amount of information contained by ./ is essential yet precise with the console fans’ user hierarchy. Several times, this information goes unnoticed by an inexperienced Linux user. Using Linux from the command line enables you to stand in the middle of the file system hierarchy. When operating as non-root users, you are almost located in your home directory.
It is required to manage files outside of the current directory, regardless of your current directory. This may result in a time-consuming process of changing the directory. You can use “./” for managing and changing several files from the current directory. Now, let’s understand the ./ in terms of. (dot) and / (slash) separately.
Dot or “.” refers to the “Current User Directory.” Write out the below-given command in your terminal.
In the output, you can see the line ending with “.”. That dot states that this is your current directory.
Adding a slash “/” to the end of the “.” ensures that you are not working on a file. It performs the same functionality as adding / to the end of any directory name. Follow the example for understanding “/” more thoroughly.
Here, we have “/home/linuxhint” as our home directory, and the file we are going to append is located at “/home/linuxhint/test.” Thus, you can look into the file located in the “test” folder using the below-given command without changing the current directory.
This “sample” text file is edited without changing the current directory. Utilize the cat command for viewing the changes made to this text file.
In Linux, “./” is utilized to denote the current directory. Using ./ in your $PATH is a time-saving technique. Without leaving the current working directory, you can change files that do not exist in your current directory.