Linux classic practical use tips 33

Source: Internet
Author: User
Tags mx record
1: Host fun: host can be used to query domain names, but it can get more information. Host-t mx can query the MX record of and the Host Name of the mail processing host. Host-l returns all domain names registered under Host-A displays all domain names of the host.

2: Find the file required by the command. Maybe you want to find out what other related files and commands a command uses? Try LDD. For example, LDD traceroute, the returned result will be libc. so.6,

3: timed! Timed! Do you want regular processing? You certainly want to make it easier! Crontab can wait for your instructions. Enter crontab-E in the command line to enter the text editor, and then enter 0 5 *** wget-T3-I/home/Tom/URLs-n. In this way, the wget command will be run at every morning. The first five parameters are time parameters: the number of hours, days, months, and weeks. You can run the command line here at 5 every Saturday and Sunday. You need man 5 crontab for more detailed explanation. To put it simply, wget is a small program for retrieving web pages. Current time displayed on the top of the console: AT/etc/bashrc or ~ /. Add the environment variable prompt_command to bashrc. Export prompt_command = 'echo-ne "33733 [2; 999r33 [1; 1h33 [00; 44m33 [K" 'date' "33 [00m338 "'

4: Use up to 23 virtual terminals (VT). Suppose you have 6 files, which are added in the format of/etc/inittab.
8: 234: respawn:/sbin/Getty 38400 tty8
24: 234: respawn:/sbin/Getty 38400 tty24
Skip vt7 because X uses this terminal. Then telinit Q is used to reload the configuration file. Use the left Alt + FN to switch between 1-6 and 8-12 parts, and the right Alt + FN key to switch between 13-24 parts.

5: console switch: Left alt-direction key, and switch console cyclically. The effect is the same as that of ALT + FN.

6: simple dos to Unix: if there is a nasty Ctrl-m at the end of each line in your text file, use this command to quickly solve the problem SED's/^ m // 'filename> newfilename

7: quickly create an MP3 player list: Find/mnt/CDROM-name *. MP3-print> list. in this way, all MP3 files in CDROM will be created with the name list file. Then you can use xmms or x11amp to play the video.

8: important information in/proc
CAT/proc/cpuinfo-CPU (I. e. Vendor, MHz, flags like MMX)
CAT/proc/ioports-device IO port
CAT/proc/meminfo-memory information (I. e. mem used, free, swap size)
CAT/proc/Partitions-all partitions of all devices
CAT/proc/PCI-PCI device information
CAT/proc/SWAPs-information about all swap partitions
CAT/proc/version-version number of Linux

9: Real console interface: To be honest, I don't like KDE or GNOME very much. After all, I 've been influenced by windows for so long. But in the console, it is actually the real cool interface. Using svgatextmode can bring your command line interface to 132x60 (Standard: 80x25 ). I used 486X43 on trident9440. The dense character is like a movie from Hollywood a few years ago (now windows is used in a movie. The configuration file is in/etc/textconfig. However, if your XWindow cannot be normally displayed, it is estimated that this will not be used (after all, it was a few years ago ).

10: let your hard disk fly: 32 bit I/O and DMA can also be used in Linux. Use/sbin/hdparm-C1/dev/hda (HDB, HDC ..) enable the 32bit transmission mode and run the command/sbin/hdparm-D1/dev/hda (HDB, HDC ...) enable DMA. Finally, use/sbin/hdparm-K1/dev/hda to keep the above settings after reset. In this way, the hard disk read/write speed should be increased by more than doubled.

11: fine-tune your ext2: The command tune2fs in Linux can set the maximum number of Mount times (because Linux has reached a certain number of Mount times in the case of mounted clean, it is inconvenient for me to force e2fsck to switch on or off the server every day. For other purposes of the tune2fs command, see man.

12: Disable the display of Blink tags in Netscape :~ /. Modify Netscape * blinkingenabled in xdefaults: false and then run xrdb-load ~ /. Xdefaults

13: Change the xterm font size at any time: shift plus + /-

14: ext2 file attributes: lsattr lists attributes. chattr can change attributes. For example, if chattr + A filename is used, the system will not modify its last access time attribute; If chattr + I is used, RM will be avoided.

15: sis6326 video card configuration: Add: dacspeed 110 option "no_bitblt" option "sw_cursor" to Device"

16: Use strings to separate strings from binary files

17: You probably get used to using top to observe the system usage, so you can use vmstat 1 to check the CPU idleness (display the last item of the result ).

18: Use the watch command to repeatedly execute a specific command, such as "watch LS-L/tmp/blah". You will always observe the file size change.

19: Use pppstats to obtain the data of the PPP connection.

20: display the NFS: showmount-e hostname of the remote machine

21: Using autofs saves you the trouble of Mount and umount each time, and redhat6.0 carries The AutoFS rpm. After installation, you can enjoy the convenience of automatically loading the file system. In the/MISC directory, create a CD directory. If you use its built-in auto. Misc and auto. Master, you can implement the automatic loading function immediately.

22: it can be used in bash shell! Repeat the commands that have been input several times to save the trouble of rolling up. You can use CTL + R to interactively retrieve previously used command lines.

23: use CD-switch between the last two CD/directory/operations. For example, CD/home/Foo followed by CD/home/Maison followed by CD-and/home/Foo followed by CD-and/home/maison.

Keyboard shortcut in 24: Bash: The ESCAPE-B is a word forward, and Ctrl-K removes all characters from the cursor to the end of the line.

25: Use grep in the ps command. For example, PS auxw | grep GPM lists all processes with GPM characters.

26: execute multiple commands simultaneously on the same command line: Separate them with semicolons. For example, compile a source file: type./configure; Make; make install. Then you can take a walk (don't spend too much time in front of your computer, and there are many wonderful things in your life .)

27: output the running result to a file, such as LS-L> Foo. File.

28: use the top command to monitor the system status, memory usage, boot time, Process status, and usage of each user. Use the S command to change the refresh time. For example,. 5 will update it every half second.

29: unzip multiple files at the same time. Unzip * is incorrect, but unzip "*".

30: Create a symbolic link, which is probably the most useful feature. ln-s real-file symbolic-file, whether it is a device, a document or a script program.

31: Change the display unit. For example, Du-HM will output the result in the unit of M, and the same Du-HK will be output in the unit of K.

32: automatic logoff, in ~ /. Bashrc adds this sentence: tmout = 300 will be logoff in 5 minutes, but if the less program runs, it will not start.

33: when using less or more, directly start the editor: press the V Key in less to immediately start VI or other editor specified in environment variables, but more can only use VI.

Contact Us

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: 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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.