Commande grep bloc d'informations
Bonjour,
SVP je cherche une commande ou une option de recherche dans un fichier, par exemple:
le output de la commande lshw dans un fichier test.txt
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62
| *-storage
description: RAID bus controller
product: 82801 SATA RAID Controller
vendor: Intel Corporation
physical id: 1f.2
bus info: pci@0000:00:1f.2
logical name: scsi0
logical name: scsi1
logical name: scsi5
version: 02
width: 32 bits
clock: 66MHz
capabilities: storage msi pm bus_master cap_list emulated
configuration: driver=ahci latency=0 module=ahci
*-disk:0
description: ATA Disk
product: Hitachi HDT72502
vendor: Hitachi
physical id: 0
bus info: scsi@0:0.0.0
logical name: /dev/sda
version: V5DO
serial: XXXX
size: 232GiB (250GB)
capabilities: partitioned partitioned:dos
configuration: ansiversion=5 signature=88000000
*-volume:0
description: EXT3 volume
vendor: Linux
physical id: 1
bus info: scsi@0:0.0.0,1
logical name: /dev/sda1
logical name: /
version: 1.0
serial: XXXX
size: 13GiB
capacity: 13GiB
capabilities: primary bootable journaled extended_attributes large_files huge_files recover ext3 ext2 initialized
configuration: created=2008-09-21 12:24:55 filesystem=ext3 label=linux modified=2009-05-05 20:40:27 mount.fstype=ext3 mount.options=rw,errors=remount-ro,data=ordered mounted=2009-05-05 20:31:11 state=mounted
*-volume:1
description: Linux swap volume
physical id: 2
bus info: scsi@0:0.0.0,2
logical name: /dev/sda2
version: 1
size: 956MiB
capacity: 956MiB
capabilities: primary nofs swap initialized
configuration: filesystem=swap pagesize=4096
*-volume:2
description: EXT3 volume
vendor: Linux
physical id: 3
bus info: scsi@0:0.0.0,3
logical name: /dev/sda3
logical name: /home
version: 1.0
serial: XXXX
size: 217GiB
capacity: 217GiB
capabilities: primary journaled extended_attributes large_files huge_files recover ext3 ext2 initialized
configuration: created=2008-09-21 12:25: |
Ce que je veux c'est arriver a *-volume:0 ensuitre entrer dans le sous bloc pour arriver apres a Serial.
Merci.