(Assignment) Linux word wonderful Q & A

Q & A on Linux wonderful word: Xu Chen / Wei Qiong from: linux treasure (http://www.linuxmine.com)
Contact: linuxmine@gmail.com

Editor's note: Given the current development status of Linux in China, 90% of the questions can be answered in one sentence, this is the original intention of this article. Welcome to add your own "words", the original state after your provider. More detailed documentation,
Please visit http://linux.chinaunix.net or http://www.linuxmine.com

Amendment Description: This FAQ is in the original "linux word wonderful Q & A" based on the 4/28/2006 version of the actual situation for this edition made small changes to make it more suitable for site users. Members of the Department if any errors were found, please inform, so that timely corrections; Also, if there is anything to add new content, also welcomed the letter informed. Thank you! (By JJCH)

---------- --------- Internet related articles

0001 changes the host name (bjchenxu)
vi / etc / sysconfig / network, modify the HOSTNAME an act "HOSTNAME = host name" (without this line? then add this line right), then run the command "hostname host name." General also modify / etc / hosts file in the host name. In this way, whether you reboot, the host name is changed successfully.

0002 characters start systems to interface (do not start xwindow) (bjchenxu)
vi / etc / inittab
id: x: initdefault:
x = 3: text mode;
x = 5: graphically.

0003 Linux automatic updates problem
Upgrade the system under Fedora:
yum update packagename # upgrade package
yum upgrade # upgrade the system all the prerequisite packages: configured the network and / etc / yum.conf and / etc / yum.repos.d / within the file,
Reference edition essence - are each distribution area -Redhat/Fedora/CentOS- configuration management.

Upgrade the software under Debian:
apt-get update packagename
apt-get upgrade
Prerequisite: configured the network and / etc / apt / sources.list, refer to http:// ftp.bjtu.edu.cn home.

0004 windows partition under Linux to see the software (bjchenxu)
Paragon.Ext2FS.Anywhere.3.0.rar and explore2fs-1.00-pre4.zip
Schools Download:

0005 mount usage
mount [-t file system format] [-o parameter] device name mount point
-T common parameters
vfat FAT32
ntfs NTFS
iso9660 CD / ISO file
-O common parameters between the use of multiple parameters "," separated.
iocharset = utf8, or set the character encoding gb2312
umask = 0 allows ordinary users to access
loop mounted iso file using the common device name / dev / hdaN, hdcN, period number N values of their look, the first primary partition as a second primary partition of 2,
The first extended partition of 5, second 6, and so on.
Mount point to any existing directory name, such as / mnt / cdrom.

LINUX 0006 in vmware's local hard drive using FAT partitions (bjchenxu)
FAT partition will be the local share, and then hung in VMWARE using SMBFS. You can put the following line / etc / fsta
/ / Win_ip / D $ / mnt / d smbfs defaults, auto, username = win_name, password = win_pass, co
depage = 936, iocharest = gb2312 0 0
One win_ip is the IP address of your windows;
D $ is the inside of your windows shared D drive share name;
/ Mnt / d is to mount the partition to the linux directory;
win_name and win_pass is your WINDOWS partition which can be read by the user, such as your administrator name and password.
If you run the / etc / rc.d / init.d / netfs, when it will start automatically mount the partition.

0007.a delete the file named-a (bjchenxu)
rm. /-a
rm --a tell rm This is the last option, see getopt
ls-i lists inum, and then find.-inum inum_of_thisfile-exec rm '()';

0007.b delete a file named (bjchenxu)
rm \ a

0007.c delete the name with the / and''document (bjchenxu)
The character is a normal file system does not allow the characters, but may be generated in the file name, such as under unix NFS file system used in Mac systems
1. The solution, the NFS file system is not linked to the filter '/' character in the systems with a special file name to delete the file.
2. File name can also be wrong to remove the directory of other files, ls-id display the directory containing the file inum, umount the file system,
clri clear the directory inum, fsck, mount, check your lost + found, rename the file in it.
Preferably through WINDOWS FTP in the past you can delete any file name in the files!

0007.d remove invisible character with the name of the file (bjchenxu)
Lists the file names and dump to a file: ls-l> del
Then edit the contents of the file by adding rm command to delete the file content into the format:
vi del
[Rm-r *******
The file with execute permissions chmod + x del
Implementation of the $. / Del

0007.e delete the file size to zero in the file (bjchenxu)
rm-i `find. /-size 0`
find. /-size 0-exec rm ();
find. /-size 0 | xargs rm-f &
for file in * # own custom file types to delete
if [!-s $ (file)]
rm $ (file)

echo "rm $ file Success!"

0008 redhat9 set wheel mouse (mc1011)
Into the X, select the configuration of the mouse, select the wheel mouse (ps / 2) on it,
If the mouse abnormalities, you can restart the computer.

0009 to install X window
After installing the base system Debian: apt-get install x-window-system-core
Redhat / Fedora installation CD: Select the upgrade installation, you can then select the appropriate package.

0010 Remove Linux partitions (bjchenxu)
Under the Windows "disk management" in deleting it, or with other partitioning tool.

0011 How to Quit man (bjchenxu)
Press q button

0012 does not compile the kernel, mount ntfs partitions present on the support of many distributions default ntfs partition can use to mount directly under the top mount.

For Redhat / Fedora by default does not support ntfs, it may proceed as follows,
1. Uname-r, be the kernel version number;
2. Login http://rpm.pbone.net search for "kernel-ntfs", download the corresponding kernel rpm;
2. Rpm-ivh download rpm package;
3. Mkdir / mnt / WinC
4. Mount-t ntfs / dev/hda1 / mnt / WinC

0013 tar sub-volume compression and consolidation (WongMokin, Waker)
500M per Case Volume
tar sub-volume compression: tar cvzpf - somedir | split-d-b 500m
multi-volume tar merger: cat x *> mytarfile.tar.gz

0014 when using grub retrieve forgotten the root password to be added

0015 to ctrl + alt + del Failure (bjchenxu)
vi / etc / inittab
The ca:: ctrlaltdel: / sbin / shutdown-t3-r now comment out this line, on it

0016 how to view the release name (hutuworm)
cat / proc / version or cat / etc / issue

0017 rpm file in which (the Warriors)
On www.rpmfind.net the search, or rpm-qf file names are

0018 man's information saved as a text file (bjchenxu)
To ls as an example: man ls> tcsh.txt

0019 using the existing two files, generate a new file (bjchenxu)
1. Remove the two documents and the set (keep a copy of the duplicate rows only)
2. Remove the intersection of the two files (leaving only exist in the two files in the file)
3. Remove the intersection, leaving the other line
1. Cat file1 file2 | sort | uniq
2. Cat file1 file2 | sort | uniq-d
3. Cat file1 file2 | sort | uniq-u

0020 set the com1 port, to com1 port via HyperTerminal log (bjchenxu)
Recognizing the / sbin / agetty, edit / etc / inittab, add
7:2345: respawn: / sbin / agetty / dev/ttyS0 9600
9600bps is because the default router, usually in conjunction this rate can be set to
Modify / etc / securetty, add a line: ttyS0, to ensure the root user can log on reboot, you can unplug the mouse, keyboard display (starts to look better output) of the

0021 to delete all the files directory, including subdirectories (bjchenxu)
$ Rm-rf directory name

0022 View System Information (bjchenxu)
cat / proc / cpuinfo - CPU (ie vendor, Mhz, flags like mmx)
cat / proc / interrupts - interrupt
cat / proc / ioports - Device IO Port
cat / proc / meminfo - memory information (ie mem used, free, swap size)
cat / proc / partitions - all partitions of all equipment
cat / proc / pci - PCI device information
cat / proc / swaps - all the information Swap partition
cat / proc / version - Linux version number of the equivalent of uname-r
uname-a - look at the system kernel and other information

0023 removed redundant text file carriage return (bjchenxu)
sed 's / ^ M / /' test.sh> back.sh, note that ^ M is knocking ctrl + v ctrl + m received or dos2unix filename

0024 X Desktop Switch (lnx3000)
Prerequisite: Install a number of desktop systems, such as KDE & & GNOME
Graphical login if you are logged on linux, then click on the login session (tasks) that can select
gnome and kde.
If you are a text log, then the implementation of switchdesk gnome or switchdesk kde, then you can enter startx gnome or kde.
(Or vi ~ /. Xinitrc, add or modify into exec gnome-session or exec startkde, then sta
rtx start X)

0025 generic sound card driver (lnx3000)
ALSA www.alsa-project.org/
OSS www.opensound.com/

0026 to change the Redhat / Fedora system language / character set changes / etc/sysconfig/i18n documents, such as
LANG = "en_US", shows the English interface
LANG = "zh_CN.UTF-8", shows Chinese language interface.
Or LANG = "zh_CN.GB2312" UTF-8 recommended
Another way:
cp / etc/sysconfig/i18n $ HOME/.i18n
Modify $ HOME/.i18n documents, such as
LANG = "en_US", shows the English interface
LANG = "zh_CN.UTF-8", shows Chinese language interface.
This will only change the interface language of individuals, without affecting other users

0027 screen is set to 90 (bjchenxu)
stty cols 90

0028 using the md5sum file (bjchenxu)
md5sum isofile> hashfile, the md5sum files and hashfile contents of the file to verify the validity hash value
Are the same md5sum-c hashfile

An extract multiple zip files 0029 (bjchenxu)
unzip "*", note the quotation marks can not be less

0030 View pdf file (bjchenxu)
Recommended to use Acrobat reader for linux
Schools Download:

0031 Find the file permission bits for the S (bjchenxu)
find.-type f (-perm -04000-o-perm -02000)-exec ls-lg ();

0032 to support the Chinese character mode to http://zhcon.sourceforge.net Download zhcon-0.2.1.tar.gz
$ Tar xvfz zhcon-0.2.1.tar.gz
$ Cd zhcon-0.2.1
$. / Configure
$ Make & & make install
To use, run zhcon, would like to quit, run exit.

0033 Pop CD back to (beike)
# Eject-t

0034 cd iso disc made of paper (MH)
cp / dev / cdrom xxxx.iso

0035 Quick view boot hardware detection (mentally handicapped)
dmesg | more

0036 view hard disk usage (bjchenxu)
df-k to K as the unit shown
df-h shows a more human unit, can be b, k, m, g, t..

0037 view directory size (bjchenxu)
du-sh dirname
-S Display only a total of
-H to K, M, G unit, to improve the readability of information. KB, MB, GB is 1024 for the conversion unit,-H 100
0 for the conversion unit.

0038 Find a file or delete the process being used (wwwzc)
fuser filename
fuser-k filename

0039 installation package to install rpm package: rpm-ivh aaa.rpm
Install deb package: dpkg-i aaa.deb
Install Source Package: tar xvfz aaa.tar.gz; cd aaa;. / Configure; make; make install (the premise: the compiler is installed and the necessary library files)

0040 character mode, set / delete environment variables (bjchenxu)
established under bash: export the variable name = variable value to delete: unset variable names
established under csh: setenv variable value of variable name to delete: unsetenv variable name

0041 ls how to see hidden files (ie. At the beginning of the file) (double fold of the pig)

0042 rpm file to install gone (bjchenxu)
rpm-qpl name.rpm

0043 using src.rpm (bjchenxu)
rpmbuild-rebuild name.src.rpm

0044 vim does not appear in the display colors or color (bjchenxu)
First make sure to install the vim-enhanced package, and then, vi ~ /. Vimrc;
If there are syntax on, the display color,
syntax off, not display color.
In addition, on the vi's syntax color, another point is the terminal type (the environment variable TERM) settings.
For example usually set to xterm or xterm-color to use syntax color. Especially from the Linux remote login to Unix on the other

0045 linux real-time or time-sharing operating system (bjchenxu)

0046 make bzImage-j of the j is the mean (wind521)
-J is mainly useful when your hardware resources, when larger, more affluent, you can use this to accelerate the speed of compilation, such as the-j 3

0047 Source package how many distributions do not now no longer self-generation of source code, please download and install on their own.

0048 to modify the system time (bjchenxu, laixi781211, hutuworm)
date-s "2003-04-14 cst", cst refers to the time zone and time settings with date-s 18:10
The revised implementation of the clock-w wrote CMOS
set the hardware clock to the current system time

0049 to mount on the boot partition under windows (bjchenxu)
D-plate windows automatically linked to / mnt / d, and with vi to open / etc / fstab, add the following line
/ Dev/hda5 / mnt / WinD ntfs umask = 0, iocharset = utf8 0 0
Notice served by hand a / mnt / WinD directory & & system support ntfs.

0050 linux how to use so much memory (bjchenxu)
In order to improve system performance and do not waste memory, linux and more memory to do cache, to improve the io speed

0051 / etc / fstab configuration items inside the final the last two numbers mean (lnx3000)
The first is called fs_freq, used to determine which file systems need to perform dump operations, 0 is not required;
The second is called fs_passno, a system reboot disk fsck program detects the sequence number
1 is the root file system, 2 is the other file system. fsck disk detected by serial number, 0 means that the file system is not being detected
dump the implementation of ext2 file system backup operation
detect and repair the file system fsck

0052 linux in the user's password must have a certain length, and in line with complexity (eapass)
vi / etc / login.defs, change PASS_MIN_LEN

0053 linux in the translation software (bjchenxu, hutuworm)
StarDict xdict
dict the next console there is a tool, through the DICT protocol to dict.org UP 11 dictionaries, for example: dict RTFM

0054 not to display sleep (bjchenxu)
setterm-blank 0
setterm-blank n (n for the waiting time)

0055 inquiry yesterday's date with dat (gadfly)
date-date = 'yesterday'

0056 xwindow how to screenshot (bjchenxu)
Ksnapshot or gnome-screenshot

0057 extract souvenir (bjchenxu, noclouds)
tar-I or bunzip2 command can be extracted. bz2 files
tar xvfj example.tar.bz2
tar xvfz example.tar.gz
tar xvfz example.tgz
tar xvf example.tar
tar-jvxf some.bz
unzip example.zip
rar / unrar the general need to download and install additional tools for their Alien provided. tgz,. rpm,. slp and. deb compression format such as converting between:


sEx provides almost all the visible compression format decompression interface:


0057-2 tar compression, decompression instance (platinum)
Extract: x
Compression: c
For gz: z
For bz2: j
For display: v

Extract examples
gz file: tar xzvf xxx.tar.gz
bz2 files: tar xjvf xxx.tar.bz2

Compression examples
gz file: tar czvf xxx.tar.gz / path
bz2 files: tar cjvf xxx.tar.bz2 / path

0058 in a multi-level directory to find a way files (Qinghai Lake)
find / dir-name filename.ext
du-a | grep filename.ext
locate filename.ext

0059 not to ordinary users change their password (myxfc)
[Root @ xin_fc etc] # chmod 511 / usr / bin / passwd
They want normal user to change password
[Root @ xin_fc etc] # chmod 4511 / usr / bin / passwd

0060 graphics card configuration (win_bigboy)
To be determined


0062 utf8 encoding on how to make bmp player and play list display Chinese correctly
BMP Preferences - Plugins - Media-MPEG Audio plug-in - Preferences - heading select "Disable ID3V2 tags" and "non-UTF-8 ID3 converted into UTF-8" "usually cover title"
Fill in the text box ID3 encoding GB2312

0063 Redhat9 play mp3 files in the native x mms can not play MP3, mp3 plug-in to install a package x mms-mp3-1.2.7-13.p.i386.rpm.

0064 add Chinese characters under the current Linux free Chinese fonts are good uming, ukai, fireflysung, Wen Quan Yi afraid of copyright issues involved can copy Windows under simsun.ttc, tahoma.ttf, tahomabd.ttf
On the beautification of the various distribution methods are not the same situation, can refer to Linuxsir.org and other related forums.


0066 using Wubi and Pinyin, location, etc. Chinese input method from the http://www.fcitx.org download fcitx installation, refer to the above specific method of documentation.

0067 in Linux how to extract the rar file to download and install rar for Linux,
unrar xxx.rar

0068 how to add / remove rpm package yum is recommended to manage your system, automatically resolve package dependencies.

0069 characters under control volume (grub007 outer Lonely)
Using aumix. In addition, the volume level to save oss, the steps are:
1, Adjust the volume with aumix volume for your satisfaction
2, with the root user to / usr / lib / oss under (oss the default installation directory)
3, execution. / Savemixer. / Mixer.map
4, ok, after oss open after the first step is to adjust your volume up.
ps: read the README of the directory can be more useful information.

0070 using dd to do iso (grub007)
dd if = / dev / cdrom of = / tmp / somename.iso

0071 removed a few days before everything (including the directory name and the directory file) (shally5)
find.-ctime +3-exec rm-rf ();
find. /-mtime +3-print | xargs rm-f-r

0072 where the user's crontab (hutuworm)
/ Var / spool / cron / user-name under the name of the file

0073 to run a program as different user (bjchenxu)
su - username-c "/ path / to / command"
Sometimes need to run the special status of the program, you can do to su

0074 How to empty a file (bjchenxu)
echo> filename


0076 How to back up Linux systems reference tar or use better business software.

0077 linux partition tools under the command mode of the tool: fdisk
gnome graphical interface tool under: gparted
kde GUI partitioning tool under: qparted

0078 / proc / sys / sem representatives of each mean? (Sakulagi)
/ Proc / sys / sem as follows
These 4 parameters were SE MMSL (each user has the maximum number of semaphore), SEMMNS (system maximum number of semaphore),
SEMOPM (operations per semop system call number), SEMMNI (system maximum number of semaphore sets)

0079 Grub boot menu bigmem smp up all mean? (Lnx3000)
smp: (symmetric multiple processor) symmetric multi-processor mode
bigmem: support more than 1G of memory optimized kernel
up: (Uni processor) single-processor mode

0080 Oracle of the installation process why the garbled? (Lnx3000)
The installation process is now Oracle's support of the Chinese problem, use only English interface to install,
Before the implementation of runinstaller, run:
$ Export LANG = C
$ Export LC_ALL = C

0081 linux file and directory under the color mean anything (sakulagi, mentally handicapped)
Blue said the catalog; green for executable files; red compressed file; light blue indicates a link file; Gray said that other documents; red flashing that there is a problem linked documents;
Yellow is the device file, including the block, char, fifo.
With dircolors-p to see the default color settings, including a variety of colors and the "bold", underline, blinking and other definitions.

0082 to see how many activities httpd script (bjchenxu)
Write the following script, chmod + x test_ http.sh with executable permissions, then run the terminal can
#! / Bin / sh
while (true)
pstree | grep "* [httpd] $" | sed 's /.*-([ 0-9] [0-9 ]*)*[ httpd] $ / 1 /'
sleep 3

0083 How do I add a hard drive (nice)
First, shut down, if the physical connection is IDE hard disk drive, pay attention to the Lord, from the disk set; if SCSI hard drive, pay attention to choose not to use the ID of a
Second, boot to check the hard disk has not been detected in linux
dmesg | grep hd * (ide hard drive)
dmesg | grep sd * (SCSI drives)
Or less / var / log / dmesg
If you do not detect your new hard drive, reboot, check the connections to see if there is bios did not recognize it to.
3, area you can use fdisk, Sfdisk or parted (GNU partitioning tool, linux under the partition magic)
4, format
5, modify fstab
vi / etc / fstab

0084 linux partition under the label to see how ah (q1208c)
e2label / dev / hdxn, where x = a, b, c, d ....; n = 1,2,3 ...

0085 Redhat9 after installation to add new language pack on the third disc are similar looking package
ttfonts-zh_CN-2.12-1.noarch.rpm (Simplified Chinese)
ttfonts-zh_TW-2.11-19.noarch.rpm (Traditional Chinese)
Other similar

0086 terminal screenshots (tsgx)
cat / dev / vcsN> screenshot of them, N said that the first N-terminal also can run script screen.log, record on-screen information to screen.log years. For a record to your exit end. This is also a good way of screenshots.
This is the cookbook debian seen. Can be used in RH9 on. Not in the other systems tested.

0087 for a program to continue running after logout (NetDC, double eyelids pig)
# Nohup program name &
Or use the disown command can also be

0088 man command is not in the path, how to view the non-standard man files (bjchenxu)
nroff-man / usr/man/man1/cscope.1 | more


0090 edit / etc / inittab after the direct effect (bjchenxu)
# Init q

0091 for linux consecutive orders, the wrong stop (bjchenxu)
command1 & & command2 & & command3

0092 how to install grub to the mbr (bjchenxu, NetDC)
Interactive mode in grub
grub> root (hd0, 0)
grub> setup (hd0)
You can also use the repair mode
# Grub-install / dev / hda
To install grub.

0093 installation to write linux grub boot partition or the master boot sector (MBR) (bjchenxu)
If you want to boot directly into a computer operating system writes MBR grub boot menu put, if the write linux boot partition is to use boot disk boot. Proposed write MBR, convenient point, As write MBR unsafe, how to explain that? Every once installed Windows, MBR will be revised once, we think there is unsafe it?

0094 how to boot multiple systems to be added, look at the Digest -> "Installing update" -> "boot"

0095 how the graphical interface and console (character interface) switch back and forth between (bjchenxu)
a. graphical interface to the console: Ctr + Alt + Fn (n = 1,2,3,4,5,6).
b. The switch between the console: Alt + Fn (n = 1,2,3,4,5,6).
c. the console to the graphical interface: Alt + F7

0096 Linux commands see the essence of common areas

0098 reinstall windows cause linux does not direct reference to the essence of a solution area - Frequently Asked Questions

0099 Why is installed after the win2K LINUX slow (lnx3000, nice)
Old problems, you can see in 2000 is not Linux's logical drive, but can not access?
In Disk Management, the select the disk, right-click -> change the "drive name and path" -> "delete" on it, pay attention to not delete this site!


1101 linux burn iso in the method (hutuworm)
Method 1: Use xcdroast, select CD-ROM produced, select the ISO file, burn!
See http://www.xcdroast.org/xcdr098/faq-a15.html # 17
Method 2: Find the recorder command:
0,0,0 0) 'ATAPI' 'CD-R/RW 8X4X32' '5. EZ 'Removable CD-ROM
Burn the command:
cdrecord-v speed = 8 dev = 0,0,0 hutuworm.iso
Method 3: Use k3b can burn CD / DVD
k3b Home: http://www.k3b.org/
(K3b is a graphical interface, in fact, burn CD using the cdrecord, burn a DVD using a dvd + rw-tools http:
/ / Fy.chalmers.se / ~ appro / linux / DVD + RW /)

1102 how to do when the screen change to spend (double fold of the pig)
When you are not careless cat, a text document, then the screen will become flowers, you can double-click "Enter" key, then hit "clear", then the screen will return to normal of the ....

1103 how to uninstall the rpm package that specific package name (diablocom)
We all know the command to delete the package is rpm-e XXX, but when we do not know the exact spelling XXX when
Can use rpm-q-a check of all installed packages or use the rpm-qa | grep xxxx check out the name.

1104 under linux using the memory to / tmp folder (yulc)
In / etc / fstab to add a line:
none / tmp tmpfs default 0 0
Or in / etc / rc.local add
mount tmpfs / tmp-t tmpfs-o size = 128m
Note: size = 128m that / tmp can be used most 128m
Either way, as long as linux reboot, / tmp files all disappear under the

List only directories using ls 1105 (yulc)
ls-lF | grep ^ d
ls-lF | grep / $
ls-F | grep / $

1106 in the command line following the IP address of the machine, not get card information (yulc)
ifconfig | grep "inet" | cut-c 0-36 | sed-e 's / [a-zA-Z:] / / g'

1107 modified / etc / profile or $ HOME / .profile file to take effect immediately (peter333)
# Source / etc / profile (or source. Profile)

1108 bg and fg the use of (bjchenxu)
Enter ctrl + z, the current task is suspended and the suspension, and return the process number on the screen, this time with "bg% process number" put back the implementation of this process will, but with "fg% process ID" on allow this process to run into the foreground. In addition, job order to view the current process by bg

1109 ctrl + s and ctrl + q (bjchenxu)
ctrl-s to suspend sending data to the terminal, the screen just as dead, able to use ctrl-q to resume

1110 catalog statistics script (bjchenxu)
Save as total.sh, then total.sh absolute path, the directory path can be the size of statistical code:
#! / Bin / sh
du $ 1-max-depth = 1 | sort-n | awk '(printf "% 7.2fM ->% sn", $ 1 / 1024, $ 2)' | s
ed 's :/.*/([^/]{ 1 ,})$: 1: g'

1111 grep process itself does not appear (bjchenxu)
# Ps-aux | grep httpd | grep-v grep
grep-v grep show you can cancel the implementation of the grep itself, this process,-v parameter is not displayed process name listed

1112 to delete the directory containing the file keywords (WongMokin)
find / mnt / ebook /-type f-exec grep "enter keyword" ();-print-exec rm ();

1113 does not allow cron tasks in feedback information, check for 5 minutes in this case the message (WongMokin)
0-59/5 * * * * / usr / local / bin / fetchmail> / dev / null 2> & 1

1114 rpm in the current directory, extract the file (bjchenxu)
cat kernel-ntfs-2.4.20-8.i686.rpm | rpm2cpio | pax-r

1115 merger of the two Postscript or PDF file (noclouds)
$ Gs-q-dNOPAUSE-dBATCH-sDEVICE = pswrite
-SOutputFile = bar.ps-f foo1.ps foo2.ps
$ Gs-q-dNOPAUSE-dBATCH-sDEVICE = pdfwrite
-SOutputFile = bar.pdf-f foo1.pdf foo2.pdf

1116 to remove the manual directory apache all. En suffix name (bjchenxu)
Access to the manual directory code: find. /-Regex .*. en | awk-F. '(Printf "mv% s.% s.% s.% s% s.% s.% sn", $ 1, $
2, $ 3, $ 4, $ 1, $ 2, $ 3) '| sh

Since 1117 to more than X (noclouds)
startx by default display: 0.0 as the first X, by passing parameters to the Xserver can play a number of X:
# Startx -: 1.0
# Startx -: 2.0
Then Ctrl-Alt-F7/F8 ... switch.

1118 for a program to continue running after logout (noclouds, bjchenxu)
# Nohup command &

1119 to see Linux boot screen display information (bjchenxu)
After the start command dmesg View

1120 so that vi does not ring (sakulagi)
echo "set vb t_vb =">> ~ /. vimrc

1121 to fedora boot automatically login (dzho002)
1) rpm-ihv autologin-1.0.0-7mdk.i586 rpm
2) the establishment of file / etc / sysconfig / autologin
Add a line in it.
USER = username

1122 Redhat / Fedora configuration to what service to start (the outer Lonely, q1208c)
Method 1 Run ntsysv or setup command, enter the menu for configuration 2 chkconfig-list display services
chkconfig name on / off on / off "name" service

1123 Safely Remove linux (outer Lonely)
Step 1 Dos to use fdisk / mbr or boot into the CD-ROM with win2000/xp Recovery Console, use the command fixmbr
Step 2 format the linux partition to windows partition can be.

1124 with the grub boot into the text interface (outer Lonely)
Into the grub, press a, enter a space 3 can be guided into the text interface, but does not modify the operation of the system level, only when the sub-effective.

1125 to test whether the patch to run properly, they will not be changes to the kernel (jiadingjun)

1126 redhat and debian install to delete files on the usage (NetDC)
Remove a package:
Display the contents of a package:
Show all installed packages:
Print a package of information:
Test package characteristics:
Test which package a file belongs to:
Install new packages:

1127 how to make a new user for the first time after landing force change password (Cat)
# Useradd-p "testuser; chage-d 0 testuser

1128 log maintenance tools logrotate (hotbox)
In / etc / logrotate.conf configured, role: to define log file size or time scheduled, automatic compression
log file

1129 Linux What is the default administrator (bjchenxu)

1130 how to generate a fixed length (such as file length 1M) byte empty file, that is, the value of each byte are all
0 × 00 (sakulagi)
dd if = / dev / zero of = / tmp / zero_file bs = 1024 count = 1024

1131 RedHat Linux in modified step (hutuworm)
1. Set your time zone: timeconfig Select Asia / Shanghai (GMT +8 China, if you are in the area)
2. With the standard time server calibration: ntpdate time.nist.gov
Of course, if you are Li Ka-shing, you can watch with your own calibration: date-s STRING (STRING format see man date)
3. Write back to the hardware clock: hwclock-systohc

1132 Find the file and change the current directory extension (2002 summer)
Change all. Ss file. Aa
# Find. /-Name "*. ss"-exec rename. Ss. Aa '()';

1133 patch use (※ Genius Sakuragi)
Syntax is the patch [options] [originalfile] [patchfile]
For example:
patch-p [num]
-P parameter determines whether to use read the source file name prefix directory information, does not provide-p parameters, then ignore all directory information,-p0 (or-p
0) that the use of all the path information,-p1 will ignore the first "/" before the directory, and so on. Such as / usr / src
/ Linux-2.4.16/Makefile such a file name, in the provision of-p3 parameters will be used linux-2.4.16/Makefil
e as a patch file to be.
For the earlier example of a Linux kernel source 2.4.16 update example, assume that source directory located at / usr / src / linux, then in the current directory is / usr / src use "patch-p0

1134 to file.txt in the 123 to 456 (hutuworm)
Method 1
sed 's/123/456/g' file.txt> file.txt.new
mv-f file.txt.new file.txt
Method 2
vi file.txt
Enter the command:
:% S/123/456/g

1135 will be a partition formatted as ext3 journaling file system (hutuworm)
mkfs-j / dev / hdaN

1136 Open Hard ATA66 (laixi781211)
/ Sbin / hdparm-d1-X68-c3-m16 / dev / hda

1137 view the current run-level (double fold of pig)

1138 view the current log status (double fold of pig)
(1) who am i
(2) whoami
(3) id
Note (1) with (2) the small difference between

1139 can not remove rpm-e to delete the package (wwwzc)
1, remove the package if you remove the package directory before
2, if the system in a package is installed twice (because of some anomalies caused by)
rpm-e multi-installed-pkgs-allmatches

1140 how to customize the information displayed when users log on (jiadingjun)
In the / etc directory delegated a text file named motd achieved, for example, create your own / etc / motd:
$ Cat / etc / motd
welcome to my server!
Then, when the user logs on the system when this message appears:
Last login: Thu Mar 23 15:45:43 from *.*.*.*
welcome to my server!

1141 Root empty the Recycle Bin command file (dtedu)
cd / var / .Trash-root
rm-rf *

1142 in the Red Hat add Simsun.ttc font (bjchenxu)
To Red Hat 9, for example, select the installation to install simplified Chinese, the first copy of a simsun.ttc to / usr / share / fon
t / TrueType, renamed simsun.ttf; and then go to / usr / share / font / TrueType directory, run the tt
mkfdir> fonts.dir command; then fonts.dir file with vi editor, to have simsun.ttf lines read as follows:
Then run
$ Cat fonts.dir> fonts.scale

1143 Unicon and Zhcon differences and the role of (bjchenxu)
Unicon is the core state of Chinese platform, based on the modified Linux FrameBuffer and Virtual Console (fbcon)
Achieved. As the underlying implementation in the system, therefore, excellent compatibility, you can directly support the gpm mouse. However, relatively dangerous, a little flaw might endanger system security. Zhcon Chinese platform is the user state, a bit like UCDOS.

How to uninstall 1144 to install tar format software (bjchenxu)
Access to install the software source code directory, run make uninstall. If not, you can also look Makef
ile documents, mainly the install part, find the tar format from which files are copied to any path, then go to the appropriate directory to delete.

1145 custom linux prompt (bjchenxu)
In the bash prompt is in an environment variable $ PS1 through specified. With export $ PS1 view the current value of intuitive common prompt can be set to export PS1 = "[u @ h W] $". One representative of the user name u, h on behalf of the host name, W on behalf of the last layer of the current working directory, if an ordinary user $ gives the $, root user #.

1146 in the vi search for a word, the word to highlight it looks very uncomfortable, how can it get rid of (b
In vi command mode, enter: nohlsearch on it. Also in ~ /. Vimrc write the following statement in there will be highlighted:
set hlsearch
With the following statements would not have highlighted:
set nohlsearch

1147 how to find out the system all the *. cpp, *. h files (bjchenxu)
With the find command on it. But if from the root directory to find a higher consumption of resources, use the following command to:
find /-name "*. cpp"-o-name "*. h"

1148 to install Debian need a few disks enough? All have to download? (Bjchenxu)
If you have a good network environment, download the first on it. Without the network environment is not recommended if D
ebian, because Debian mainly relies on the network to update the software.

1149 Debian first CD Why are there two versions? debian-30r1-i386-binary-1.iso and debian-
30r1-i386-binary-1_NONUS.iso the download this? They differ? (Bjchenxu)
As with "non-US" (not an American) software can not legally set up in the United States stored in the server.
Previously, the reason is usually because the software contains a strict password encoding, and today, it is because the program uses the algorithm of U.S. patent protection. Everyone should access to "non-US" to be used for private purposes; but not the identity of the iso
Only on the set up in the United States will only be useful mirror and suppliers. Other binary does not contain any of the CD "US-sensitive" (and the U.S. related) software, they and other kinds of binary-1 CD-ROM as the operation very well. Therefore, personal use or download debia
n-30r1-i386-binary-1_NONUS.iso version.

1150 Why do I use the umount / mnt / cdrom command device is busy a time of such statements can not be u
mount (bjchenxu)
When using the umount must ensure that exit / mnt / cdrom this directory, exit the directory, you can use u
mount / mnt / cdrom was.

1151 I am using a laptop computer, how can we left in the console shows how much power it now? (Bjchenxu)
Use apm-m you can see how many minutes, the specific parameters can be man apm view.

1152 Why I entered the Linux terminal window, man is garbled a command out of it? (Bjchenxu)
This is because your character set settings. Temporary solution you can use the export LANG = "en_US". To modify the words not always in / etc/sysconfig/i18n files which modify the LANG = "en_US" on it.
Can do for a user, so that individuals can change the interface language, without affecting other users. Command as follows: # cp
/ Etc/sysconfig/i18n $ HOME/.i18n.

Error 1153 when compiling the kernel, indicating "Too many open files", I ask how to deal with (bjchenxu)
This is because the default file-max value (8096) is too small. To solve this problem, you can run the following command as root (
Or add them to / etc / rcS.d / * init script under):
# Echo "65536"> / proc / sys /
Finally enter the unpacked directory, run the install command.
# Cd vmware-linux-tools
#. / Install.pl


1155 installed a Linux server, and want to compile the kernel, step by step down, GRUB also be added, and
However, there is "kernel Panic: VFS: Unable to mount root fs on 0:00" error, how does that matter? (Bjchenxu)
Under normal circumstances initrd the file on the desktop is not required, but the server has SCSI devices is necessary. There may have not had time to compile the kernel initrd the file, so there will be above error.
Users can use the mkinitrd command to build a initrd.img file, and then joined the GRUB, reboot try.

1156 how to set up user login welcome message? (Bjchenxu)
Modify / etc / motd file, fill it to write the text, it will enable users to log in via Telnet correct, the implementation of Shell before the corresponding message.
motd is the "messages of the day", that is, the meaning of the day information. Entered, the administrator can write a number of issues requiring attention or notification to remind the official user.

1157 I downloaded the rcs5.7, with. / Configure & & make & & make install when the error is as follows:. / Conf.
sh: testing permissions .... / conf.sh: This command should not be run with su
peruser permissions. I used the root user login compiled installed, why is it so? (Bjchenx
Some software were actually taken into account security and other reasons can not compile the root user. Then just compile with other users, to make install this step, if the software is installed on the user does not belong to compile the main directory, you need to use the su command to convert the root user and then implementation of the make install.

1158 I installed USBView failed, as follows: # rpm-ivh usbview-1.0-9.src.rpm wa
rning: usbview-1.0-9.src.rpm: V3 DSAsignature: NOKEY, key IDab42a60e (bjchenxu)
This line of code to install the failure is because your system is not installed on the appropriate key to verify signatures. To make the package by check, you can import Red Hat's public key to solve the specific way to run the following command in the Shell:
# Rpm-import / usr / share / rhn / RPM-GPG-KEY
(Case sensitive)

1159 How to prevent a critical file is modified? (Bjchenxu)
In Linux, some configuration files is not allowed any person (including root) changes. In order to prevent being accidentally deleted or modified, you can set the file "can not modify the bit (immutable)". Command as follows:
# Chattr + i / etc / fstab
If you need to modify the file then use the following command:
# Chattr-i / etc / fstab

1160 How to limit a user can start the process a few? (Bjchenxu)
Ascertain what / etc / pam.d / login file, the existence of the following line:
session required / lib / security / pam_limits.so
Then edit / etc / security / limits.conf, in which the process can be set to limit the number of users, CPU utilization and memory utilization, such as hard nproc 20 refers to the limit of 20 processes, specifically to see man.

1161 How to limit the size of Shell command history? (Bjchenxu)
By default, bash in the file $ HOME / .bash_history in the record store up to 500 commands. Sometimes, depending on the systems, the default number of records different. System, each user's home directory has a such a document. For system security, I strongly recommend that users limit the size of the file. Users can edit / etc / profile file,
Modify one of the options below:

This will be recorded in order to reduce the number of Article 30.

1162 I want to show startup information retained in order to check the computer out the problem areas, how do I ask? (B
Enter the following commands:
# Dmesg> bootmessage
This command will display the message at boot time redirect the output to a file bootmessage in.

1163 I would like to delete order records in the write-off, may I ask how? (Bjchenxu)
Edit / etc / skel / .bash_logout file (did not create one), add the following lines:
rm-f $ HOME / .bash_history
In this way, the system when all users log off command will remove records.
If only for a specific user, such as the root user settings, the user can only modify the $ home directory
HOME / .bash_history file, the same line can be increased.


1165 How to use ssh channel technology (bjchenxu)
This article discusses all the machines are Linux operating system.
For example, my machine is A, the middle server B, the target server is C.
You can ssh from A to B, from B to ssh to C, but A can not be directly ssh to C.
Now showing use ssh access technology to transfer files directly from A to C.
1. Ssh-L1234: C: 22 root @ B
input B's password
2. Scp-P1234 filename root @ localhost:
input C's password

1166 using the rpm command no response, how to solve (beginner photography)
rm-rf / var / lib / rpm / __db .*

1167 to login to the same server send a message to all users (bjchenxu)
1) Enter the wall and Enter
2) Enter the message to be sent
3) The end of the press "Control-d" key, the message that is displayed in the user's control window

Enter a short message 1168 to a single user (bjchenxu)
1) Enter write username, when the user name appears in multiple terminal, after the user name plus tty, to indicate in which
tty of the user.
2) Enter the message to be sent.
3) The end of the press "Control-d" key, the message that the user's control window.
4) The party receiving a message, you can set whether to allow people to send messages to you.
Instruction format is: mesg n [y]
% Write liuxhello! Everybody, I'llcome.
User Control window displays a message: Message from liux on ttyp1 at 10:00 ... hello! Everybod
y, I'llcome. EOF
When using the CDE or OpenWindows window system, etc., each window is seen as a separate logon; more than once if the user is logged on the number of message sent directly to the control window.

1169 to send the file in the message to a single user (bjchenxu)
If there is a long message to send to several users, with the papers:
1) Create a text message to send the file filename.
2) Enter write username
% Cat> messagehello! Everybody, I'llcome.
% Write liux
% Users in more than window login, the message displayed in the control window Message from liux on ttyp1 at 1
0:00 ... hello! Everybody, I'llcome. EOF

1170 to the remote machine to send messages to all users (bjchenxu)
Use rwall (to all the remote write) command also sends a message to all users of the network.
rwall hostname file
When using the CDE or OpenWindows window system, etc., each window is seen as a single login;
If the user is logged on more than one message number sent directly to the control window.

1171 to all network users to send messages (bjchenxu)
Send a message to all users of the network
1) Input rwall-n netgroup and Enter
2) Enter the message to be sent
3) The end of the press "Control-d" button, a message that the system for each user control window display, the following is a message to the network system administrator for each user group Eng examples:
% Rwall-n EngSystem will be rebooted at 11:00. (Control-d)
User Control window message: Broadcast message from root on console ... System will be r
ebooted at 11:00. EOF
Note: You can also rwall hostname (hostname) command to the system to all users.

1172 I need to compile the kernel, where the kernel source?
Most current releases are no longer with the default source, if required, free to download
Can go www.kernel.org download a copy of your favorite, the school has kernel image.

---------- --------- Network-related articles

2001 to apache's default character set into Chinese (bjchenxu)
vi httpd.conf, find AddDefaultCharset ISO-8859-1 line
apache version 1 .* If, instead AddDefaultCharset GB2312
If 2.0.1-2.0.52, to AddDefaultCharset off
Then run / etc / init.d / httpd restart restart apache to take effect.
Note: For 2.0.53 or later, do not modify any configuration, can support Chinese.

2002 change change ip address and MAC IP:
New ip ifconfig eth0
Then edit / etc/sysconfig/network-scripts/ifcfg-eth0, modify ip

Change MAC:
ifconfig eth0 down
ifconfig eth0 hw ether 00:06:61:6 A: 7B: 8B
ifconfig eth0 up
For each boot automatically change the above three commands can be added to / etc / init.d / network last

2003 Linux on the remote display from the Windows Desktop (lnx3000)
Install rdesktop

2004 manually add the default gateway (bjchenxu)
To root user, do: route add default gw gateway IP

1 vi / etc/sysconfig/network-scripts/ifcfg-eth0 change GATEWAY
2 / etc / init.d / network restart

2005 Linux use msn and QQ
MSN: Install gaim or aMSN download
QQ: Install LumaQQ or the eva, eva recommended to use KDE.

2006, 22 ports are run to identify the procedure (bjchenxu)

2007 view of the machine's IP, gateway, dns (bjchenxu)
To root users log on, the implementation of ifconfig. Where eth0 is the first piece of card, lo is the default device
To root user login, do the netstat-rn, to at the beginning of a line of Gateway shall be the default gateway can also check / etc / sysconfig / network file, which has the specified address!
more / etc / resolv.conf, the content designated as follows:

2008 Redhat ping command line to change the TTL value (cgweb, lnx)
Method 1 (valid after reboot):
# Sysctl-w net.ipv4.ip_default_ttl = N
(N = 0 ~ 255), if N> 255, then ttl = 0
Method 2 (after restart invalid):
# Echo N (N is 0 ~ 255)> / proc/sys/net/ipv4/ip_default_ttl

2009 Open LINUX-IP forwarding (houaq)
Edit / etc / sysctl.conf, such as the
net.ipv4.ip_forward = 0
net.ipv4.ip_forward = 1
After rebooting into force, with a sysctl-a view known

2010 mount the other windows machines on the LAN of the directory (bjchenxu)
Install samba
mount-t smbfs-o username = guest, password = guest / / machine / path / mnt / cdrom

2011 allowed | prohibited root login via SSH (Fun-FreeBSD)
Modify the sshd_config: PermitRootLogin no | yes

2012 so that direct root telnet login (bjchenxu, platinum)
Method 1:
Edit / etc / pam.d / login, to remove
auth required / lib / security / pam_securetty.so words Method 2:
vi / etc / securetty
pts / 0
pts / 1


2014 to automatically synchronize linux time (shunz)
vi / etc / crontab
00 0 1 * * root rdate-s time.nist.gov

2015 Linux reference Digest of online resources - Information Resources

2016 to change the sshd port (bjchenx)
In / etc / ssh / sshd_config to add a line: Port 2222, / etc / init.d / sshd restart restart the daemon

2017 to change the telnet port (bjchenxu)
The / etc / services file, telnet port number corresponding to 21 to the value you want, / etc / init.d / xinetd r
estart restart the daemon

2018 terminal mode in question (sakulagi)
export TERM = vt100

2019 copy HyperTerminal, LINUX in the procedure to connect the router and switches (alstone)

2020 ssh can not come up to automatically disconnect (wind521, double eyelids pig)
Modify your HOME directory. Bash_profile file, add
export TMOUT = 1000000 (in seconds)
And then run the source. Bash_profile

2021 What tools do intrusion detection (bjchenxu)

2022 Linux memory leak detection program under tools (bjchenxu)
cchecker or efence library can

2023 linux how to monitor all the data card through the machine (bjchenxu)
tcpdump or iptraf

2024 Why is the implementation of many root command said command not found (bjchenxu)
Telnet you up, and then su into root of it, change your su command to change the format, should be su - root

2025 shut down the user's POP3 rights (tiansgx)
The POP3 port closed on it. In the file / etc / services to find this line pop-3 110/tcp before this line add a '#', it commented on it.

Play flash animation under the 2026 linux download ftp:// ftp.bjtu.edu.cn / UNIX / multimedia / flashplayer /
$ Tar zxf install_flash_player_7_linux.tar.gz
$ Cd install_flash_player_7_linux
$. / Flashplayer-installer
Installed according to their own path to the browser settings, and then open the flash file to the browser.


2028 server, how to prevent telnet (Zhiqiu leaf)
The server must start the telnet service & & server firewall to allow telnet.

2029 to prevent anyone using the su command to become root (xiaohu0)
1.vi / etc / pam.d / su
auth sufficient / lib / security / pam_rootok.so debug
auth required / lib / security / pam_wheel.so group = wheel
2. In the / etc / pam. D / su configuration file defines the wheel group.

2030 how to make the lynx browser to visit the Chinese website (Ghost_Vale)
View Simplified Chinese website following changes to settings on
Save options to disk: [X]
Display and Character Set
Display character set: [Chinese________________________]
Assumed document character set (!): [Iso-8859-1______]
CJK mode (!): [ON_]
Then move to the bottom of the Accept Changes can be saved by pressing Enter the system of course you can to support Simplified Chinese

2031 network card activated, but unable to get online, how do? (Slock, double eyelids pig)
traceroute, look in the end is that one is standing in the way of.
1.ping own
2.ping Gateway
3.ping DNS
4.traceroute DNS
If all
nslookup www.bjtu.edu.cn
ping sina's address
traceroute sina's address
Basically you can know the result

2032 under the redhat9 with samba, win2000 can access, win98 can not access? (Squall2003)
If it is necessary to modify the registry wind98:
HKEY_LOCAL_MACHINE / system / correntcontrolset / services / Vxd / VNETSUP build a D value under:
EnablePlainTextpasswd, key 1

2033 how to get the network card MAC address (bjchenxu, hutuworm)
arp-a | awk '(print $ 4)'
ifconfig eth0 | head -1 | awk '(print $ 5)'

2034 how to get the network card IP address (mb)
ifconfig eth0 | awk '/ inet addr / (split ($ 2, x ,":"); print x [2])'

2035 how to modify the Linux machine where the Working Group (hutuworm)
vi / etc / samba / smb.conf, modify the "workgroup =" line, the group name written on the back.

2036 a network card to bind two ip (linuxloveu)
# Cd / etc / sysconfig / network-scripts
# Cp ifcfg-eth0 ifcfg-eth0: 1
# Vi ifcfg-eth0: 1
Modify the IP and device name
Debian bind multiple ip next card method (NetDC)
Modify / etc / network / interfaces
auto eth0
iface eth0 inet static

auto eth0: 1
iface eth0: 1 inet static
Modify / etc / network / ifstate
lo = lo
eth0 = eth0
eth0: 1 = eth0: 1
Then / etc / init.d / networking restart on it.
Bind more than one network card ip to another method (hotbox)
In / etc / sysconfig / network-scripts / create a file: ifcfg-ethX-rangeX ("X" for the card number)
Content of the document:
Can have 256 ip

2037 How to bind an ip two network cards (hutuworm)
Assuming is the ip, is the gateway:
/ Sbin / modprobe bonding miimon = 100 mode = 1
/ Sbin / ifdown eth0
/ Sbin / ifdown eth1
/ Sbin / ifconfig bond0
/ Sbin / ifenslave bond0 eth0 eth1
/ Sbin / route add default gw


2039 linux arp table under the clear command (NetDC)
# Arp-d-a (applies to bsd)
for HOST in `arp | sed '/ Address / d' | awk '(print $ 1)'`; do arp-d $ HOST; done

2040 using the ntp protocol from the server synchronization time (NetDC)
ntpdate NTP-SERVER cases: ntpdate

2041 host command usage (bjchenxu)
host can be used to query domain name, it can get more information
host-t mx example.com example.com can check out the MX records, and handle mail in the host name
host-l example.com will return all registered under the example.com domain
host-a example.com will display the host information for all domain names.

2042 immediately so that LINUX support for NAT (platinum)
echo 1> / proc/sys/net/ipv4/ip_forward


2044 in ethX device, so that LINUX support network radio feature (the default is not supported) (platinum)
ip route add dev ethX

2045 Route Set Manual (NetDC)
View the routing information:
Manually add a route:
route add-net netmask gw
Manually delete a route:
route del-net netmask gw
Well, following that important, let the system boot automatically enabled when the routing settings.
Add a route in redhat, modify file / etc / sysconfig / static-routes
any net netmask gw
Add a route in debian,

Method 1: Modify / etc / network / interfaces
auto eth0
iface eth0 inet static
up route add-net netmask gw
down route del-net netmask gw
Method 2: In the / etc / network / if-up.d directory to create a simple script file, such as static-route $ (
I remember a $ symbol at the end, or else have a run-parts will come out to tell you something) script the simplest thousand million,
#! / Bin / bash
route add-net netmask gw
Hey, you can guess / etc / network / directory of the role of other directory instead.
Found in the debian settings in this route in fact only its the configuration file with a relatively simple Yingyong it, you can always do more complex the application.

2046 using ssh to copy files (platinum)
If A, B have the SSH service, now in A, SSH in
1, from A Copy B (push in the past)
scp-rp / path / filename username @ remoteIP: / path
2, copied from B to A (pull over)
scp-rp username @ remoteIP: / path / filename / path
If one is not a LINUX system, you can use SecureFX software on WINDOWS

2047 samba3.0 Chinese display solutions to the problem (linuxzfp, jiadingjun)
In the samba 3.0 configuration file (/ etc / samba / smb.conf) the [global] add the following two sentences:
unix charset = cp936
Restart services
service smb restart

2048 network card MAC address of the temporary modification method of closed network card: / sbin / ifconfig eth0 down
Then change address: / sbin / ifconfig eth0 hw ether 00: AA: BB: CC: DD: EE
Then start the network card: / sbin / ifconfig eth0 up

2049 conntrack table full treatment (cgweb)
Configuration of iptables + squid while ago to do proxy server, has been working. Today I found on the console
Jun 18 12:43:36 red-hat kernel: ip_conntrack: table full, dropping packet.
Jun 18 12:49:51 red-hat kernel: ip_conntrack: table full, dropping packet.
Jun 18 12:50:57 red-hat kernel: ip_conntrack: table full, dropping packet.
Jun 18 12:57:38 red-hat kernel: ip_conntrack: table full, dropping packet.

IP_conntrack that connection tracking database (conntrack database), on behalf of NAT machine to track the number of connections, connection tracking table can hold a variable number of records are being controlled, it may be the kernel of ip-
sysctl function sets. Each track link table will occupy 350 bytes of kernel memory space, over time the space will fill up the default, then by default How much space? I redhat example in the memory when the machine 4096 64MB, 128MB memory is 8192, 256MB of memory is 16376, then will be able to / proc/sys/net/ipv4/ip_conntrac
k_max in view, setting.
For example: to 81920, you can use the following command:
echo "81920"> / proc/sys/net/ipv4/ip_conntrack_max

So setting is not saved, we must save after restart in / etc / sysctl.conf and Canada:
net.ipv4.ip_conntract_max = 81920
After the change in accordance with this method, all normal, and if the full increase its value can be.

Under the 2050 Linux how to use BT (atz0001)
BitStorm http://www.linuxfans.org/
azureus, http://azureus.sourceforge.net/

2051 Linux view the card's operating mode optical fiber (sakulagi)
PCI-X slot on the motherboard to insert a 64-bit fiber card, in LINUX9.0 environment, to know that it is working in 64 bit mode, you can use getconf WORD_BIT

2052 online alternative way to update RHEL
1. Install the appropriate APT package:
2. Online Update
apt-get update
apt-get upgrade

2053 SOCKS5 start to stop working after a period of time. With the command ps auxw | grep socks5 look and found many
SOCKS defunct process, why (bjchenxu)
Mainly to patch the problem. If socks5-tar.gz version is not patched, you must take the next patch v1
.0-R11 version, reinstall, run the problem can be solved.

2054 to install the VMware WorkStation 4.0.5 Debian 3.0, the tips not found the hard disk, required SCSI drive. But I use the IDE hard disk, how does that do? (Bjchenxu)
As the VMware partition of hard disk space the user into the virtual SCSI hard drives, and Debian install disk does not correspond to the driver,
And install other Linux versions, some in the beginning will be loaded SCSI drive, so there is no problem. Users can modify the VMware configuration, to read analog IDE hard drive on it.

2055 how to get behind Linux Gateway, under the user directly clicks WIN32 FTP connection to download? (Platinum)
modprobe ip_nat_ ftp

2056 Will the user's IP is dynamic, how to limit Squid in the same account at the same time, the number of line? (
Such as restrictions on individual users can only open 12 HTTP connections, use the following method:
acl all src
acl limit maxconn 12
acl localnet src
http_access deny localnet maxconn
http_access allow localnet
http_access deny all

2057 If I use a proxy server Squid proxy in this segment, such as its IP is 192.16
8.1.1, I have some clients in the the network segment, and how to set a proxy server to go through this? (Bjchenxu)
If no transparent proxy, the proxy directly in the browser option in settings on it. Otherwise, the proxy server first, then hang a card on IP as, add the appropriate routing, and then modify the squid.conf file Squid listening address and port, etc., and finally set the client segment The gateway, and then directly in the browser's proxy option in settings click on it.

2058 How to use netrc file for automatic FTP? (Bjchenxu)
In their own home directory, create a permission for the 600, the suffix name. Netrc file, as follows:
machine login admin password admin
This user login FTP server each subsequent time, the system will help the user to the user name admin,
Admin login password. This feature enables users to automatically FTP. For example, the user wants to 6:00 every day to 172.168
.15.1 Machine above was / admin directory files admin.txt, the following method can be done.
Create a file ftp_cmd, reads as follows:
cd admin
get amin.txt
Then use the crontab-e to set a timer task:
0 6 * * * ftp <ftp_cmd

2059 How to get ipchains log? (Bjchenxu)
When the user set the rules will be added-l parameter in / etc / messages which do record. But the proposal is still without a good, or the user's / etc / messages will become very large.

2060 How to not show other user's message? (Bjchenxu)
Users can use the mesg n to send the message to yourself against others, in fact, forbidden to write their own terminal authority above. When people try to re-use write to send their own messages, the sender will see prompt as follows:
write: user has messages disabled on pts / n

2061 minicom color display (double fold of the pig)
minicom-s to serial port configuration, and then configured,
minicom-o-c on
-O that does not initialize the
-C on that color on

2062 SELinux enabled the Apache configuration file httpd.conf which appear useless or modify the DocumentRoot 4
03 Forbidden error (arbor)
# Chcon-u system_u-t httpd_sys_content_t-R website directory

2063 apache2 the log file location how to customize the directory (tomi)
Edit httpd.conf inside
ErrorLog / var / log / http / error_log <== This is the tube errorlog of
CustomLog / var / log / http / access_log common <== This is the tube accesslog of

2064 whether to change eth0 promiscuous mode (wwy)
Network card into promiscuous mode eth0:
ifconfig eth0 promisc
Close promiscuous mode:
ifconfig eth0-promisc

2065 characters in the interface of ftp, download the entire folder (bjchenxu)
1. L ftp IP
2.> User username
3.> Mirror-c-parallel = number remotedir localdir
3a.> Help mirror

2066 how to make ssh only allow specified users log (xinyv, nice, wolfg, I love fishing)
Method 1: In / etc / pam.d / sshd file to add
auth required pam_listfile.so item = user sense = allow file = / etc / sshusers onerr =
Then in the / etc files under the build sshusers, edit this file, allows the use of ssh service on your user name, you can re-start sshd service.
Method 2: pam rules would also deny the written
auth required pam_listfile.so item = user sense = deny file = / etc / sshusers onerr = s
Method 3: In the sshd_config to set AllowUsers, formats such as
AllowUsers abc
Restart the sshd service, users can only a/b/c3 landing.

2067 in Linux How to bind IP address and hardware address (bjchenxu)
You can edit an address corresponding file, which records the IP address and hardware address of the corresponding relationship, and then do "arp
-F address corresponds to File. "If no corresponding address file is usually the next default file / etc / eth
ers shall prevail. Address corresponding to the file format is as follows: 00:0 D: 61:27:58:93 00:40: F4: 2A: 2E: 5C 00:0 A: EB: 5E: BA: 8E

2068 known network hardware address of a machine, how to know its corresponding IP address (bjchenxu)
In Linux, it is assumed to check "00:0 A: EB: 27:17: B9" a hardware address corresponding to IP addresses, you can use the following command:
# Cat / proc / net / arp | grep 00:0 A: EB: 27:17: B9 0 × 1 0 × 6 00:0 A: EB: 27:17: B9 * eth2
In addition, you can also use the "arp-a" command queries:
# Arp-a | grep 00:0 A: EB: 27:17: B9
( at 00:0 A: EB: 27:17: B9 [ether] on eth2

2069 based on Apache HTTPD or Sendmail service is suspended during startup, and how to solve this problem (bjchenxu)
Encounter such problems, make sure that / etc / hosts file has the following line: localhost.localdomain localhost is the address of the network loop.

2070 how to make the Linux system does not respond to the ping (bjchenxu)
For Linux on the ping did not respond, that is to ignore the Linux system I CMP package. Use the following command for this purpose:
# Echo 1> / proc/sys/net/ipv4/icmp-echo-ignore-all
To resume, the following commands available:
# Echo 0> / proc/sys/net/ipv4/icmp-echo-ignore-all

---------- --------- Programming articles

3001 linux debug core files (bjchenxu)
: Error generated core dump of the executable.
: Core dump file name, the default is the "core"

3002 gcc abc.c get a.out can not run (bjchenxu)
. / A.out

3003 c + + compile-time error message that cout Why not defined (bjchenxu)
After accession to include the header file using namespace std;

3004 generated new compiler gcc, use the standard connection library in / usr / local / lib under, but the connection using the default path is / usr / lib How do I add? (Except when the increase in per compile-L / usr / local / lib away)
(Sakulagi, hutuworm)
export LD_LIBRARY_PATH = $ LD_LIBRARY_PATH: / usr / local / lib
Write ~ /. Bash_profile inside.
A simple way to increase:
The / usr / local / lib added / etc / ld.so.conf, then run a ldconfig

3005 RH9 installation under the GCC (As Time Goes By, hutuworm)
Choose one of three ways:
(1) the use of CD to install on rpm
CD-1: compat-gcc-7.3-2.96.118.i386.rpm
CD-1: compat-gcc-c + +-7.3-2.96.118.i386.rpm
CD-1: libgcc-3.2.2-5.i386.rpm
CD-2: compat-gcc-g77-7.3-2.96.118.i386.rpm
CD-2: compat-gcc-java-7.3-2.96.118.i386.rpm
CD-2: compat-gcc-objc-7.3-2.96.118.i386.rpm
CD-2: gcc-3.2.2-5.i386.rpm
CD-2: gcc-c + +-3.2.2-5.i386.rpm
CD-2: gcc-g77-3.2.2-5.i386.rpm
CD-2: gcc-gnat-3.2.2-5.i386.rpm
CD-2: gcc-java-3.2.2-5.i386.rpm
CD-2: gcc-objc-3.2.2-5.i386.rpm
Such encounter prompted:
warning: gcc-3.2.2-5.i386.rpm: V3 DSA signature: MOKEY key ID db42a60e
error: Failed dependencies:
binutils> = is needed by gcc-3.2.2-5
glibc-devel> = 2.3.2-11.9 is needed by gcc-3.2.2-5 ...
To install glibc-devel package, and so on
(2) The better way is to choose the X-window under the "Main Menu" ─ ─> "System Settings" ─ ─> "Add / Remove Applications" ─ ─> "development tools" in the gcc and install it
(3) up2date gcc will automatically solve the dependency problem

3006 shell script, why not run (GOD_Father)
First, the script permissions for executable # chmod + x test.sh
Second, the script in a directory in the PATH environment variable, or direct execution #. / Test.sh

3007 See what process a file is read-write (bjweiqiong)
lsof filename

3008 See what files a process opened (bjweiqiong)
lsof-c process name
lsof-p process ID

3009 lsof mean (bjweiqiong)
list open files

3010 lsof use small whole (bjweiqiong)
lsof abc.txt shows the process of opening files abc.txt
lsof-i: 22 to know what program to run 22-port now
lsof-c nsd nsd process is now open display file
lsof-g gid gid ownership of the process shows the situation
lsof + d / usr / local / display directory of files opened by the process
lsof + D / usr / local / Ibid, but will search the directory of directories, a long time
lsof-d 4 shows the process of using fd 4
lsof-i to demonstrate compliance with the conditions of the process conditions
Syntax: lsof-i [46] [protocol] [@ hostname | hostaddr] [: service | port]
46 -> IPv4 or IPv6
protocol -> TCP or UDP
hostname -> Internet host name
hostaddr -> IPv4 Location
service -> / etc / service in the service name (can be more than one)
port -> port number (can be more than one)
Examples: TCP: 25 - TCP and port 25
@ - Internet IPv4 host address
tcp@ohaha.ks.edu.tw: ftp - TCP protocol host: ohaha.ks.edu.tw service name: ftp
lsof-n do not convert the IP hostname, the default is not with-n parameter example: lsof-i tcp@ohaha.ks.edu.tw: ftp-n
lsof-p 12 to see the process number 12 which documents the process of opening
lsof + |-r [t] control lsof repeated execution, the default is 15s refresh
-R, lsof will always keep the execution until the interrupt signal is received
+ R, lsof will always be executed until there are no files were shown examples: ftp connection constantly see the current situation: lsof-i tcp@ohaha.ks.edu.tw: ftp-r
lsof-s list to open the file size, if not size, is left blank
lsof-u username to UID, list open files

---------- --------- Classic books articles

4001 GNU / Linux Advanced Network Application Services Guide (bjchenxu)
Mechanical Industry Press linuxaid site advantages: it all and concise, as are all the shortcomings of combat: For the lower version for redhat 6.2

4002 Linux Apache Web Server Administration Guide (Linux Apache Web Server Administration) (
Charles Aulds Mashu Qi / Jin Yan Translation Publishing House Electronics Industry Benefits: I have not found the problem which this book on apache not discussed drawbacks: for 1.3.x, the latest for 2.0 .* The English version of the Chinese version When the

4003 Linux Kernel Scenario Analysis (bjchenxu)
Maud parade / Hu Ximing, Zhejiang University Press Advantages: very thorough, and can not understand Disadvantages: or version problem, the kernel update too fast, but still required reading

4004 Unix environment for high-level programming (bjchenxu)
Richard Stevens
Machinery Industry Press Advantages: profound weaknesses: it is very difficult for beginners to understand, otherwise how is "Advanced Programming" mean?

4005 Programming Highlights-Microsoft preparing high-quality c program error-free tips (bjchenxu)
Steve Maguire
Electronic Industry Press Advantages: do not say, and the author is a senior Microsoft engineers Disadvantages: hard to find, out of 1994

4006 Understanding the Linux Kernel, 2nd Edition (hutuworm)
Daniel P. Bovet & Marco Cesati
O'Reilly Press, after reading this book, you will understand the circumstances under which Linux has the best performance, and how it challenges, in various environments to provide process scheduling, file access and memory management when excellent system response. On to the introduction by explaining the importance of each subject, and the kernel and the Unix operating system programmers and users familiar with the utilities call or link.

4007 UNIX Operating System Tutorial (English) (MH)
Syed Mansoor Sarwar, etc. Machine Press features: easy to understand, focus on basic unix concepts and overall understanding of the way English review.
Also: Mechanical Industry Press has published the Chinese version, the name of: UNIX Tutorial

4008 UNIX programming environment (mentally handicapped)
Brian W. Kernighan, Rob Pike Xiang-Qun Chen, M. Machine Press features: simple and obvious, easy to understand on how to use UNIX and a variety of tools, a brief introduction Unix programming environment; contrast "U
NIX high-level programming environment ", this book suitable for beginners.

4009 The Art of UNIX Programming (hutuworm)
Eric Steven Raymond

http://catb.org/ ~ esr / writings / taoup / html /

分类:OS 时间:2010-05-12 人气:835
blog comments powered by Disqus


  • linux yum reproduced using the detailed use of management 2010-11-21

    yum is yellowdog updater modified acronym. yellowdog is a Linux-distribution, RH will upgrade the technology used in this form their own distribution now yum (a similar principle and apt, but apt is the compiled code, the efficiency is much higher th

  • linux yum reproduced using detailed use management 2010-11-21

    yum is yellowdog updater modified abbreviation. yellowdog is a Linux distribution, RH will this technology be used to upgrade their distribution form the current yum (similar principle and apt, but apt is the compiled code, the efficiency is much hig

  • Modify the hostname in Linux How to view the Linux IP 2011-06-17

    Query, modify host information First, how to modify the Linux host name 1 to change the current host name 1.1 echo new-hostname> / proc / sys / kernel / hostname (system startup, the host read from the file name) 1.2 hostname new-hostname (with immed

  • use and management of more use linux yum reproduced. 2010-08-29

    yum is the abbreviation yellowdog updater modified. yellowdog is a Linux-distribution, RH will this technology be used to upgrade their distribution form the current yum (a similar principle and apt, but apt is compiled code, the efficiency is much h

  • 配置Linux YUM源设置使用代理 2013-05-08

    在向大家详细介绍Linux YUM之前,首先让大家了解下Linux YUM,然后全面介绍Linux YUM,希望对大家有用.Fedora 10的Linux YUM源设置.RPM Fusion 团队宣布 Fedora 10 的软件仓库可以使用了! RPM Fusion 由之前的 Dribble,Freshrpms,和 Livna 合并而来并成为一个超级软件仓库,专门为 Fedora,CentOS以及RHEL提供官方不能提供的软件.Fedpra 10为我们带来了很多 Linux 的最新特性,比如,F

  • Q reproduced wonderful word linux 2011-06-06

    Reproduced: http://bbs.chinaunix.net/thread-2283984-1-1.html Was wonderful, Mo Kanwan, backup collection - Network independent papers -------------------------- 1001 to modify the hostname (Chen Xu) vi / etc / sysconfig / network, modify the HOSTNAME

  • linux under a single IP multiple websites with Apache multi-domain configuration 2011-06-13

    linux under a single IP multiple websites with Apache multi-domain configuration If two domains, namely desk.xker.com and tool.xker.com, take these two domains are bound to Server IP is 1, first need to specify the domain name supplier m

  • U disk or CD-ROM can be run on LINUX (comes with powerful software packages and development tools) 2010-09-04

    1, Knoppix Knoppix will be a special, very useful Linux distribution is packaged in a one bootable CD-ROM on. Knoppix is a bootable CD. Although this certainly more than Knoppix bootable CD this one, but the Knoppix CD in the organization and content

  • CentOS 5.2, Linux 2.6 + kernel, Apache + MySQL + PHP installation and basic configuration process will be recorded & & apache installed as system services 2011-03-16

    Quote CentOS 5.2, Linux 2.6 + kernel, Apache + MySQL + PHP installation and basic configuration record & & the apache installed as system services collections environment: This article in the Linux operating system is CentOS 5.2, Linux 2.6 + kerne

  • MyEclipse runtime error solution: The Linux WYSIWYG design panel is still under development 2009-05-17

    In the Eclipse / MyEclipse visual editing window opens, such as the JSP editing tools, you may pop up a warning window, the information is as follows: The Linux WYSIWYG design panel is still under development. To access an experimental version of thi

iOS 开发

Android 开发

Python 开发



PHP 开发

Ruby 开发






Javascript 开发

.NET 开发



Copyright (C) codeweblog.com, All Rights Reserved.

CodeWeblog.com 版权所有 黔ICP备15002463号-1

processed in 0.352 (s). 12 q(s)