|
date - Display/Change system date and time
The command date is used to display or change the system time.
Examples:
- date - Displays current date/time: Sun Jun 11 12:56:54 CDT
2000
- date MMDDhhmmCCYY.ss> - Sets the system date. (Note:
must be logged in as root)
- MM month
- DD day within month
- hh hour
- mm minute
- CC first two digits of year (optional)
- YY last two digits of year (optional)
- ss second (optional)
top of page
cal - Display a calendar
cal is used to display a calendar. The command can display a
calendar for the current month, any year or any month for a given year.
Options:
<MM> <YYYY>
Displays a calendar for the specified month and
year. The year must be a four digit value.
<YYYY>
Displays a calendar for all months for the specified year.
Examples:
- cal - Displays current month only
- cal 1998 - Displays all months for 1998
- cal 3 1999 - Displays a calendar for March of 1999
top of page
Clear the screen
Example: clear - Will clear the screen.
top of page
touch - Change access time for a file
The command touch will set the last access and modified time to the
current system time for the specific file. Note:
If the specified file does not exist, this command will create the file.
Example: touch /etc/profile - changes the date/time of /etc/profile
top of page
Get help
There are two handy utilities that will display manual pages for Linux commands
and utilities: man or info.
man
For the command man
- the displayed information is 'piped' to the 'less' command
- Use the space bar for next page
- q to exit.
Example: man ls - Displays instructions on how to use the 'ls' command
info
The command info is more complex to use and recommend you enter
h for help to get instructions. Info has hyperlinks to enable you to jump to different sections of the manual.
Examples:
- info - Displays instructions on how to use info and a table of contents
- info ls - Displays help for the command ls
top of page
crontab - Schedule Jobs or Tasks
Crontab is a program that allows users to create jobs that will run at a given time. Each individual user has their own crontab and
the entire system has a crontab that can only be modified using root access. If you are adding a crontab for an individual user
you must sign on as that user first.
Options:
- crontab -e - Edits the current crontab or creates a new one.
- crontab -l - Lists the contents of the crontab file.
- crontab -r - Removes the crontab file.
Note: Do not enter just the crontab command without a parameter. On
some systems it will remove the crontab file.
There are six fields for each entry, each separated by a space or tab.
Email Option
By default cron jobs sends a email to the user account executing the cronjob.
If this is not needed put the following command at the end of the cron job line...
>/dev/null 2>&1
Log File
To collect the cron execution execution log in a file...
30 18 * * * rm /home/someuser/tmp/* >
var/logs/cleantmp.log
top of page |