Joke Collection Website - Public benefit messages - IOS has 4 buttons above and 4 buttons below. Click any button to update the interface, but these 8 buttons are always displayed.

IOS has 4 buttons above and 4 buttons below. Click any button to update the interface, but these 8 buttons are always displayed.

3. Task scheduling commands

The computer has many programs that need to be used periodically, such as cleaning up unnecessary temporary disks in the disk, backing up system data, checking emails from remote servers, etc. For these repetitive tasks, there is no need to laboriously run these programs every time. You can use task scheduling commands to specify the system to run these programs regularly at a certain time to easily complete the work you want to perform.

Crond resident command for task scheduling

crond is a command used by Linux to execute programs regularly. When the operating system is installed, this task deployment command will be started by default. The crond command regularly checks every minute to see if there is any work to be performed. If there is work to be performed, it will be automatically executed. Since the operation process of task scheduling is very complicated, we only introduce the writing method of task scheduling file for your reference:

Minute Hour Day Month DayOfWeek Command

In this text Except for "Command", which is a field that must be specified every time, you can decide whether to specify it automatically according to your needs.

Four. System work of task scheduling

The /ect/crontab/ file is the task scheduling setting file of the Linux system project. Its default content is as follows:

SHELL=/bin/bash ← Specify the SHELL used when executing task scheduling work

PATH=/shin:/bin:/usr/sbin:/usr/bin ← Specify the path for command search

MAILTO=root ← Specify the output results to the root user

HOME=/ ← Specify the following directory

5. Personal work of task scheduling

In addition to the above-mentioned task scheduling system work, general users can use the crintab command to set up tasks to be performed regularly.

Each user can execute the crontab -e command, edit his or her own task scheduling settings file, and add tasks to be performed regularly in this file. The following example is a task scheduling setting file edited by user tony:

[tony@free rony]$ crontab –e

After executing the above command, you will enter the VI text editor for self-editing Task scheduling work.

8. Delete scheduled work tasks

If you no longer want to regularly perform tasks in task scheduling, you can execute the crontab –r command to delete all task scheduled tasks. The example is as follows:

[tony@free rony]$ crontab -r ← Delete the work in the task schedule

[tony@free rony]$ crontab -1 ← Check the task schedule again work in

no crontab for tony ← There is no task scheduling work

Six, packaging, compression and decompression

Since this is for every Linux user There are basic functions that are frequently used, so we will introduce the most common packaging, compression and decompression programs.

1. The tar command for packaging files

The tar command is located in the /bin directory. It can package the files or directories specified by the user into a file, but it does not compress it. . Generally, the commonly used compression method on Unix is ??to first use the tar command to package many files into one file, and then use gzip and other compression commands to compress the file.

The tar command has many parameters. The following are examples of commonly used parameters: -c: Create a new tar file; -v: Display operation process information; -f: Specify the file name; -z: Call the gzip compression command to perform compression; - j: Call the bzip2 compression command to perform compression; -t: See the contents of the compressed file; -x: Unzip the tar file.

Here is a common example:

[tony@free data]# tar cvf data.tar * ← Pack all files in the directory into data.tar

[tony@free data]# tar cvf data.tar.gz * ← Pack all the files in the directory into data.tar and then use the gzip command to compress them

[tony@free data]# tar tvf data. tar * ← Check which files are included in the data.tar file

[tony@free data]# tar xvf data.tar * ← Unzip data.tar

2, compress Unlike decompression

the tar command itself does not have compression capabilities, but you can use other compression commands to compress the tar file immediately after it is generated, saving you the trouble of having to enter the command twice. Use the -z parameter to unpack the most common .tar.gz files:

[tony@free data]# tar –zxvf foo.tar.gz ←Use -j to unpack the file to the current directory Parameters to unzip the tar.bz2 compressed file:

[tony@free data]# tar –jxvf linux-2.4.20tar.bz2 ← Unzip the file to the current directory and use the -Z parameter to specify the compress command Compression

[tony@free data]# tar –cZvf prcture.tar.Z*.tif Pack all the .tifs in this directory and compress them into .tar.Z files

7. Other commonly used commands

There are quite a lot of commands available in Linux. In this chapter, we only give examples of a few commonly used commands to illustrate. In subsequent chapters, we will come across many other commands.

1. Passwd command to change password

The passwd (password) command allows users to change their password. The example is as follows:

[tony@free tony]$ passwd

Changing password for user tony

Changing password for tony

(current )UNIX password: ← Enter the original password

New password: ← Enter the new password

Retype new password ← Enter the new password here

passwd: all authentication tokens updated successfully ← Password changed successfully

2. mkbootdisk command to create a boot disk

If the boot disk is not made when installing the system, or the boot disk is damaged, you can install the system after , use the mkbootdisk command to create a new boot disk:

[root@free root]# mkbootdisk 'uname -r'

Execute the above command to successfully create a boot disk Settled. Please save the disk for emergency use.

3. Date, clock and ntpdate commands for displaying and setting time

The date command can display the current date and time. An example is as follows:

[tony@free rony]$ date

-September 8 10:00:00 CST 2006

CST is Central Standard Time

p>

The clock command can also display the current date and time of the system. However, the clock command is not allowed to be executed by ordinary users by default. Please use the root account to execute it:

[root@free root]# clock

September 8, 2006 (Friday) 10:00:00 0.112604 seconds

If the system time is incorrect and you want to change it, you can use the date command to set the time. Use the root account to do the following:

[root@free root]# date 09091200 ← Set the time to 12:00 on September 9th

Users may sometimes suffer from not knowing standard time. It doesn't matter, there is also a standard time provided by the server during proofreading on the current network. Therefore, you can execute the ntpdate command to set the system time to be consistent with the time adjustment server:

[root@free root]# ntpdate stdtime.microsoft.com ← Set the time with the Microsoft time adjustment server.

Then execute the date command again and you will find that the system time has changed. But this is not over yet. You also need to execute the clock –w command to write the changed time into the CMOS of the computer, so that the changed time will be used the next time you start it. Examples are as follows:

[root@free root]# clock –w

Solutions to some difficult problems encountered during use and some application skills during operation.

1. How to enter text mode

When installing Linux, you can choose to enter text mode or graphics mode automatically. If you choose text mode, you can skip this explanation; if you directly enter the graphics mode of X Window, you can still use the following methods to enter text mode:

1. Open the text mode window in X Window

Taking the default GNOME window environment as an example, the easiest way to enter text mode under X Windows is to right-click on a blank space on the desktop and execute "Add Terminal Command" to open the text mode window. In text mode windows, you can use the Shift Page Up and Shift Page Dwon keys to scroll the window contents.

2. Switch the virtual main console to text mode

The Linux host provides 7 virtual main consoles under the main console (console). In each virtual main console Can run respective programs. You can switch to other virtual consoles at any time after logging into the X Window system by pressing the Ctrl Alt Fn key. The Fn refers to the function keys F1 to F7.

3. Start directly into text mode

To set up to directly enter text mode at startup, you can use any text editor, open the /etc/inittab file, and search for " id:5:initdefault:" and change it to "id:3:initdefault:".

Second, the /etc/inittab setting is incorrect, resulting in failure to start

If /etc/inittab cannot be started normally after modifying it, you can enter the system in single-player mode at startup and restart Modify the inittab settings file to solve the problem.

If you use GRUB as the boot loader, just press the a key when the menu screen is displayed at startup, and enter the following parameters on the command line to enter single-player mode:

grub append gt; ro root=LABEL=/s ← Just add "S" after the original statement in the command line

When using LILO as the boot loader, when the LILO menu screen is displayed at startup, press Ctrl Query the usage of the command

In the Linux system, if the user is not clear about the function of a certain command, you can use the man command to query help:

[root@free root]# man shutdown ← Use the man command to query the usage of the shutdown command to be introduced later.

The syntax of most commands can also be queried through the -h or --help parameter. For example, the syntax of the shutdown command can be found by running shutdown –h or the above-mentioned man shutdown command.

Fourth, avoid pressing Ctrl Alt Del to restart the system

In Linux, directly press the three keys Ctrl Alt Del and it will restart. If you don’t want anyone to use this group The key combination can be used to restart the computer at will. Please use a text editor to modify the /etc/inittab file:

#ca::ctrlaltdel:/sbin/shut down –t3 –r now ← Add “# before this ".

After saving and restarting the calculation, you will no longer be able to use the Ctrl Alt Del key to restart.

5. Chinese information in text mode is garbled

In this version of Red Hat Linux, if you open a text mode window in X Window and operate in text mode, all Chinese File names, months, and even some information can be displayed in Chinese normally. However, in the virtual console in text mode, these Chinese information will become garbled characters. In this case, please do the following to change this information to English display:

[root@free root]$ LANG= C

[root@free root]# ls –l

After running the LANG=C command, the part that was originally displayed in Chinese (garbled characters) became English

If you want to change back to the original settings, just execute the LANG=zh_CN command again:

[root@free root]$ LANG=zh_CN

Six, cannot see Chinese file names

If the loaded storage medium contains Chinese file names, you need to run the mount command again, plus the "-o iocharset=cp950" parameter, so that you can see the Chinese files in the saved media. name. For example, to load a CD, you can execute the following command:

[root@free root]# mount –o iochatset=cp950/dev/cdrom/mnt/cdrom

7. How to replace the CD

When the CD has been loaded into a directory and you press the eject button on the CD-ROM drive, you will not be able to eject the CD. You must first uninstall the CD before you can eject the CD.

If the current location is the CD-ROM loading directory (such as /mnt/cdrom), or other users are in this directory, they will not be able to successfully uninstall it, and of course they will not be able to exit the CD:

[root@free root]# umount/mnt/cdrom

umount:/mnt/cdrom: device is busy ← This CD is in use

First change the working directory Switch to another location, or ask other users to leave the directory before they can unmount the directory and eject the disc. After replacing the disk, remember to load the disc again before it can be used.

8. Allow general users to load CDs or floppy disks

The Linux operating system only allows root users to run the mount command by default. If a general user executes the above command, the following error message will appear. :

[root@free root]# mount/dev/cdrom/mut/cdrom

mount: only root can do that ← Only root users can execute this command

So to allow general users to load CDs or floppy disks, please modify the /ect/fstab/ settings file:

/dev/cdrom/mut/cdrom udf, iso9660 noauto, owner, kudzu, ro,user ← If you want general users to also load the CD, please add the ",user" item here.