awk '{printf "%5d MB %s\n", $3*$4/(1024*1024), $1}' < /proc/slabinfo | sort -n
2009-10-09
Print the /proc/slabinfo in M bytes.
2009-10-04
dumpe2fs and fsck -b for ext2/ext3 file system
If the default superblock of a ext2/ext3 file sytem is damaged. You may use dumpe2fs to view the location of backup superblock and then use fsck -b to repair the file sytem.
An example of dumpe2fs output: red is the backup superblock
+++++++++++++++++++++++++++++++++++++++++++++
c1:~ # dumpe2fs /dev/sda1
dumpe2fs 1.41.1 (01-Sep-2008)
Filesystem volume name:
Last mounted on:
Filesystem UUID: 2963e327-deeb-4265-a1e1-1a4e5c0f34dd
Filesystem magic number: 0xEF53
Filesystem revision #: 1 (dynamic)
Filesystem features: has_journal ext_attr resize_inode dir_index filetype needs_recovery sparse_super
Filesystem flags: signed_directory_hash
Default mount options: (none)
Filesystem state: clean
Errors behavior: Continue
Filesystem OS type: Linux
Inode count: 18072
Block count: 72260
Reserved block count: 3613
Free blocks: 50006
Free inodes: 18028
First block: 1
Block size: 1024
Fragment size: 1024
Reserved GDT blocks: 256
Blocks per group: 8192
Fragments per group: 8192
Inodes per group: 2008
Inode blocks per group: 251
Filesystem created: Mon Aug 31 23:12:55 2009
Last mount time: Sun Oct 4 16:39:06 2009
Last write time: Sun Oct 4 16:39:06 2009
Mount count: 30
Maximum mount count: -1
Last checked: Mon Aug 31 23:12:55 2009
Check interval: 0 ()
Reserved blocks uid: 0 (user root)
Reserved blocks gid: 0 (group root)
First inode: 11
Inode size: 128
Journal inode: 8
Default directory hash: half_md4
Directory Hash Seed: 08edb5d9-25d8-4092-8a2a-36de718d1aaa
Journal backup: inode blocks
Journal size: 4113k
Group 0: (Blocks 1-8192)
Primary superblock at 1, Group descriptors at 2-2
Reserved GDT blocks at 3-258
Block bitmap at 259 (+258), Inode bitmap at 260 (+259)
Inode table at 261-511 (+260)
3057 free blocks, 1982 free inodes, 2 directories
Free blocks: 526-2560, 2998-3584, 4869-5303
Free inodes: 27-2008
Group 1: (Blocks 8193-16384)
Backup superblock at 8193, Group descriptors at 8194-8194
Reserved GDT blocks at 8195-8450
Block bitmap at 8451 (+258), Inode bitmap at 8452 (+259)
Inode table at 8453-8703 (+260)
0 free blocks, 2008 free inodes, 0 directories
Free blocks:
Free inodes: 2009-4016
Group 2: (Blocks 16385-24576)
Block bitmap at 16385 (+0), Inode bitmap at 16386 (+1)
Inode table at 16387-16637 (+2)
5864 free blocks, 2008 free inodes, 0 directories
Free blocks: 16638-16640, 18716-24576
Free inodes: 4017-6024
Group 3: (Blocks 24577-32768)
Backup superblock at 24577, Group descriptors at 24578-24578
Reserved GDT blocks at 24579-24834
Block bitmap at 24835 (+258), Inode bitmap at 24836 (+259)
Inode table at 24837-25087 (+260)
7681 free blocks, 2008 free inodes, 0 directories
Free blocks: 25088-32768
Free inodes: 6025-8032
Group 4: (Blocks 32769-40960)
Block bitmap at 32769 (+0), Inode bitmap at 32770 (+1)
Inode table at 32771-33021 (+2)
3826 free blocks, 2008 free inodes, 0 directories
Free blocks: 37135-40960
Free inodes: 8033-10040
Group 5: (Blocks 40961-49152)
Backup superblock at 40961, Group descriptors at 40962-40962
Reserved GDT blocks at 40963-41218
Block bitmap at 41219 (+258), Inode bitmap at 41220 (+259)
Inode table at 41221-41471 (+260)
7681 free blocks, 2008 free inodes, 0 directories
Free blocks: 41472-49152
Free inodes: 10041-12048
Group 6: (Blocks 49153-57344)
Block bitmap at 49153 (+0), Inode bitmap at 49154 (+1)
Inode table at 49155-49405 (+2)
7746 free blocks, 1990 free inodes, 1 directories
Free blocks: 49407-51712, 51715-52736, 52924-53760, 53764-57344
Free inodes: 12067-14056
Group 7: (Blocks 57345-65536)
Backup superblock at 57345, Group descriptors at 57346-57346
Reserved GDT blocks at 57347-57602
Block bitmap at 57603 (+258), Inode bitmap at 57604 (+259)
Inode table at 57605-57855 (+260)
7681 free blocks, 2008 free inodes, 0 directories
Free blocks: 57856-65536
Free inodes: 14057-16064
Group 8: (Blocks 65537-72259)
Block bitmap at 65537 (+0), Inode bitmap at 65538 (+1)
Inode table at 65539-65789 (+2)
6470 free blocks, 2008 free inodes, 0 directories
Free blocks: 65790-72259
Free inodes: 16065-18072
c1:~ #
++++++++++++++++++++++++++++++++++++++++++++++++
then run:
e2fsck -f -b 8193 /dev/sda1
An example of dumpe2fs output: red is the backup superblock
+++++++++++++++++++++++++++++++++++++++++++++
c1:~ # dumpe2fs /dev/sda1
dumpe2fs 1.41.1 (01-Sep-2008)
Filesystem volume name:
Last mounted on:
Filesystem UUID: 2963e327-deeb-4265-a1e1-1a4e5c0f34dd
Filesystem magic number: 0xEF53
Filesystem revision #: 1 (dynamic)
Filesystem features: has_journal ext_attr resize_inode dir_index filetype needs_recovery sparse_super
Filesystem flags: signed_directory_hash
Default mount options: (none)
Filesystem state: clean
Errors behavior: Continue
Filesystem OS type: Linux
Inode count: 18072
Block count: 72260
Reserved block count: 3613
Free blocks: 50006
Free inodes: 18028
First block: 1
Block size: 1024
Fragment size: 1024
Reserved GDT blocks: 256
Blocks per group: 8192
Fragments per group: 8192
Inodes per group: 2008
Inode blocks per group: 251
Filesystem created: Mon Aug 31 23:12:55 2009
Last mount time: Sun Oct 4 16:39:06 2009
Last write time: Sun Oct 4 16:39:06 2009
Mount count: 30
Maximum mount count: -1
Last checked: Mon Aug 31 23:12:55 2009
Check interval: 0 (
Reserved blocks uid: 0 (user root)
Reserved blocks gid: 0 (group root)
First inode: 11
Inode size: 128
Journal inode: 8
Default directory hash: half_md4
Directory Hash Seed: 08edb5d9-25d8-4092-8a2a-36de718d1aaa
Journal backup: inode blocks
Journal size: 4113k
Group 0: (Blocks 1-8192)
Primary superblock at 1, Group descriptors at 2-2
Reserved GDT blocks at 3-258
Block bitmap at 259 (+258), Inode bitmap at 260 (+259)
Inode table at 261-511 (+260)
3057 free blocks, 1982 free inodes, 2 directories
Free blocks: 526-2560, 2998-3584, 4869-5303
Free inodes: 27-2008
Group 1: (Blocks 8193-16384)
Backup superblock at 8193, Group descriptors at 8194-8194
Reserved GDT blocks at 8195-8450
Block bitmap at 8451 (+258), Inode bitmap at 8452 (+259)
Inode table at 8453-8703 (+260)
0 free blocks, 2008 free inodes, 0 directories
Free blocks:
Free inodes: 2009-4016
Group 2: (Blocks 16385-24576)
Block bitmap at 16385 (+0), Inode bitmap at 16386 (+1)
Inode table at 16387-16637 (+2)
5864 free blocks, 2008 free inodes, 0 directories
Free blocks: 16638-16640, 18716-24576
Free inodes: 4017-6024
Group 3: (Blocks 24577-32768)
Backup superblock at 24577, Group descriptors at 24578-24578
Reserved GDT blocks at 24579-24834
Block bitmap at 24835 (+258), Inode bitmap at 24836 (+259)
Inode table at 24837-25087 (+260)
7681 free blocks, 2008 free inodes, 0 directories
Free blocks: 25088-32768
Free inodes: 6025-8032
Group 4: (Blocks 32769-40960)
Block bitmap at 32769 (+0), Inode bitmap at 32770 (+1)
Inode table at 32771-33021 (+2)
3826 free blocks, 2008 free inodes, 0 directories
Free blocks: 37135-40960
Free inodes: 8033-10040
Group 5: (Blocks 40961-49152)
Backup superblock at 40961, Group descriptors at 40962-40962
Reserved GDT blocks at 40963-41218
Block bitmap at 41219 (+258), Inode bitmap at 41220 (+259)
Inode table at 41221-41471 (+260)
7681 free blocks, 2008 free inodes, 0 directories
Free blocks: 41472-49152
Free inodes: 10041-12048
Group 6: (Blocks 49153-57344)
Block bitmap at 49153 (+0), Inode bitmap at 49154 (+1)
Inode table at 49155-49405 (+2)
7746 free blocks, 1990 free inodes, 1 directories
Free blocks: 49407-51712, 51715-52736, 52924-53760, 53764-57344
Free inodes: 12067-14056
Group 7: (Blocks 57345-65536)
Backup superblock at 57345, Group descriptors at 57346-57346
Reserved GDT blocks at 57347-57602
Block bitmap at 57603 (+258), Inode bitmap at 57604 (+259)
Inode table at 57605-57855 (+260)
7681 free blocks, 2008 free inodes, 0 directories
Free blocks: 57856-65536
Free inodes: 14057-16064
Group 8: (Blocks 65537-72259)
Block bitmap at 65537 (+0), Inode bitmap at 65538 (+1)
Inode table at 65539-65789 (+2)
6470 free blocks, 2008 free inodes, 0 directories
Free blocks: 65790-72259
Free inodes: 16065-18072
c1:~ #
++++++++++++++++++++++++++++++++++++++++++++++++
then run:
e2fsck -f -b 8193 /dev/sda1
2009-08-11
Find the files and socket opened by a process
#pfiles PID
Which will list all the files and sockets opened by this process.
If you have a port number and would like to know which process is using it, and you don't have a lsof installed, here is a short script to find it.
for i in `ps -ef -o pid | grep -v PID'`
do
pfiles $i | grep $PORTNUMBET && echo && echo "PID $i is using port number $PORTNUMBER." && echo && pfiles $i
done
#Basicly, this script run command pfiles command agains all running process and search for the process with the port opened.
Which will list all the files and sockets opened by this process.
If you have a port number and would like to know which process is using it, and you don't have a lsof installed, here is a short script to find it.
for i in `ps -ef -o pid | grep -v PID'`
do
pfiles $i | grep $PORTNUMBET && echo && echo "PID $i is using port number $PORTNUMBER." && echo && pfiles $i
done
#Basicly, this script run command pfiles command agains all running process and search for the process with the port opened.
2009-07-06
Disable a touchpad in Opensolaris
I installed an Opensolaris2009.06 in a Compaq laptop. One annoying thing is that both touchpad and external USB mouse work. When I type, it is unavoidable that the touchpad will be touched and move the pointer around. Here is a solution to disable the touchpad.
~$ modinfo | grep mouse
102 fffffffff79ed628 be8 116 1 mouse8042 (PS/2 Mouse)
103 fffffffff80f7000 2320 - 1 vuid3ps2 (mouse events to vuid events)
127 fffffffff813b000 2c68 - 1 usbms (USB mouse streams)
There is no PS/2 mouse installed for sure. So I remove the PS/2 mouse driver.
~$ pfexec modunload -i 102
If you want to reload this driver, here is the command,
~$ pfexec modload /kernel/drv/amd64/mouse8042
But it didn't bring back my touchpad.
( Actually, all these information is referred/copied from another guy's blog. Appreciate!
http://blogs.sun.com/lubos/entry/disabling_touchpad_in_opensolaris )
~$ modinfo | grep mouse
102 fffffffff79ed628 be8 116 1 mouse8042 (PS/2 Mouse)
103 fffffffff80f7000 2320 - 1 vuid3ps2 (mouse events to vuid events)
127 fffffffff813b000 2c68 - 1 usbms (USB mouse streams)
There is no PS/2 mouse installed for sure. So I remove the PS/2 mouse driver.
~$ pfexec modunload -i 102
If you want to reload this driver, here is the command,
~$ pfexec modload /kernel/drv/amd64/mouse8042
But it didn't bring back my touchpad.
( Actually, all these information is referred/copied from another guy's blog. Appreciate!
http://blogs.sun.com/lubos/entry/disabling_touchpad_in_opensolaris )
Chang Vista GUI from English to Chinese
Tried to convert the GUI of Windoes Vista Home Premium from English to Chinese. Directly downloading the MUI from Windows failed multi times. Then I googled and found this usaful tool to do this job perfectly.
http://www.froggie.sk/usage.html
Follow this usage page, you will convert the GUI lanaguage of Windoes Vista easily.
http://www.froggie.sk/usage.html
Follow this usage page, you will convert the GUI lanaguage of Windoes Vista easily.
2009-05-06
A tricky point of /etc/sudoers
There is a definition in /etc/sudoers, "Cmnd_Alias". I failed on a tricky format, and spend 3 hours to figure it out.
Cmnd_Alias TEST = vi /etc/passwd,
Simple, looks like nothing wrong. But this is a syntax error. "visudo" won't allow you to save it.
The correct format should be,
Cmnd_Alias TEST = /usr/bin/vi /etc/passwd
The key point here is /etc/sudoers requires a FULL PATH for any command and file name. It is not only applied to Cmnd_Alias definition, it applies to all commands show-up in /etc/sudoers.
P.S., remember to use "visudo" to edit /etc/sudoers, it helps a lot.
Cmnd_Alias TEST = vi /etc/passwd,
Simple, looks like nothing wrong. But this is a syntax error. "visudo" won't allow you to save it.
The correct format should be,
Cmnd_Alias TEST = /usr/bin/vi /etc/passwd
The key point here is /etc/sudoers requires a FULL PATH for any command and file name. It is not only applied to Cmnd_Alias definition, it applies to all commands show-up in /etc/sudoers.
P.S., remember to use "visudo" to edit /etc/sudoers, it helps a lot.
2009-03-27
Using Linux Mail command to send out "Display Name"
When sending out email through Linux mail command, the program will fetch the user information through options or configuration files. A typical scenario is the user's description in /etc/passwd ( or a central NIS server passwd file), will be include in the email header "From=user@domain.com (user description)". And in a outlook client, the "user description" will be display in "From" colum.
Here is the problem, sometimes, the user description in password file is not for a good summary for the user, it may contain some other inforamtion for the administrators. Then the user need change this field manually when sending out email.
Two options to do that,
mail -r "123@123.com (I am 123)" 456@456.com
or
env from="123@123.com (I am 123)" mail 456@456.com
Then the receiver will see a email from "I am 123" in Outlook.
Here is the problem, sometimes, the user description in password file is not for a good summary for the user, it may contain some other inforamtion for the administrators. Then the user need change this field manually when sending out email.
Two options to do that,
mail -r "123@123.com (I am 123)" 456@456.com
or
env from="123@123.com (I am 123)" mail 456@456.com
Then the receiver will see a email from "I am 123" in Outlook.
2009-03-04
Boot SUSE Linux on POWER
Booting SUSE Linux On IBM POWER
SUSE has automated necessary configuration step to LILO for PPC. Here is the information how it works.
The firmware of IBM POWER, which is named OPENFIRMWARE, will look for the boot device according to a bootlist. The bootlist could be changed from the Linux. OPENFIRMWARE could be configured either to look for a PREP partition of SCSI disks, or a bootable file on the 1st primary partition which could be formatted as FAT16. SUSE uses the 2nd way to do the booting.
Steps LILO performs,
Create the partition, and formatted to FAT16. The partition should be the 1st partition of the disk.
Create a yaboot.cnf according to /etc/lilo.conf.
Copy "yaboot", "yaboot.cnf", kernel image and initrd to this partion.
Modify bootlist of the FIRMWARE to look for file "yaboot" instead of the whole partition.
+++++++
+ sda1 + <--- The boot partion, FAT16.
+++++++
+ sda2 + <--- Other partition or partitions
+++++++
Below is an example of how the system is configured,
/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# fdisk -l /dev/sda
Disk /dev/sda: 214.7 GB, 214748364800 bytes
255 heads, 63 sectors/track, 26108 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sda1 * 1 4 32098+ 6 FAT16
/dev/sda2 5 19264 154705950 fd Linux raid autodetect
/dev/sda3 19265 20439 9438187+ fd Linux raid autodetect
#
# mount /dev/sda1 /mnt/sda1
# ls /mnt/sda1
initrd.001 initrd.002 ppc vmlinux.001 vmlinux.002 yaboot yaboot.cnf
#
# show_of_path.sh /dev/sda
/vdevice/v-scsi@3000001a/disk@8100000000000000
# show_of_path.sh /dev/sdb
/vdevice/v-scsi@3000002e/disk@8100000000000000
#
# bootlist -m normal -r
/vdevice/v-scsi@3000001a/disk@8100000000000000:1,yaboot
/vdevice/v-scsi@3000002e/disk@8100000000000000:1,yaboot
/vdevice/l-lan@3000000b:speed=auto,duplex=auto,000.000.000.000,,000.000.000.000,000.000.000.000,5,5,000.000.000.000,512
#
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
The manpage of "show_of_path.sh" and "bootlist" will tell more information about these two commands.
Because LILO for PPC will handle all these works, all an adminsitrator need do is to modify the /etc/lilo.conf to reflect the right boot partition and kernel name, and run /sbin/lilo to update the change to boot partition. The only exception is when you have multiple booting partition. There is an entry in /etc/lilo.conf, named "boot = xxxx", which will be used by LILO to decide which partition to update. Like the case above, there are two boot partition, sda1 and sdb1, so administrator should run lilo twice with boot=sda1 and boot=sdb1 seperately.
Reference:
1. http://www.ibm.com/developerworks/systems/library/es-conf-swraid/
2. Chapter 9 and 13 of http://www.linux.org/docs/ldp/howto/IBM7248-HOWTO/index.html
3. http://www.ibm.com/developerworks/systems/library/es-SW_RAID_LINUX.html
SUSE has automated necessary configuration step to LILO for PPC. Here is the information how it works.
The firmware of IBM POWER, which is named OPENFIRMWARE, will look for the boot device according to a bootlist. The bootlist could be changed from the Linux. OPENFIRMWARE could be configured either to look for a PREP partition of SCSI disks, or a bootable file on the 1st primary partition which could be formatted as FAT16. SUSE uses the 2nd way to do the booting.
Steps LILO performs,
Create the partition, and formatted to FAT16. The partition should be the 1st partition of the disk.
Create a yaboot.cnf according to /etc/lilo.conf.
Copy "yaboot", "yaboot.cnf", kernel image and initrd to this partion.
Modify bootlist of the FIRMWARE to look for file "yaboot" instead of the whole partition.
+++++++
+ sda1 + <--- The boot partion, FAT16.
+++++++
+ sda2 + <--- Other partition or partitions
+++++++
Below is an example of how the system is configured,
/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# fdisk -l /dev/sda
Disk /dev/sda: 214.7 GB, 214748364800 bytes
255 heads, 63 sectors/track, 26108 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sda1 * 1 4 32098+ 6 FAT16
/dev/sda2 5 19264 154705950 fd Linux raid autodetect
/dev/sda3 19265 20439 9438187+ fd Linux raid autodetect
#
# mount /dev/sda1 /mnt/sda1
# ls /mnt/sda1
initrd.001 initrd.002 ppc vmlinux.001 vmlinux.002 yaboot yaboot.cnf
#
# show_of_path.sh /dev/sda
/vdevice/v-scsi@3000001a/disk@8100000000000000
# show_of_path.sh /dev/sdb
/vdevice/v-scsi@3000002e/disk@8100000000000000
#
# bootlist -m normal -r
/vdevice/v-scsi@3000001a/disk@8100000000000000:1,yaboot
/vdevice/v-scsi@3000002e/disk@8100000000000000:1,yaboot
/vdevice/l-lan@3000000b:speed=auto,duplex=auto,000.000.000.000,,000.000.000.000,000.000.000.000,5,5,000.000.000.000,512
#
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
The manpage of "show_of_path.sh" and "bootlist" will tell more information about these two commands.
Because LILO for PPC will handle all these works, all an adminsitrator need do is to modify the /etc/lilo.conf to reflect the right boot partition and kernel name, and run /sbin/lilo to update the change to boot partition. The only exception is when you have multiple booting partition. There is an entry in /etc/lilo.conf, named "boot = xxxx", which will be used by LILO to decide which partition to update. Like the case above, there are two boot partition, sda1 and sdb1, so administrator should run lilo twice with boot=sda1 and boot=sdb1 seperately.
Reference:
1. http://www.ibm.com/developerworks/systems/library/es-conf-swraid/
2. Chapter 9 and 13 of http://www.linux.org/docs/ldp/howto/IBM7248-HOWTO/index.html
3. http://www.ibm.com/developerworks/systems/library/es-SW_RAID_LINUX.html
2009-03-02
UUID or label of ext2 file system in LINUX
To view a file system's UUID or Label,
>vol_id /dev/sda1
To change of an ext3 file system's UUID
>uuidgen
>tune2fs /dev/sda1 -U "new-uuid-number"
>vol_id /dev/sda1
To change of a ext3 file system's label
>tune2fs /dev/sda1 -L "new-label"
>vol_id /dev/sda1
To change of an ext3 file system's UUID
>uuidgen
>tune2fs /dev/sda1 -U "new-uuid-number"
>vol_id /dev/sda1
To change of a ext3 file system's label
>tune2fs /dev/sda1 -L "new-label"
2009-02-06
Exclude directories with find in Solaris and Linux
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Under current directory, there is a folder called .snapshot. When we run find command, we don't want to look into the .snapshot folder.
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
IN SOLARIS,
Command:
find . -type d -name '.snapshot' -prune -o -print
Explanation:
-type d -name '.snapshot' : matching directory named .snapshot
-prune : Does not examine any directories or files in the directory structure below the pattern
just matched
-o : or (expr1 -or expr1)
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
IN LINUX,
Command:
find . -path '\.\/\.snapshot' -prune -o -print
Explanation:
-path '\.\/\.snapshot' : matching directory named .snapshot
-prune : If -depth is not given, true; if the file is a directory, do not descend into it.
If -depth is given, false; no effect.
-o : or
Command:
find . -wholename '\.\/\.snapshot\/*' -prune -o -print
Explanation:
-wholename PATTERN : File name matches shell pattern PATTERN.
-prune : If -depth is not given, true; if the file is a directory, do not descend into it.
If -depth is given, false; no effect.
-o : or
Command: exclude ./.snapshot and ./root-audit
find . -path '\.\/\.snapshot' -prune -o -path '\./root-audit' -prune -o -print
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Under current directory, there is a folder called .snapshot. When we run find command, we don't want to look into the .snapshot folder.
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
IN SOLARIS,
Command:
find . -type d -name '.snapshot' -prune -o -print
Explanation:
-type d -name '.snapshot' : matching directory named .snapshot
-prune : Does not examine any directories or files in the directory structure below the pattern
just matched
-o : or (expr1 -or expr1)
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
IN LINUX,
Command:
find . -path '\.\/\.snapshot' -prune -o -print
Explanation:
-path '\.\/\.snapshot' : matching directory named .snapshot
-prune : If -depth is not given, true; if the file is a directory, do not descend into it.
If -depth is given, false; no effect.
-o : or
Command:
find . -wholename '\.\/\.snapshot\/*' -prune -o -print
Explanation:
-wholename PATTERN : File name matches shell pattern PATTERN.
-prune : If -depth is not given, true; if the file is a directory, do not descend into it.
If -depth is given, false; no effect.
-o : or
Command: exclude ./.snapshot and ./root-audit
find . -path '\.\/\.snapshot' -prune -o -path '\./root-audit' -prune -o -print
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2009-02-02
WHY IS THIS BLOG SPACE?
I have tried several Blog spaces before, the earliest was back to 2004. Not even one last long. Why am I starting this one again?
First, I am learning hard to be Linux/Storage System Administrator. I need write notes, summary. Having a public space to post, it likes a reminder to keep me moving. Don't be lazy!
Second, I am using Google Documents, and I would like to publish some of my technical notes into the public. There is a link from Google Doc to post documents to Blogger, it is easier.
Third, I used to write in Chinese, my native language. Now, I am living in a English speaking country, I need improve my English. Writing, is always good for improving.
Then why Athabasca,
Athabasca is a river in north of Canada, finally drains into Arctic Ocean after 1231km journey. Living in a north country, you will be thinking about snow, ice, glacier, north pole, northen light. While such a river connecting the white icy Arctic world and the Rochie Mountain, it represents my dream about heading into the end of green world, or staring of while world.
First, I am learning hard to be Linux/Storage System Administrator. I need write notes, summary. Having a public space to post, it likes a reminder to keep me moving. Don't be lazy!
Second, I am using Google Documents, and I would like to publish some of my technical notes into the public. There is a link from Google Doc to post documents to Blogger, it is easier.
Third, I used to write in Chinese, my native language. Now, I am living in a English speaking country, I need improve my English. Writing, is always good for improving.
Then why Athabasca,
Athabasca is a river in north of Canada, finally drains into Arctic Ocean after 1231km journey. Living in a north country, you will be thinking about snow, ice, glacier, north pole, northen light. While such a river connecting the white icy Arctic world and the Rochie Mountain, it represents my dream about heading into the end of green world, or staring of while world.
Subscribe to:
Posts (Atom)