How to set time

While logged in as root do the following:

  1. Type "date".
  2. You should see some variation of"

    "Wed Nov 24, 9:29:17 EST 1999"

  3. To change the time type(as an example):

    date -s 10:10

  4. The system response will be:

    "Wed Nov 24, 10:10:02 EST 1999"

  5. Then if you want to set the hardware(BIOS) clock so the system will keep the time when it reboots type:

    clock -w



The program setclock will set your hardware clock based on your system configuration parameters including whether or not your clock is set to universal time.

How to paste text in files

There is a cut and paste mouse utility that works with virtual consoles called gpm which runs as a daemon. To use it,

  1. Move your mouse to the text you want to cut or paste
  2. Hold the left mouse button down
  3. Drag the mouse to the end of the selected text
  4. Release the mouse button
  5. If deleting text, just press the "DEL" key for your final step. If pasting text, move the text cursor to the location you want to paste to by switching terminals with function keys, using arrow keys, etc.
  6. If pasting, press the right mouse button.

How to re-display previously displayed text

Text that has scrolled off the top of the screen may be viewed again using the <SHIFT><PgUp> key combination. The Keys in the numbers section on the far right of the keypad do not work for this function, only the grey PgUp and PgDn keys just to the right of the <Enter> key. If you want other keys to perform this function, it would be necessary to map them for bash shell keymapping. Pressing any other key other than <SHIFT><PgUp or ><SHIFT><PgDn> will bring you back to the normal screen location.

How to set up cron commands

The system administrator can schedule tasks by adding entries to the /etc/crontab (see crontab(5)) file or on Redhat Linux, by adding entries in one of the cron.hourly, cron.daily, cron.weekly, or cron.monthly files. Users may be able to schedule cron jobs if the system is configured to allow it. If neither of the /etc/cron.allow nor the /etc/cron.deny files exist, either all users will be able to run cron commands or no users will be able to do it. If /etc/cron.allow exists, the user must be listed their in order to use cron commands. If /etc/cron.deny exists, the user must not be listed here or they will be unable to use cron.

One useful entry you can put in the /etc/cron.weekly directory in a file named something like "cleanold.cron" is:

find /var/spool/myspools -mtime +33 -exec rm -f {} \;

This entry will remove all files in the /var/spool/myspools directory whose data was changed more than 33 days ago.

The user (if allowed) can schedule cron tasks by following the below procedure:

  1. Make a crontab file called for example "mycron".
  2. Use the crontab(1) command to submit the command(s) to cron by typing "crontab mycron".
  3. You can view what you have installed by typing "crontab -l".

crontab commands:

crontab -eStarts vi session by default to edit your crontab file. To use emacs as your editor, type "export VISUAL=emacs" before typing this command. When you exit the editor, the modified crontab is installed automatically.
crontab -rRemoves your crontab entry from the /var/spool/cron directory. Does not erase your original crontab file.
crontab -lLists all the user's cron tasks.

To use emacs, type "export VISUAL=emacs" before starting crontab.

How to start Linux from DOS

Use the DOS program "loadlin", usually with a Linux distribution on the CDROM under /dosutils/loadlin.

Linux Howtos Contents Page