Generic-cli

Från wiki.soltec.se
Version från den 25 augusti 2017 kl. 19.01 av Js146669 (Diskussion | bidrag) (Skapade sidan med ' == Disks/PV/VG/LV info == Display a more readable output of disks/vols/mountpoints on Linux # lsblk -i Physical Volumes # pvscan # pvdisplay Volume Groups # vgsca...')

(skillnad) ← Äldre version | Nuvarande version (skillnad) | Nyare version → (skillnad)
Hoppa till: navigering, sök

Disks/PV/VG/LV info

Display a more readable output of disks/vols/mountpoints on Linux

  # lsblk -i

Physical Volumes

  # pvscan
  # pvdisplay

Volume Groups

  # vgscan
  # vgdisplay
  # vgchange
  # vgrename
  # vgs

Logical Volumes

  # lvscan
  # lgscan
  # lvdisplay
  # lvchange
  # lvs
  # lvresize
  # lvextend
  # lvreduce
  # lvrename

RPM

Find out what pkg a file belongs to

  # rpm -qf <path-to-file/cmd>

Find out if a file was installed as part of a pkg

  # rpm -ql /usr/liblibXp.so.6

Display system-wide config files for a cmd

  # rpm -qcf /bin/bash

Check contents of RPM

  # rpm -qlp RPMTOPDIR/RPMS/x86_64/<name-of-pkg>.rpm

To view different architecture version of a pkg

 # rpm -q --queryformat "%{name}.%{arch}\n" pdksh-5.2.14-36.el5

GREP

grep for soltec in start of line

  # grep ^"soltec"

grep for soltec at end of line

  # grep "soltec"$

YUM

to install all pkgs in listed in file

  # yum install $(< test.txt) 
  # yum -y install $(cat list)

Display history

  # yum history
  # yum history info
  # yum history list

VI

 dG	delete from line to end of file
 d1G	delete to top including current line
 dgg	delete from line to start of file
 G   goto last line in file
 1G	to to first line in file
 0	goto start of line
 $	goto end of line
 :set number	display line numbers