0

I am new to unix scripting, learning it experimenting my own ways. But then I was trying to list the directory and found numbers like 1000 and 1001.

I google and understood that those are the userid's I verified the same. But then I wish to display the username for readability on the unix ls command.

Please help me and guide on the same.

Thanks ^_^

-- Edit_1

When I type the "ls -al" the out put of that was as mentioned below.

Image of ls -al output

But then in that there were id's like 1000 of the owner and I wanted the name of the user instead of the id.

--Solution

I have logged in as root user and used the below command.

sudo chown -R :

And the above solution worked and I am able to see the username instead of userid.

The link to the actual answer is [this][2]

Thank you all for the help :)

Abhi
  • 121

2 Answers2

0

When you first install Windows Subsystem for Linux there are no user IDs setup. You need to create one first:

There are times when User IDs cannot get created properly in which case installing the most recent version of WSL from Microsoft Store is best course of action:

0

To get the username instead of the userid we need to own the directory for that the below is the command which needs super user access.

sudo chown -R username:usergroup dirname

Once you own the dir try ls -al then the result will display your name as owner of the dir instead of userid.

Thank you all for the help and support :)

Abhi
  • 121