Forem

Santhosh Kumar
Santhosh Kumar

Posted on

3 1

BASH : NAVIGATING THE FILESYSTEM

This post was originally published on my blog, find original post here

We'll see about how we can navigate around the file system using bash commands.

First thing, we need to know is where we are in the file system.
We call that directory as current directory or working directory.

To find out the working directory, we can use pwd command.

santhosh@ubuntu:~$ pwd
/home/santhosh

Full form of pwd is Print Working Directory .
Lot of bash commands are abbreviations. So it is easy to remember.

we can see the files and folders are under the current directory by using the ls command.

santhosh@ubuntu-18-04:~$ ls 
Dev     Documents    Downloads

ls is short for list.

We can also provide arguments to bash commands which makes it more powerfull.

to see the hidden files, use ls -a

santhosh@ubuntu-18-04:~$ ls -a
Dev     Documents   Downloads .bash_history  

Refer the manual of ls for more arguments

We can move around the system using cd command.

santhosh@ubuntu-18-04:~$ cd Documents
santhosh@ubuntu-18-04:~/Documents$ _

To move to parent directory

santhosh@ubuntu-18-04:~/Documents$ cd ..
santhosh@ubuntu-18-04:~$ _

..(double dot) is reference to the parent directory.

.(single dot) is reference to the current directory.

~ is reference to the home directory.

/ is reference to the root directory.

if we run cd command without any argument, we will move to the home directory irrespective of working directory.

Command line can autocomplete our command and paths with tab key. You can try it yourself.

Image of Timescale

🚀 pgai Vectorizer: SQLAlchemy and LiteLLM Make Vector Search Simple

We built pgai Vectorizer to simplify embedding management for AI applications—without needing a separate database or complex infrastructure. Since launch, developers have created over 3,000 vectorizers on Timescale Cloud, with many more self-hosted.

Read more

Top comments (0)

AWS Security LIVE!

Tune in for AWS Security LIVE!

Join AWS Security LIVE! for expert insights and actionable tips to protect your organization and keep security teams prepared.

Learn More

đź‘‹ Kindness is contagious

Immerse yourself in a wealth of knowledge with this piece, supported by the inclusive DEV Community—every developer, no matter where they are in their journey, is invited to contribute to our collective wisdom.

A simple “thank you” goes a long way—express your gratitude below in the comments!

Gathering insights enriches our journey on DEV and fortifies our community ties. Did you find this article valuable? Taking a moment to thank the author can have a significant impact.

Okay