December 24th, 2008 — News
If you want to quickly create a new user account in your Unix OS, it ca be done with just one line
Adding new user accounts in Unix
To create a basic Unix user account with default settings, you need to know only one thing: the username.
The reason I say it as one word is because username (quite often referred to as "login") is not the actual name of the new person gaining access to your Unix system, but rather a single keyword uniquely identifying this user in your system. Most often, usernames are derived from real names of users – jsmith, johns or smithj for John Smith, just to give you a few examples.
The simplest way to add a new user to your system is to do run a command like this:
ubuntu# useradd jsmith
Continue reading →
December 16th, 2008 — News
I've just integrated a new section: Unix Commands. The long-term plan is to have a categorized list of commands with most common usage documented in my typical easy-to-follow examples.
So far, there's not much, but I will referer to this section a lot in my future posts and its pages will have more examples for a particular Unix command compared to the original Unix Tutorial post where such a command is mentioned.
Have a look for yourself:
- Unix Commands – the main index
- Basic Unix commands – like it says, they really are basic. If you can think of something else which should be part of it, let me know
- Advanced Unix commands – to Unix gurus they'll seem basic as well, but my only guidance so far was that commands there will be the ones you don't have to use on a daily basis. As I add more pages, this section will most likely become something like "Most common Unix commands" and a set of really advanced commands will be added.
Let me know what you all think, and if there are some immediate candidates for any of the section – let me know and I'll add them to my list!
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:
November 17th, 2008 — Basic stuff
If you remember, all files and directories in Unix filesystems have three timestamps associated with them – atime, ctime and mtime. Since questions about modifying access time (atime) and modification time (mtime) are quite frequent in my website logs, I thought I'd explain how it is done.
How to view atime, ctime and mtime
Before we go any further, I'd like to remind you that using stat command is probably the easiest way to look at all the three timestamps associated with each file:
Continue reading →
October 31st, 2008 — News
October 28th, 2008 — News
CodeWeavers are giving their award-winning CrossOver software for free.
What is CrossOver?
CrossOver is a tweaked and polished, proprietary version of Wine – an implementation of Windows API for Unix. Simply put, it's a software which allows you to run Windows applications on your Unix system. Wine, especially since the 1.0 release, is quite a pleasant and reliable way of running Windows software on your Unix desktop, but CrossOver is known for putting many more tweaks on top of the features implemented in Wine, mostly to make popular office packages (Microsoft Office) and games work even better in emulated environment.
CrossOver Pro For Free
For one day only, October 28th 2008, you can go to the CodeWeavers website to request your free registration key for the professional version of their CrossOver software suite – either for Linux or Mac. These are fully functional serial keys for the pro version, technical support included.
The trick is that you need to have this key activated as soon as possible! Originally, you were only given time until midnight, but it is now promised that you'll get another 48hours to activate your key, although free registration keys will stop after 23:59 PM Central Standard Time.
Wait no more – the main CodeWeavers website is already down due to traffic, but Free CrossOver Pro registration form is still available!
See also:
October 2nd, 2008 — Linux, Unix
In my first introductory rsync post, How To Synchronize Directories with Rsync, I've shown you the most basic approach to syncing two directories up. Today, I'd like to show you another useful thing you can do with rsync.
Continue reading →
September 25th, 2008 — Basic stuff
Today is going to be a practical tip. If you're managing many Unix systems, sooner or later you come across files with special characters – they can't be deleted with rm command using standard approach and require a bit of trickery to be successfully removed.
Examples of files with special characters
Any language apart from English will probably have special characters in the alphabet, but for the purpose of today's exercise I'll give you more standard examples: files starting with dash (-) and hash (#) characters:
ubuntu$ ls -al
-rw-r--r-- 1 greys admin 0 Sep 25 05:50 #try
-rw-r--r-- 1 greys admin 0 Sep 25 05:48 -try
Continue reading →
September 21st, 2008 — News
Here are the posts I've read and enjoyed this week:
If you have any useful articles you'd like to share – just leave links in the comments area. Enjoy!
September 19th, 2008 — Basic stuff, Scripts
When I was writing a post about using date command to confirm date and time in your Unix scripts, I made a note in my future posts list to cover the date calculations – finding out the date of yesterday or tomorrow, and so on. Today I'll show you the simplest way to calculate this.