Affichage des articles dont le libellé est linux. Afficher tous les articles
Affichage des articles dont le libellé est linux. Afficher tous les articles

mercredi 19 décembre 2012

Exclude files or directories from commands

An easy way to remove elements from command line : 

root:/# rm !(*.c|*.h)  => remove every files except *.c or *.h) 

another syntax : 

root:/# rm !(*.@(c|h))  => same thing ...

Can be used with grep, for directories exlusion. :

root:/#  grep P770_P7_1_A30 !(www|logs)/* => grep P770_P7_1_A30 from every underlying directories, except www and logs

mercredi 4 août 2010

ksh tip

simple way to get input caracter in the output text :

cat $i | bla bla | awk '{ var " " bla bla bla $1" "$2 bla bla }' var=$i >> out

mercredi 12 août 2009

quicky : create / extend a fs on a redhat 5 with lvm

list volume groups :
#vgs
or
#vgdisplay

create a lv :
#lvcreate -L 10G -n lvname vgname

format the lv to ext3:
#mkfs.ext3 /dev/vgname/lvname

to create the fs, need to add the correct entry in /etc/fstab

list the lvm /fs :

#lvdisplay

extend lv :
#lvextend -L +54 /dev/vg01/lvol10 /dev/sdk3

extend fs :
#resize2fs /dev/vg01/lvol10