LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > General
User Name
Password
General This forum is for non-technical general discussion which can include both Linux and non-Linux topics. Have fun!

Notices


Reply
  Search this Thread
Old 02-27-2008, 06:09 AM   #1
ratul_11
LQ Newbie
 
Registered: Dec 2005
Posts: 29

Rep: Reputation: 15
ls -la command output is not working properly


Dear All
I have some regular users in my machine where their groupname is same as their username. I have created a common group and put all users group into that group as primary as well as secondary group ( By using usermod -g <groupname> <username> and usermod-G <same primary group> <username>) and remove their previous group ( which is same as their user id).after that I have rebooted the system . Now when i am running the ls -la command in their home directory
I am getting the output like this.

ls -al
total 28
drwxr-xr-x 2 anadhikary 500 4096 Dec 5 11:40 .
drwxr-xr-x 17 anadhikary 500 4096 Jun 9 2000 ..
-rwxr-xr-x 1 anadhikary 500 48 May 8 2000 hello1.plx
-rwxr-xr-x 1 anadhikary 500 46 May 8 2000 hello2.plx
-rwxr-xr-x 1 anadhikary 500 61 May 8 2000 hello3.plx
-rwxr-xr-x 1 anadhikary 500 87 May 8 2000 hello4.plx
-rwxr-xr-x 1 anadhikary 500 87 May 8 2000 hello5.plx

where I should the get the groupname after the username(anadhikary) but here I am getting the user ID of that user (anadhikary). But if the user now creating any new directory (after group modification) he is getting the desired output like this

drwxr-xr-x 4 anadhikary 500 4096 Feb 27 17:12 .
drwxr-xr-x 17 anadhikary 500 4096 Jun 9 2000 ..
drwxr-xr-x 2 anadhikary dbteam 4096 Feb 27 17:12 aaa
drwxr-xr-x 2 anadhikary dbteam 4096 Feb 27 17:12 bbb
-rwxr-xr-x 1 anadhikary 500 48 May 8 2000 hello1.plx
-rwxr-xr-x 1 anadhikary 500 46 May 8 2000 hello2.plx
-rwxr-xr-x 1 anadhikary 500 61 May 8 2000 hello3.plx
-rwxr-xr-x 1 anadhikary 500 87 May 8 2000 hello4.plx
-rwxr-xr-x 1 anadhikary 500 87 May 8 2000 hello5.plx


here dir aaa and bbb has been created by the user after group modification and he is getting the desired output but the problem lies for the previously (before group modification) created directories...

Pls guide me how to solve this problem and why this thing has been happend.......

Thanks and Regards in advance
Anirban Adhikary.
 
Old 02-27-2008, 12:38 PM   #2
jailbait
Guru
 
Registered: Feb 2003
Location: Blue Ridge Mountain
Distribution: Debian Wheezy, Debian Jessie
Posts: 7,651

Rep: Reputation: 222Reputation: 222Reputation: 222
Each group has both a group name and a group number. The file system keeps the group number on the hard drive, not the group name. When you do a ls command the ls command reads the group number from the hard drive and then translates that into the group name that it displays.

You have deleted a group name so when the ls command tries to translate the group number 500 into a group name it cannot find the corresponding group name. ls displays the group number 500 which is all it knows.

-----------------------------
Steve Stites
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I parse the output of a command that output to standard out? gauol Programming 9 01-17-2008 01:54 PM
message command in smb.conf not working properly kamransoomro84 Linux - Desktop 0 11-07-2006 12:51 PM
Autostart command not working properly dstjames Linux - Newbie 2 01-10-2006 02:25 PM
"w" command not working properly blizunt7 Linux - General 3 12-17-2005 04:07 PM
Redirecting output to a command-line argument of another command madiyaan Linux - Newbie 1 02-19-2005 04:35 PM


All times are GMT -5. The time now is 10:52 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration