Windows:- WSL – Where is your home directory (~)

Background

Let us identify our home’s directory on Microsoft Window’s WSL install.

 

On Linux, Home Directory is ~

On Linux, Home directory is ~

Echo

Let us use the echo command to confirm that ~ in fact points to the home directory.

Syntax


Echo ~

 

Sample


echo ~

Output

Image

Text


>echo ~
/home/dadeniji
>

Explanation

Our home directory is /home/<username>.

 

 

Review Home Directory (~)

Let us review the content of our home directory ( ~ )

ls

Let us use the ls command to confirm which files exists in our home directory.

Command Options

Option Meaning
-l Listing
-h Human Readable
-a Include hidden file

Syntax


ls

 

Sample


ls ~ -lha

Output

Image

Text


>ls ~ -lha
total 68K
drwxr-xr-x 7 dadeniji dadeniji 4.0K Sep 20 11:46 .
drwxr-xr-x 3 root     root     4.0K Feb 21  2022 ..
-rw------- 1 dadeniji dadeniji  12K Sep 20 11:46 .bash_history
-rw-r--r-- 1 dadeniji dadeniji  220 Feb 21  2022 .bash_logout
-rwxr-xr-x 1 dadeniji dadeniji   63 Jun 27  2022 .bash_profile
-rw-r--r-- 1 dadeniji dadeniji 3.7K Feb 21  2022 .bashrc
drwxr-xr-x 3 dadeniji dadeniji 4.0K Feb 22  2022 .cache
drwxr-xr-x 2 dadeniji dadeniji 4.0K Feb 21  2022 .landscape
drwx------ 4 dadeniji dadeniji 4.0K Feb 22  2022 .local
-rw-r--r-- 1 dadeniji dadeniji    0 Mar 16 09:19 .motd_shown
-rw-r--r-- 1 dadeniji dadeniji  807 Feb 21  2022 .profile
-rw------- 1 dadeniji dadeniji    7 Feb 21  2022 .python_history
drwxr-xr-x 2 dadeniji dadeniji 4.0K Feb 22  2022 .semgrep
-rw-r--r-- 1 dadeniji dadeniji    0 Feb 21  2022 .sudo_as_admin_successful
-rw------- 1 dadeniji dadeniji 6.4K Sep  5  2022 .viminfo
drwxr-xr-x 3 dadeniji dadeniji 4.0K Jun 26  2022 script
>

Explanation

Here are some of the files listed.

  1. Bash
    • .bash_history
    • .bash_logout
    • .bash_profile
    • .bashrc
    • .profile

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s