Today, I'd like to answer one of the oldest questions I have in my incoming UnixTutorial questions email folder. Please leave comments if you need any more help with researching Unix groups on your system.
Entries Tagged 'Questions & Answers' ↓
How to identify what Unix groups are available on your system
March 6th, 2009 — Questions & Answers
Where, how and why are you using Unix?
February 18th, 2009 — Questions & Answers
Greetings everyone, today's post is going to be a bit different from the usual technical tips and tricks I share. This time around, I need a bit of help myself – and I hope many of you will be able to answer my questions. Bear with me: it's a lengthy post, but any help is GREATLY APPRECIATED!
Why am I asking these questions?
As you remember, a month ago I have offered invited all of the Unix Tutorial readers to learn Unix together. Everyone benefits from this – you get a chance to ask the questions which you always wanted answered, and I get to refresh my mind or even conduct a research on new topics just so that I can share the answers and solutions in the easiest to follow form.
I'm currently working on a members area for Unix Tutorial, which will eventually have a number of self-paced courses to help you improve your knowledge of Unix and get to the next level of productivity when solving technical problems.
Update: if you're interested in becoming a member, subscribe to the Unix Tutorial waiting list!
What to do if numeric id is shown instead of Unix username
January 6th, 2009 — Advanced topics, Questions & Answers, Unix
As you know, every file in your Unix OS belongs to some user and some group. It is very easy to confirm the ownership of any file because user id and group id which own the file are always linked to the file. However, sometimes you can't tell which user owns the file, and today I'm going to explain why. It's a rather lengthy post and a complicated matter, so please leave questions or comments to help me polish this article off.
Files and directories ownership in Unix
If you look at any file using ls command, you will see an output like the one shown below – it reveals file access permissions, user and group id of the owner, the modification timestamp and the file name itself:
ubuntu$ ls -l /tmp/myfile -rw-r--r-- 1 greys admin 0 Jan 6 03:51 /tmp/myfile
Confirm the Day of the Week Based on a Timestamp
November 20th, 2008 — Questions & Answers
I recently created a Unix Questions and Answers page, if you have a Unix question – feel free to ask it there using the submit form and I'll do my best to help you out.
Today's Unix question is this:
How can we write a shell script in unix to find the day of the week when date is given?
The solution for this is even simpler: there's no need for Unix scripting, all you need is to have GNU date command at your disposal. I've already shown you all the basic date/time calculations using this great tool, and that's just another way of using it.
How to find a Day of the week based on timestamp
All you need is to know the base date. Let's say I'm interested in October 16th, 2009. Here's how easy it is to confirm that day will be Friday:
ubuntu$ date -d "Oct 16 2009" "+%a" Fri
That's it – enjoy!
See also:
How To Parse Text Files Line by Line in Unix scripts
August 13th, 2008 — Questions & Answers, Scripts, Solaris, Unix
I'm finally back from my holidays and thrilled to be sharing next of my Unix tips with you!
Today I'd like to talk about parsing text files in Unix shell scripts. This is one of the really popular areas of scripting, and there's a few quite typical limitations which everyone comes across.
Reading text files in Unix shell
If we agree that by "reading a text file" we assume a procedure of going through all the lines found in a clear text file with a view to somehow process the data, then cat command would be the simplest demonstration of such procedure:
redhat$ cat /etc/redhat-release Red Hat Enterprise Linux Client release 5 (Tikanga)



