Danh mục

7 More Red Hat® Linux™ Tips and Tricks

Số trang: 6      Loại file: pdf      Dung lượng: 878.65 KB      Lượt xem: 12      Lượt tải: 0    
tailieu_vip

Hỗ trợ phí lưu trữ khi tải xuống: 1,000 VND Tải xuống file đầy đủ (6 trang) 0
Xem trước 2 trang đầu tiên của tài liệu này:

Thông tin tài liệu:

Are you looking for a quick and simple reference guide to help you navigate Red Hat® LinuxTM systems? Look no further. Global Knowledge and Red Hat have assembled a second set of Tips and Tricks written by Red Hat Certified Engineers® (RHCEs) to give you an edge on managing these systems:1. If a file has a link count greater than 1, is there a simpler way to find out what other file names arehard-linked to it?2. Which interface is eth0?3. Quick-and-dirty automounts4. How can I make dd give me a progress report?5. Tar vs. Star—The battle of xattrs6. New default...
Nội dung trích xuất từ tài liệu:
7 More Red Hat® Linux™ Tips and Tricks Written and Provided byExpert Reference Series of White Papers ® 7 More Red HatLinux™ Tips and Tricks1-800-COURSES www.globalknowledge.com7 More Red Hat® Linux Tips and TMTricksIntroductionAre you looking for a quick and simple reference guide to help you navigate Red Hat® LinuxTM systems?Look no further. Global Knowledge and Red Hat have assembled a second set of Tips and Tricks written by RedHat Certified Engineers® (RHCEs) to give you an edge on managing these systems: 1. If a file has a link count greater than 1, is there a simpler way to find out what other file names are hard-linked to it? 2. Which interface is eth0? 3. Quick-and-dirty automounts 4. How can I make dd give me a progress report? 5. Tar vs. Star—The battle of xattrs 6. New default mount options in Red Hat® Enterprise Linux® 5 7. How do I enable logging so that I can see all the queries on my DNS server?1. If a file has a link count greater than 1, is there a simplerway to find out what other file names are hard-linked to it?by Steve Bonneville, Red Hat Certified Engineer®The obvious answer is that you can’t by just looking at the inode; the inode only contains a link count, not alist of the file names that are hard-linked to the inode. So you need to walk through the filesystem looking forfiles that have the same inode number as the file of interest.The not so obvious solution is that the find command can do this searching for you, once you’ve determinedthe inode number for the file with ls -i. For example, find /home -mount -inum 78442works nicely to find all file names using inode 78442 on the filesystem mounted on /home. The-mount option is necessary to avoid accidentally searching other filesystems mounted on subdirectories ofthe /home filesystem, since inode numbers are only unique within a given filesystem. It is also very importantto start the find at the mount point for the filesystem being searched, or some files might be missed by find.Copyright ©2007 Global Knowledge Training LLC. All rights reserved. Page 22.Which interface is eth0?by Paul Morgan, Red Hat Certified Engineer®If you’re not sure which physical interface is eth0 and which is eth1 (or eth2), run: ethtool -p eth0 5This blinks the LED on the interface for five seconds—without interrupting network traffic.3. Quick-and-dirty automountsby Joshua Hoffman, Red Hat Certified Engineer®1. Enable the /net map in /etc/auto.master.2. Create a new directory to hold your network mounts: mkdir /network3. Create links for the mounts you want: cd /network ln -s /net/server1/var/ftp/pub/Server Server4. Now you can just use the links: cd /network/Server5. Best of all, this always works: ls /network6. This trick even works for NIS user homedirs: cd /home ln -s /net/server1/home/guests guests4. How can I make dd give me a progress report?by Andrew C. Dingman, Red Hat Certified Engineer®If you’ve been working with Linux very long, you’ve probably encountered dd, the deceptively simple utilityfor copying a stream of data from here to there. You may have used it to zero a disk before letting it leave thebuilding, to benchmark IO hardware by writing a certain number of bytes, to put a disk image on a floppy orUSB drive, or even to back up an entire disk.Like many commands, dd doesn’t generate much output as long as things are going well. This is great forscripting, but can be frustrating when you run it interactively. On large transfers, such as wiping or imaging adisk, it can be a total mystery how much longer you have to wait.Also like many other commands, dd has some tricks up its sleeve that it will show off if it gets the right sig-nal. In particular, dd will respond to the USR1 signal with a status report on TDERR. It is the same data you’dnormally get at the very end of the transfer and will look something like this:Copyright ©2007 Global Knowledge Training LLC. All rights reserved. Page 3 $ dd if=/dev/zero of=/tmp/demo bs=1M count=1536 33+0 records in 33+0 records out 34603008 bytes (35 MB) copied, 0.355191 seconds, 97.4 MB/sSo how do we send this signal? Using your choice of kill, killall, or pkill. All of these will, bydefault, send a TERM signal (15), which is not what we want at all. Instead, use the following to send theUSR1 signal to all processes you own named dd. $ pkill -USR1 ^dd$kill and killall support the -USR1 option in the same manner.If you want a periodic status report, you can extend the same idea with watch in another terminal. Sincewe’r ...

Tài liệu được xem nhiều: