Article Title: 33 typical practical tips for Linux operating systems. 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.
1: HOST fun: Host can be used to query domain names, but it can get more information. Host-t mx linux.com can query the MX record of Linux.com and the Host Name of the Mail processing host. Host-l linux.com returns all domain names registered under linux.com. Host-a linux.com 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, lid-linux.so.2
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> cd1.play. list. in this way, all MP3 files in CDRom will be created with the name cd1.play. 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/interrupts-interrupt
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 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.