Linux Tips 33

Source: Internet
Author: User
Tags current time execution file system memory usage

1:host Fun: The host can be used to query the domain name, but it can get more information. The Host-t MX linux.com can query for Linux.com MX records and the name of the host that handles mail. Host-l Linux.com will return all the domain names registered under Linux.com. Host-a linux.com Displays all domain name information for this host.

2: Find the document required by the command, maybe you want to figure out a command what other relevant documents and commands does it use? Try LDD on it. such as LDd traceroute, the return result would be libc.so.6,lid-linux.so.2

3: Timed! Timing! Do you want to handle it regularly? You definitely want to make it easier for you! Crontab may await your instructions. Command Line input: CRONTAB-E This enters the text editor and then enters 0 5 * * * wget-t3-i/home/tom/urls-n. This will run this wget command every 5 o'clock in the morning. The first five are time parameters: Days of time-sharing. You can 0 5 * * 6,0 command line here, which runs every Saturday and Sunday 5am. You need man 5 crontab to get a more detailed explanation. Casually speaking, wget is a Web page of a small program. The top of the console displays the current time: Add environment variable Prompt_command to/ETC/BASHRC or ~/.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), assuming you now have 6, modeled after the/etc/inittab kind of file, join

8:234:respawn:/sbin/getty 38400 Tty8

24:234:respawn:/sbin/getty 38400 tty24

To skip VT7, because X uses this terminal. Then Telinit Q to reload the configuration file. Use the left ALT+FN to switch between 1-6 and 8-12, using the right ALT+FN key to switch between 13-24.

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

6: Simple dos to UNIX: if you have annoying ctrl-m at the end of every line in your text file, use this command to quickly resolve the problem sed s/^m//filename > NewFileName

7: Quickly set up MP3 playlist: find/mnt/cdrom-name *.mp3-print >> cd1.play.list. This will create a file named cdrom for all MP3 files in the cd1.play.list. Then use XMMS or X11amp to play it.

Important information in the 8:/proc

CAT/PROC/CPUINFO-CPU (i.e vendor, Mhz, flags like MMX)

Cat/proc/interrupts-Interrupt

Cat/proc/ioports-Device IO ports

Cat/proc/meminfo-memory information (i.e. Mem used, free, swap size)

Cat/proc/partitions-All partitions for all devices

Information for CAT/PROC/PCI-PCI devices

Cat/proc/swaps-Information for all swap partitions

Version number of Cat/proc/version-linux

9: The real Console interface: To be honest, I don't really like KDE or GNOME, it's been a long time since Windows has nurtured me. But in the console is actually the real cool interface. Use Svgatextmode to get your command line interface up to 132x60 (Standard 80x25). My 486 (Trident9440) uses 132x43, which is so dense that the characters are as mysterious as those of Hollywood years ago (now even in the movies). The configuration file is in the/etc/textconfig, but if your xwindow doesn't display properly, it's not going to work (after all, it's been years ago).

10: Let your hard drive fly: Linux can also use 32Bit I/O and DMA. Use/sbin/hdparm-c1/dev/hda (Hdb,hdc ...) Turn on 32Bit transfer mode and use the command/sbin/hdparm-d1/dev/hda (HDB,HDC ...) to turn on DMA. Finally use/sbin/hdparm-k1/dev/hda to make the hard drive after reset to maintain the above settings, so that the hard disk read and write speed should be increased by more than one times.

11: Fine-tune your ext2:linux command TUNE2FS can set the maximum mount times (because Linux in the mounted clean situation, to a certain number of Mount times, will be forced e2fsck for me such a daily switch machine is very inconvenient) , see man for other uses of the TUNE2FS command.

12: Prohibit flashing in Netscape (Blink) Tag: ~/. Run Xrdb-load ~/after modifying Netscape*blinkingenabled:false in Xdefaults. Xdefaults

13: Change the font size of xterm at any time: Shift + +

14:ext2 file properties: Lsattr List Properties, Chattr can change properties. If chattr +a filename, the system will not modify its last access Time property, Chattr +i can avoid being RM.

15:sis6326 video card configuration: Add in Device: Dacspeed option "no_bitblt" option "Sw_cursor"

16: Use strings to separate the string from the binary file

17: You are probably used to using top to observe system usage, so make a use of vmstat to see how idle the CPU is (the last item that displays the result).

18: Use the Watch command, repeated execution of specific commands, such as "Watch Ls-l/tmp/blah", will always observe the size of the file changes.

19: Use Pppstats to get PPP connection data.

20: Display the NFS:SHOWMOUNT-E hostname of the remote machine

21: Use AutoFS to save you from each mount and umount of the pain, and then RedHat6.0 with AutoFS rpm, as long as the installation will be able to enjoy the automatic loading file system convenience. In the/misc directory, create a CD directory, if you use its own auto.misc and Auto.master, you can immediately implement the automatic loading function.

22: In the bash shell, you can use! Repeat the commands you've entered several times, so you can save yourself the hassle of scrolling. Use Ctl+r to interactively retrieve the previously used command line.

23: Use CD-switch in the two cd/directory/operations. If first cd/home/foo followed by Cd/home/maison then the CD-will enter/home/foo and then play CD-will enter/home/maison.

Shortcut keys in 24:bash: Escape-b A word forward, ctrl-k deletes all characters from the cursor to the end of the line.

25: Use grep in PS command, example: PS Auxw | grep GPM Lists all processes that contain GPM characters.

26: Simultaneous execution of multiple commands on the same command line: separated by semicolons. such as compiling a source file: type./configure; make; Make install. Then you can go for a walk (don't spend too much time in front of the computer, there are many good things in life.) )

27: Output The results of the operation to a file, such as Ls-l > Foo.file.

28: Use the top command to monitor system status, memory usage, boot time, process status, use of each user, and so on. Use the S command to change the time it refreshes: such as. 5 will make it update every half second.

29: At the same time unzip multiple files, unzip * not correct, but unzip "*".

30: Building Symbolic links, which is probably the most useful feature, Ln-s real-file Symbolic-file, whether it's a device, a document, or a scripting program.

31: Change the display of units, such as Du-hm will be in m units output results, the same DU-HK is in the unit of K output.

32: Automatic logoff, add a word in ~/.BASHRC: tmout=300 will logoff after 5 minutes, but if less this kind of program runs will not start.

33: In the use of less or more, the direct start editor: In the less into the V key, will immediately start VI or other you in the environment variables specified in the editor, 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: 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

  • 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.