Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are the classic and practical skills of using Linux?

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

This article mainly explains "what are the classic practical skills of Linux", interested friends may wish to take a look. The method introduced in this paper is simple, fast and practical. Let Xiaobian take you to learn "what are the classic practical skills of Linux"!

1: HOST fun: Host can be used to query domain names, however it can get more information. host -t mx linux.com can query MX records of Linux.com and the name of the Host handling Mail. Host -l linux.com returns all domain names registered under linux.com. host -a linux.com displays all domain names for this host. 2: Find the files required for the command, perhaps you want to find out what other related files and commands a command uses? Try LDD. If ldd traceroute, the result would be libc.so.6,lid-linux.so.2

3: Timing! Time! Do you want it timed? I bet you wish it was easier! Crontab is at your disposal. Enter crontab -e into the text editor and type 0 5 * * * wget -t3 -I/home/tom/URLs -N. This will run the wget command at 5 a.m. every morning. The first five are time parameters: time-sharing day, month, day of the week. You can 0 5 * * 6,0 command line here, which runs every Saturday and Sunday at 5am. You need a man 5 crontab to get a more detailed explanation. By the way, wget is a Mini programs that fetch web pages. The top of the console shows the current time: Add the 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/etc/inittab files, adding

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

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

VT7 is skipped because X uses this terminal. Then telinit q to reload the configuration file. Use left Alt+Fn to switch between 1-6 and 8-12 pieces, and right Alt+Fn to switch between 13-24 pieces.

5: Console Switch: Left Alt-arrow keys, cycle through console. The same as Alt+Fn.

6: Simple Dos to Unix: If your text file has the annoying Ctrl-M at the end of each line, use this command to quickly solve the problem sed s/^M//filename > newfilename

7: Quickly create an MP3 playlist: find /mnt/cdrom -name *.mp3 -print> cd1.play.list. This will create a file named cd1.play.list for all MP3 files in CDRom. Then use xmms or x11amp to play it.

8: Important information in/proc

cat /proc/cpuinfo - CPU (i.e. vendor, Mhz, flags like mmx)

cat /proc/interrupts -interrupts

cat /proc/iports-Device IO ports

cat /proc/meminfo -Memory information (i.e. mem used, free, swap size)

cat /proc/partitions -All partitions for all devices

cat /proc/pci - PCI device information

cat /proc/swaps -Information on all Swap partitions

cat /proc/version - Linux version number

9: Real Console interface: To be honest, I don't like either KDE or GNome, after all, Windows has been smoked for so long. But in the Console is actually the cool interface. Using SVGATextMode allows you to get your command line interface up to 132x60 (standard is 80x25). My 486 (Trident9440) uses 132x43, and the dense characters are just like Hollywood movies from a few years ago (now even movies are Windows), giving people a sense of mystery. The configuration file is in/etc/TextConfig, but if your XWindow doesn't work, it probably won't work (after all, it's a few years old).

10: Let Your Hard Drive Fly: 32Bit I/O and DMA are also available under Linux. Turn on 32Bit transfer mode with/sbin/hdparm -c1 /dev/hda (hdb,hdc…) and DMA with command/sbin/hdparm -d1 /dev/hda (hdb,hdc…). Finally, use/sbin/hdparm -k1 /dev/hda to keep the above settings after Reset, so that the hard disk read and write speed should be more than doubled.

11: fine-tune your Ext2: Linux command tune2fs can set the maximum number of Mount (because Linux will force e2fsck to be inconvenient for me to switch on and off every day after reaching a certain number of mount times in the mounted clean condition), tune2fs command for other purposes see man.

12: Disable Blink in Netscape Tag: ~/.Xdefaults Modify Netscape*blinkingEnabled: False and run xrdb -Load ~/.Xdefaults

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

14: File attributes of Ext2: lsattr lists attributes, chattr can change attributes. For example, chattr +A filename does not modify its last access time attribute;chattr +i can avoid being dropped by rm.

15: Configuration of SIS6326 graphics card: Add: DacSpeed 110 Option \"no_bitblt\" Option \"sw_cursor\" in Device

16: Strings can be used to separate strings from Binary files

17: You are probably used to using Top to observe system usage, so use Vmstat 1 to see how idle the CPU is (the last item showing the results).

18: Using the Watch command, executing a specific command repeatedly, such as\"watch ls -l /tmp/blah\", will always observe the file size change.

19: Use pppstats to get ppp connected data.

20: Show remote machine NFS: showmount -e hostname

21: Use autofs to avoid the pain of every mount and mount, and then RedHat6.0 with autofs rpm, as long as the installation is good, you can enjoy the convenience of automatic loading file system. In/misc directory, create a cd directory, if you use its own auto.misc and auto.master, you can immediately achieve the automatic loading function.

22: In Bash Shell, you can use! Repeat the command you entered a few times so you don't have to scroll up. Use ctl+R to interactively retrieve previously used command lines.

23: Use cd -toggles between the last two cd /directory/actions. If cd /home/foo followed by cd /home/maison then cd -will go to/home/foo then cd -will go to/home/maison

24: Shortcuts in Bash: ESCAPE-B will move forward one word, Ctrl-K will delete all characters from the cursor to the end of the line.

25: Use grep in PS command, e.g. ps auxw| grep gpm lists all processes that contain the gpm character.

26: Execute multiple commands simultaneously on the same command line: separated by semicolons. For example, compile 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 to a file, such as ls -l > foo.file.

28: Use the Top command to monitor system health, memory usage, boot time, process status, usage by each user, etc. Use the S command to change the refresh time: for example. 5 will cause it to update every half second.

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

30: Create symbolic links, probably the most useful feature, ln -s real-file symbolic-file, whether it's a device, document, or script.

31: Change the units displayed, such as du -hm will output the result in M units, and the same du -hk will output in K units.

32: Automatic Logoff, add the following sentence to ~/.bashrc: TMOUT=300 will logoff after 5 minutes, but if less such programs run, they will not start.

33: When using less or more, launch the editor directly: typing v in less will immediately launch vi or any other editor you specify in the environment variable, but more can only use vi.

At this point, I believe that everyone has a deeper understanding of "what are the classic practical skills of Linux", so you may wish to actually operate it! Here is the website, more related content can enter the relevant channels for inquiry, pay attention to us, continue to learn!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report