Article Title: Linux tips (2 ). Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.
The second series of Linux usage tips is mainly about problems that are easy to solve for beginners. I hope you will like them.
1. After Win9x is reinstalled, lilo fails to start Linux.
You only need to start Linux with a floppy disk and run lilo once. For RedHat, run mkbootdisk to create a boot disk. For example:
Mkbootdisk -- devices/dev/fd0 2.0.34-1
2.0.34-1 is a directory under/lib/modules.
2. Change dos/windows to the OS started by default.
RedHat uses Linux as the OS started by lilo by default, that is, boot: After the prompt is displayed, press enter to start Linux. If you want to change to dos/Windows, modify the file/etc/lilo. conf, put the dos Startup part in front, and run lilo again. For example, you can extract lilo. conf from:
Boot =/dev/hda
Map =/boot/map
Install =/boot. B
Prompt
Timeout = 50
Image =/boot/vmlinuz-2.0.34-1
Label = linux
Root =/dev/hdc5
Read-only
Other =/dev/hda1
Label = dos
Table =/dev/hda
Changed:
Boot =/dev/hda
Map =/boot/map
Install =/boot. B
Prompt
Timeout = 50
Other =/dev/hda1
Label = dos
Table =/dev/hda
Image =/boot/vmlinuz-2.0.34-1
Label = linux
Root =/dev/hdc5
Read-only
3. Remove the lilo information in the pilot zone.
After lilo is installed, if the number or partition of the hard disk changes, the hard disk cannot be started. In this case, you only need to use a floppy disk to start dos and then run fdisk/mbr. (This method can also clear viruses in any boot Area)
4. Enable X to support the AGP video card
Download an AX 4.1, that is, AcceleratedX 4.1, a commercial version of X Server. In addition to the AGP video card, AX also supports multiple card numbers. In addition, you can also set the resolution, refresh rate, and other parameters with the setting program Xsetup of AX. However, I don't know how it works with the AGP card, because I am still using S3 765, Which is outdated. :(
5. save man or info information as a text file
Take tcsh as an example: man tcsh | col-B> tcsh.txt
Info tcsh-o tcsh.txt-s
6. Use the current path as the prompt
For bash, add a line in. bashrc:
PS1 = "\ $ PWD \ $"
For tcsh, add a line in. tcshrc:
Set prompt = "%/>"
7. Compress executable files
In Linux, there is a command similar to pklite and lzexe in dos-gzexe. In addition, the compression ratio can generally exceed 50%, which is useful when the space is tight. For example:
/Dosc/temp # ls-al
Total 148
-Rwxr-xr-x 1 root 149564 Dec 8 :33 gawk
/Dosc/temp # gzexe gawk
Gawk: 54.5%
/Dosc/temp # ls-al
Total 216
-Rwxr-xr-x 1 root 68710 Dec 8 15:36 gawk
-Rwxr-xr-x 1 root 149564 Dec 8 :33 gawk ~
/Dosc/temp #
8. view the Linux Startup Information
When Linux is started, the information displayed on the screen is too late to be visible. If you are interested in the information, you can run the dmesg command to view it after it is started.
9. process files with special characters in the file name
If a file name is-file, if you want to delete it, typing rm-file will display invalid option. Since the first character of the file name is-, Linux regards the file name as an option, you can add -- to solve this problem, such as rm ---file. If it is another special character, you can add a \ before the special character, or use double quotation marks to enclose the entire file name.
10. process a whole directory at a time
Many common Linux/UNIX commands, such as rm and cp, have a parameter -----r, which indicates recursion, you can add the parameter-r to the command to operate the target directory and all its subdirectories, for example:
Rm-rf/test (f indicates force). This command completely deletes the sub-directory test in the root directory, which is similar to the deltree in dos. Of course, be careful when using this command. Another example is:
Cp-r/test/test1 is similar to xcopy/s in dos.
11. Modify the logon screen
To local machine:
First modify the file/etc/issue to the desired content, and then modify the file/etc/rc. d/rc. local (RedHat) or/etc/rc. d/rc. S (Slackware) comment out the following sentence:
# This will overwrite/etc/issue at every boot. So, make any changes you
# Want to make to/etc/issue here or you will lose them when you reboot.
Echo "">/etc/issue
Echo "Red Hat Linux $ R">/etc/issue
Echo "Kernel $ (uname-r) on $ a $ (uname-m)">/etc/issue
Cp-f/etc/issue/etc/issue.net
Echo>/etc/issue
Otherwise,/etc/issue will be changed every time it is restarted.
Remote machine for telnet:
First, rename the file/etc/usr/sbin/in. telnetd. For example, change it to in.telnetd.exe, compile a shell script named in. telnetd, and call in.telnetd.exe after displaying the required content. For example:
#! /Bin/sh
Cat/etc/login. banner # content to be displayed before the logon prompt
Echo-n ""
Exec/usr/sbin/in.telnetd.exe
12. Several useful aliases
Several aliases that can facilitate operations and reduce misoperations are recommended to put them in the startup file, such as/etc/bashrc.
Alias rm = 'rm-I'
Alias cp = 'cp-I'
Alias mv = 'mv-I'
# The first three aliases are used to notify you to confirm before deleting or overwriting the file.
# If yes, it is strongly recommended that Slackware users add it as well, because once a file is deleted in Linux/UNIX
# Division can no longer be restored.
Alias l = 'LS-l'
Alias cd... = 'CD ..'
Alias utar = 'tar xvfz' # parses the * .tar.gz File
Alias inforpm = 'rpm-qpi '# displays rpm package information
Alias scheduled PM = 'rpm-Uhv '# Install the rpm package
Alias listrpm = 'rpm-qpl '# list files in the rpm package
Alias uistrpm = 'rpm-e' # reverse install the rpm package
13. Use commands to complete
Command-Line Completion means that when the entered characters are sufficient to determine the next unique file in the directory, you only need to press the Tab key to automatically complete the remaining parts of the file name, for example, to unpackage the file gcc-2.8.1.tar.gz under directory/freesoft, when you type the file to tar xvfz/freesoft/g, if the file is the only file starting with g in the directory, you can press the Tab key. The command is automatically completed as follows: tar xvfz/freesoft/gcc-2.8.1.tar.gz, very convenient.
14. last tip
If you have time, take a look at the FAQ files provided by the system, because most of the problems you encounter can be answered in it. Back to Top:
DOSEMU
I. Features
DOSEMU is a powerful DOS simulator in Linux. It has the following features:
-Supports color text mode and full-function keyboard Simulation
-Built-in X-Windows support, even including IBM font settings
-The graphic mode of the console is compatible with most graphics cards.
-X-Windows built-in graphic mode simulation supports 256 colors or even true colors
-Support protection mode DPMI 0.9
-Windows 3.1 can be run on X-Windows or on the console.
-Support Borland C ++ 3.X IDE and command line compiler
-You can run a few 32-bit DPMI games in DOS/4GW mode on the console.
-Support for CDROM
-Sound Card (including analog DMA) supported)
-NetWare and other built-in IPX protocol support
However, DOSEMU is still an ALPHA (internal test) software, so it still has functional defects,
However, most of the software we are currently using is well supported.
Ii. Installation (the paths we mentioned are all default cases ).
DOSEMU is provided in our redhat linux 5.x. If you have not installed DOSEMU, please find out
Redhat linux cd into the optical drive, use the "mount/mnt/cdrom" command to install the CD, and then
Enter the RedHat/Rpms directory and enter "rpm-I dos *. rpm". Then, DOSEMU will be automatically installed.
If you are installing another version of LINUX or cannot find DOSEMU, you can also go to tsx-11.mit.edu/pub/
For linux/ALPHA/dosemu/, you can go to ftp.suse.com to download/pub/dosemu-
0.66.7.tgz.
3. settings.
In general, DOSEMU does not need to be set for use, but some necessary settings are for some advanced
Required by the DOS application.
The DOSEMU configuration file is/etc/dosemu. conf and/etc/dosemu. user. The former is the DOSEMU configuration.
File, which is a file that sets the user's permission to use DOSEMU. The format of these two files is somewhat similar to that of the C language.
The source code is the # part after the annotation. You can use the text editor vi or jstar to edit them. Please wait
Note: Back up data before editing to prevent unexpected events.
By the way, jstar is a feature key compatible with WordStar (and WPS) Running in Linux.
And can process multiple texts. It is a good choice for users who switch from DOS to Linux,
If you like the NC/DN in DOS, you will get used to the mcedit editor included in mc.
Well, let's take a look at the topic. The following describes some frequently used configuration items in dosemu. conf.
Terminal: Set the terminal font and color. You can set it to {charset IBM color on}, table
Indicates that the 8-bit ASCII code of IBM is used and the color is allowed.
X: Set the refresh speed, title, and icon of DOSEMU in the X-Windows window. The default value can be used.
{Updatefreq 8 title "DOS in a BOX" icon_name "xdos "};
Mathco: determines whether the mathematical coprocessor is valid. It can be set to on;
Cpu: Indicates CPU simulation, which can be set to 80386, 80486, or 80586 as needed;
Xms: indicates the size of the simulated XMS (extended memory). The Unit is k. For example, 1024 indicates that 1 MB of extended memory exists,
If it is set to off, no.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service