Perl String Output Tricks GNU Screen — MITBBS Linux
Jan 25

We’ll start by
1.cat /etc/passwd

2.As we all know that by default all the users created will have their
home directories in /home share
so we’ll modify our command a bit by using grep.
Now it’ll be
cat /etc/passwd | grep “/home”

3. Now we’ll get all the user accounts which have their home share in /home.
But the only output we need is the list of users & nothing else.

4. So we’ll modify our command again
cat /etc/passwd | grep “/home” |cut -d: -f1
Now what we have done is that we have piped the output of previous
command to another variable “cut”
What we have done here is we have added
cut -d: -f1
-d: means delimiter :
-f1 means display first field of line i.e. username.

So final command is
Cat /etc/passwd |grep “/home” |cut -d: -f1

This works until all your users have their home share in /home. If you
have defined their home share to some other destination. Modify the
above command.
.

43 Responses to “how do you list all users in linux”

  1. Eduardo Says:

    how about to list the users and its passwords….logged in as root of course!!

  2. statewaterheaterpartpew Says:

    The blog.feinan.com is interesting site, tnks, webmaster. And see this state industries water heater

  3. BuyViagraAnantaselmtot Says:

    Your site- blog.feinan.com is cool resource, respect, owner.
    viagra viagra pills.

  4. best_savings_accounts_in_uksl Says:

    This is where you find best on line savings accounts furnishings the redemptional your money. Most adroitly savings accounts in clarification that collapse duties predict from settling to mixture and the breathe applies to paving dance surplus buyers only.

  5. childsavingsaccountpew Says:

    child saving account ukpew medical savings accounts

  6. best internet savings accounts Says:

    Nice site
    Thanks, webmaster.

  7. Ipod Nana Says:

    Nice site
    Thanks, webmaster.

  8. digital cable remote Says:

    Nice site
    Thanks, webmaster.

  9. unscramble digital cable Says:

    Nice site
    Thanks, webmaster.

  10. digital cable tv tuner Says:

    Cool blog
    Thanks, webmaster.

  11. best savings accounts rates Says:

    Nice site
    Thanks, webmaster.

  12. state hot water heater Says:

    Nice site
    Thanks, webmaster.

  13. prices state water heater Says:

    Very amazing site
    Thanks, webmaster.

  14. Order Cialis Says:

    Viagra Cialis

  15. doherasebekei Says:

    Cool blog.
    Thanks, admin.

  16. werewolf Says:

    Nice site
    Thanks, webmaster.

  17. Svetlana Says:

    Very amazing site
    Thanks, webmaster.

  18. helmet Says:

    Amazing site.
    Thanks, webmaster.

  19. helmet Says:

    Cool blog.
    Thanks, admin.

  20. helmet Says:

    Beautiful design.
    Thanks, webmaster.

  21. were to buy Says:

    Nice site.
    Thanks, admin.

  22. halloween Says:

    Beautiful design.
    Thanks, admin.

  23. halloween Says:

    Nice site.
    Thanks, webmaster.

  24. make your own halloween costumes Says:

    Cool blog.
    Thanks, webmaster.

  25. original halloween costume idea Says:

    Cool blog.
    Thanks, admin.

  26. Elena Says:

    Cool blog.
    Thanks, webmaster.

  27. Elena Says:

    Nice site.
    Thanks, admin.

  28. Pavel Says:

    Cool blog.
    Thanks, webmaster.

  29. Pavel Says:

    Amazing site.
    Thanks, webmaster.

  30. Boots travel insurance Says:

    Amazing site
    Thanks.

  31. Maria Says:

    Beautiful design.
    Thanks, webmaster.

  32. Marina Says:

    Amazing site.
    Thanks, admin.

  33. Marina Says:

    Cool blog.
    Thanks, webmaster.

  34. Sveta Says:

    Amazing site.
    Thanks, webmaster.

  35. Pavel Says:

    Cool blog.
    Thanks, admin.

  36. embraer regional jet for sale Says:

    Beautiful design.
    disney ariel nudes
    Thanks, webmaster.

  37. NikkyBlond Says:

    Enjoyed your site very much! Thank you! Keep up a good work! :-))

  38. JessicaLynn Says:

    ! :-)) Keep up a good work!

  39. addefotardy Says:

    Funny foto here

  40. johnny Says:

    gG1eP7 Thanks for good post

  41. emersonyannic1987 Says:

    Hello, you have a great blog here! I’m definitely going to bookmark you!

  42. alwintbi37 Says:

    This blog is awesome!

  43. bookerbarclay2662 Says:

    Hey, I was searching blogs, and came onto yours, and I like it.

Leave a Reply