Linux Tips
Modify the kernel to make Linux run faster:
1 2 3 | # cd /usr/src/linux-2.4 # make mrproper # make menuconfig |
This step will display a dialog,and I exclude some items which will never be used, for example, Fiber channel,isdr,and pcmcia,(Type “N”),and then save the new configuration,issue the following command:
1 2 3 4 5 | # make dep (it will take about 5 minutes) # make clean (5 seconds) # make bzImage (10 minutes) # make modules (it's long and will take about 30 minutes) # make modules_install |
Note: it is “modules_install” which have no backspace between “modules” and “_install”. and if issue the “make modules -install”, the process will failed with error. The final step is issueing the “reboot”. I’ve tried all the above steps, and my Linux runs faster after rebooting.
nroff: emulate nroff command with groff.
1 | # nroff -man man/libnet.3 | less |
Issue the commands as other user account:
1 | # su - username -c "ls" |
For example, let root issues “ls” :
1 | # su - root -c "ls" |
Uncompress the “.bz” file:
1 | # tar -jvxf xxx.bz |
If the file “/etc/inittab” was modified, issue the following command to make the configuration activity.
1 | # init q |
Q or q, tell init to re-examine the /etc/inittab fill.
S or s, tell init to switch to single user mode.
Issue some continuous commands, and it will break as soon as error happens.
1 | # command1 && command2 && command3 |
Uncompress the file included in rpm:
1 | # cat xxx.rpm | rpm2cpio | pax -r |
How to mount harddisk and directory owned by local Windows system or Remote windows system?
1 | # mount -t smbfs -o username=x, password=x, //share_path /mnt/c |
Ethereal — capture packets.
Create and use .iso file:
1 2 | # mkisofs -J -r -o xxx.iso /test # mount -o loop xxx.iso /mnt/cdrom |
Uncompress xxx.bz file:
1 | # tar -I xxx.bz or # bunzip2 xxx.bz |
Check the file’s rpm name:
1 | # rpm -qf /usr/bin/ls |
List description information:
1 | # rpm - qpi |
List file information:
1 | # rpm - qpl |
Configure the Memory limitation in Grub:
1 | grub> kernel /boot/vmlinuz-2 .4.19 20 boot= /dev/hda2 mem=120MB |
Type Chinese output:
1 | # ls --show-control-chars |
Make a Linux boot disk:
1 | # mkbootdisk --device /dev/fd0 2.4.20 |
Where 2.4.20 is directory in /lib/modules
Modify the ethernet device’s MAC address:
1 2 3 | # ifconfig eth0 down # ifconfig eth0 hw ether 00:AA:BB:CC:DD # ifconfig eth0 up |
A very important command which is used to check ethernet card’s statue:
1 | # mii-tool -v |
mii-tool -view, manipulate media-independent interface status.This utility checks or sets the status of a network interface Media Independent Interface(MII) .
-w watch monitor for link status changes
1 2 | # du ./ --max-depth=1 # du -sm /directory |
List the existed users account in the Linux:
1 | # cat -fl -d: /etc/passwd |
Find the MAC address of local ethernet card:
1 2 | # arp # /sbin/arp |