Using date


Using date

The date command will either return the current date and time or allow you to change them. You can only change the date if you have proper permission to do so. It is important to have the correct date on your system because so many specific things rely on time to function properly. For instance, consider event logs. If you want a record of events such as security issues in your Unix system, you would want those entries to show up in the log, of course. You would want to know, for example, that someone was trying to enter your Unix system without permission. However, even if you have your system set up to log such events, the log entries will be of little use if the time and date on your system are not correct. For instance, if the time and date are incorrect, you may not notice someone trying to log in to your system with your username and password in the middle of the night (a clear indicator of someone trying to hack in during off-hours). Even if you do notice this attempt, you will not know the exact time that it took place. Without solid logs that are provable, you do not have much of a leg to stand on.

If you have the right privileges, you can use date to see and set the day and time on your Unix system. Ordinary user accounts do not have this capability and won't be able to use this command. If you have proper privileges, you can view or change your date by typing the following:

 >date Sat April 01 06:30:01 EDT 2005 

There's nothing to it. Remember, the date command is used to check and set your date. If you are running a GUI (such as KDE or GNOME), just check the right corner of your panel taskbar. You should see the time and date; if not, then just open a shell prompt and type the date command.



    SAMS Teach Yourself Unix in 10 Minutes
    Sams Teach Yourself Unix in 10 Minutes (2nd Edition)
    ISBN: 0672327643
    EAN: 2147483647
    Year: 2005
    Pages: 170

    flylib.com © 2008-2017.
    If you may any questions please contact us: flylib@qtcs.net