Unix Questions & Answers

Have a tricky Unix problem or a really interesting Unix question? Usually you can get an answer on the #unixtutorial channel on Freenode IRC.

Use the form below to ask me!

If it’s a simple question, I’ll answer it by email and possibly post here.

If your problem benefits from a longer explanation, I will have a chance to become a Unix Tutorial post.

Your Unix questions – my answers

Is there an easy way to find what (currently removed) username had a given uid?

Answer: depending on your situation, there may be no way to confirm this at all, but if you’re lucky then I can help: What to do when numeric uids are shown instead of usernames.

See also: user management commands in Unix, list groups a Unix user belongs to

How can I create user accounts in Unix?

Answer: use useradd command, I explained the basics in the How To Create Unix User Accounts post.

See also: user management commands in Unix

How can I compare two directories and only show files which are present in both?

Answer: pending

See also: Compare directories in Unix

What is the easiest way to synchronize directories between two systems?

Answer: You’re going to like rsync! Truly, it’s one of the easiest yet most flexible ways of synchronizing anything in Unix!

See also: Tracking Rsync progress, official rsync page.

How can we write a shell script in unix to find the day when date is given?

Answer: use the GNU date command: it’s great for date/time manipulations! The answer to this particular question is here: Confirm a day of the week based on timestamp.

See also: Time and Date in Unix scripts