La'hev

Heverovy poznatky a poznámky

Uživatelské nástroje

Nástroje pro tento web


Toto je starší verze dokumentu!


Příkazová řádka v linuxu

Tipy

The variable CDPATH defines the search path for the directory containing directories:

export CDPATH=/var/www:/nas10

Now, instead of typing cd /var/www/html/ I can simply type the following to cd into /var/www/html path:

cd html

Vypsat největšíy soubory

du -a Stažené/ | sort -n -r | head -n 10

Přemountovat read only na read write

 mount -o remount,rw /ftpusers/tmp

Dealing with software RAID on a Linux: To find the current status of a Linux software raid type the following command:

mdadm --detail /dev/md0

cat /proc/mdstat
watch cat /proc/mdstat

## remove disk from an array md0 ##
mdadm --manage /dev/md0 --fail /dev/sdb1
mdadm --manage /dev/md0 --remove /dev/sdb1
 
# Do the same steps again for rest of /dev/sdbX ##
# Power down if not hot-swappable hard disk: ##
shutdown -h now
 
## copy partition table from /dev/sda to newly replaced /dev/sdb ##
sfdisk -d /dev/sda | sfdisk /dev/sdb
fdisk -l
 
## Add it ##
mdadm --manage /dev/md0 --add /dev/sdb1
# do the same steps again for rest of /dev/sdbX ##
 
# Now md0 will sync again. See it on screen ## 
watch cat /proc/mdstat
linux/prikazova_radka.1425501628.txt.gz · Poslední úprava: 2015/03/04 21:40 autor: Hever