Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
If you are trying to write "simple" bash scripts, the simplest thing to do is to post the content here along with a note stating what you expect the program to do and what it actually does.
How can I find the home directory & login hell of a user ?
I am trying to make a list with user's group.
A list of what? Users?
Posting what your specific problems are would probably be the easiest way to get help as there are hundreds of other members here at LQ who are very proficient with bash scripts.
Hi all, I am trying to create a few simple bash scripts but I face a few problems
* How can I find the home directory & login hell of a user ?
Only by parsing /etc/passwd?
* I am trying to make a list with user's group.
[root@localhost ~]# id root
uid=0(root) gid=0(root) groups=0(root),1(bin),2(daemon),3(sys),4(adm),6(disk),10(wheel)
Is any way to get only groups and avoid additonal text manipulation?!
env or printenv has the globally set environment variables for the user you're currently logged in as.
$HOME or even ~ works. (e.g. ~/Documents leads to /home/user/Documents, and so would $HOME/Documents).
The login shell variable under printenv is SHELL, so echo $SHELL would print their default login shell.
As for the groups thing, the command "groups" shows the groups a user is a part of. Without anything it's the user you're logged in as, but "groups username" would show the groups that user "username" is under.
* if commands "members" is not availble (i can install it to debian but readhat doesnt have it), how can I find the members of a group ?
Is there an easy way? "cat /etc/group | grep <goup_name>" is enough ?
* Also, if I have a lot files (file01 up to file100) how can I match 20 up to 100 ?
file[20-100] does not function as I expect.
Anyone has any documents for file globbing with complex examples/exercises?