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!
Notices
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.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
d is obviously an abbreviation for one bash command, and -gn -un are arguments it accepts.
I thought possibly "date", however it does not appear to have those arguments, or at least mine does not.
Any more details about how it is used?
Where did you get that from? Someone's script? Horrible script writer if so.
It is from a RHCSA study guide book 7th edition, by Michael Jung.
Ops... I have to make corrections....
Excerpts:
Code:
The Default umask
With that in mind, the default umask is driven by the /etc/profile and /etc/bashrc
files, specifically the following stanza, which drives a value for umask depending on
the value of the UID:
if [ $UID -gt 199 ] && [ "`id -gn`“ = "‘`id -un`” ]; then
umask 002
else
umask 022
fi
In other words, the umask for user accounts with UIDs of 200 and above is 002.
In contrast, the umask for UIDs below 200 is 022. In RHEL 7, service users such as
adm, postfiX, and apache have lower UIDs; this affects primarily the permissions of
the log files created for such services. Of course, the root administrative user has
the lowest UID of 0. By default, files created for such users have 644 permissions;
directories created for such users have 755 permissions.
In contrast, regular users have a UID of 1000 and above. Files created by such
users normally have 664 permissions. Directories created by such users normally
have 775 permissions. Users can override the default settings by appending an
umask command in their ~/.bashrc or ~/.bash_profile.
The error on my part is "d" command should be "id" command.
Now I know what id is,.
I can now guess what gn and un are, i.e. group name and user name. but I was not able to find it in bash documentation....
Sorry folks.
Please see corrections in original post.
Thank you.
OK, it's not a publication error. The command is also no longer an unknown, you should be able to review the manual page to see that it is used to print user and group information.
OK, it's not a publication error. The command is also no longer an unknown, you should be able to review the manual page to see that it is used to print user and group information.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.