Stoppt die Vorratsdatenspeicherung! Jetzt klicken &handeln! Willst du auch an der Aktion teilnehmen? Hier findest du alle relevanten Infos
und Materialien:
Shell commands

a b c d e f g h i j k l m n o p q r s t u v w x y z


A

B


badblocks

C

chroot

D


dd

dep

dispatch-conf

E


ebuild

eix

emaint

emerge

esearch

equery

eselect

esync

etc-update

euse

euses

F

find

for

G

gcc upgrading

genlop

glsa-check

grep

grub

H

hdparm

host

I

J

K

compiling a kernel

L

lilo

M

mencoder

N

nc

O

P

profuse

portageq

python-updater

Q

qlist

quickpkg

R

rdate

renice

revdep-rebuild

rc-status

rc-update

S

smartctl

stage4 backup

strace

synergy

sysctl

T

U

ufed

ulimit

V

W

watch

X

Y

Y

*

A

B


badblocks
badblocks /dev/<HDD>
badblocks -w -t random -c 1024 -s /dev/<HDD>
# see:http://en.gentoo-wiki.com/wiki/Secure_deletion

<back>

C


Entering a Gentoo's chroot
mount  /dev/<partition1@HDD>  /mnt/gentoo
(mount  /dev/<partition2@HDD>  /mnt/gentoo/boot)
mount  -t  proc  none  /mnt/gentoo/proc
mount  -o  bind  /dev  /mnt/gentoo/dev
chroot  /mnt/<dir>  /bin/bash
grep  -v  rootfs  /proc/mounts  >  /etc/mtab
env-update
source  /etc/profile
PS1="\[\033[01;31m\](gentoo@chroot)\[\033[01;34m\] \W $\n>\[\033[00m\]"
<back>

D


dd
dd if=/dev/<HDD> of=/dev/null bs=1m
dd if=/dev/<HDD> ibs=1m | buffer -S 1m -p 75 | dd of=/dev/null obs=1m
dd if=/dev/mem bs=1k skip=768 count=256 2>/dev/null | strings -n 8
dd if=<image.img< of=/dev/<HDD> bs=1M
dd if=/dev/<cdrom/dvd> of=cd_image
nc -l -p 9000 | dd of=/dev/<HDD>
dd if=/dev/<HDD> | nc <ip> 9000

<back>

dep
dep ...
# an inappropriate Portage engine
# udept is masked by package.mask - 2009/04/06
# dead upstream and has issues with newer portages

<back>

dispatch-conf
dispatch-conf
# update configuration files
# see:http://en.gentoo-wiki.com/wiki/Dispatch-conf
# alternative choice is etc-update

<back>

E


ebuild
ebuild <foobar>.ebuild digest
# this is now equivalent to the manifest command
ebuild <foobar>.ebuild manifest
# to repair the file size verification issue of the updated ebuild

<back>

eix
update-eix
eix --installed-from-overlay <overlay>
eix -C -I <foobar> | grep "\[I\]" | awk '{print $2}' |xargs emerge -pC

<back>

emaint
emaint --check world

<back>

emerge
emerge --sync && emerge -avuND world
emerge --sync && emerge -avuND world --keep-going
emerge '=<foobar>-1.2.3-r4'
emerge '=<foobar>-1.2.3*'
emerge <foobar>:1.2
emerge -av --nodeps <foobar>
emerge --resume --skipfirst --keep-going -av
emerge --config =<foobar>.1.2.3

<back>

esearch
eupdatedb
esearch <foobar>
esearch --searchdesc <foobar>
esearch --fullname, -F
esearch --instonly, -I
esearch --compact, -c
esearch --verbose, -v
esearch --ebuild, -e

<back>

equery
equery files xterm
equery list bash*
equery size openoffice-bin
equery check <pkg>
equery hasuse <use-flag>
equery which <pkg>
equery depends qt

<back>

eselect
eselect opengl set nvidia
# see:http://en.gentoo-wiki.com/wiki/Nvidia
# see:http://www.gentoo.org/doc/en/nvidia-guide.xml
eselect opengl set ati
# see:http://gentoo-wiki.stefreak.de/de.gentoo-wiki.com/ATI-Treiber.html
eselect opengl set xorg-x11
# see:http://gentoo-wiki.stefreak.de/de.gentoo-wiki.com/XGL.html
eselect oodict set myspell-de
# see:http://de.gentoo-wiki.com/wiki/Deutsche_Lokalisierung
eselect kernel list
eselect set kernel 4
# see:http://de.gentoo-wiki.com/wiki/Kernel_manuell_kompilieren
eselect bashcomp enable genkernel
eselect news list
eselect news read <item>

<back>

esync
esync [ options ]
# calls 'emerge --sync' and 'eupdatedb' and shows updates
<back>

etc-update
etc-update
# update configuration files
# alternative choice is dispatch-conf

<back>

F


find
find /usr -type f | xargs grep "<foobar>"
find -type f -name '*.mp3' -exec xmms -e "{}" \;

<back>

for
TARGETDIR="$HOME" && UNMASK="gnome-extra" && MASK1="~amd64" && MASK2="* *"
for i in `ls -d /usr/portage/${UNMASK}/*`;do if [ ! `echo ${i}|cut -d "/" -f 5` = "metadata.xml" ];then echo "${UNMASK}/`echo ${i}|cut -d "/" -f 5` ${MASK1} ${MASK2}"; fi>> ${TARGETDIR}/${UNMASK};done

for i in `ls *.m2t`; do mencoder -ovc lavc -ffourcc DIVX -xvidencopts fixed_quant=1 -vf crop=0:0,scale=720:420 -zoom -lameopts mode=3:cbr:br=64 -oac mp3lame -o $"`echo $i|sed s/.m2t/-720x420.avi/`" $i;done;

<back>

G


grep
grep -ril "<foobar>" /path

<back>

gcc upgrading
emerge -uav gcc
fix_libtool_files.sh <old-gcc-version>
emerge --oneshot -av libtool
emerge -eav system
emerge -eav world
# see:http://www.gentoo.org/doc/en/gcc-upgrading.xml

<back>


genlop
genlop -t <foobar>
genlop -c
watch genlop -cn

<back>


glsa-check
glsa-check -l
glsa-check -t all
glsa-check -p $(glsa-check -t all)
glsa-check -f $(glsa-check -t all)
# see:http://www.gentoo.de/doc/de/security/security-handbook.xml?part=1&chap=14

<back>

H


host
host -t txt porttest.dns-oarc.net
host -t mx <server>
<back>

I

J

K


compiling a kernel
make mrproper
zcat /proc/config.gz > .config
make oldconfig
make menuconfig
make && make modules_install
make install
module-rebuild populate
module-rebuild rebuild
# remember to grub/lilo
# see:http://de.gentoo-wiki.com/wiki/Kernel_manuell_kompilieren

<back>

L

M


mencoder
mencoder -ovc lavc -ffourcc DIVX -xvidencopts fixed_quant=1 -vf crop=0:0,scale=720:576 -zoom -lameopts mode=3:cbr:br=64 -oac mp3lame -o <target>-720x576.avi <source>m2t

for i in `ls *.m2t`; do mencoder -ovc lavc -ffourcc DIVX -xvidencopts fixed_quant=1 -vf crop=0:0,scale=720:420 -zoom -lameopts mode=3:cbr:br=64 -oac mp3lame -o $"`echo $i|sed s/.m2t/-720x420.avi/`" $i;done;

<back>

N


nc
nc -l -p 9000 | dd of=/dev/<HDD>
dd if=/dev/<HDD> | nc <ip> 9000

<back>

O

P


portageq
portageq owners / /<path>/<file>

<back>

python-updater
python-updater -- -av

<back>

Q


qlist
emerge `qlist -I -C x11-drivers/` -av

<back>


quickpkg
quickpkg <category>/<foobar>
quickpkg =<foobar>-1.2.3-r4

<back>

R


rdate
rdate -s <timeserver>
rdate -s ptbtime2.ptb.de

<back>


renice
renice <value from -20 up to 19> -p <pid>

<back>


revdep-rebuild
revdep-rebuild -iv -- --ask
revdep-rebuild --library <lib>*

<back>


rc-status
 rc-status [--all | --list | --unused | <runlevel>]

<back>


rc-update
 rc-update add <script from /etc/init.d> <runlevels>
 e.g. rc-update add xdm default

<back>

S


smartctl
smartctl -a /dev/<HDD>|less
smartctl -t long /dev/<HDD>|less
smartctl -a -d sat,12 -T permissive /dev/<HDD>
# see:http://en.gentoo-wiki.com/wiki/Smartmontools

<back>

creating a stage4 backup
time nice -20 \
tar --no-ignore-case -cvjpf stage4-\
`date -I`@`hostname`.\
`cat /etc/make.conf|grep ^CHOST|cut -d"\"" -f 2`.\
`cat /etc/make.conf|grep ^CFLAGS|grep march|cut -d "=" -f 3|cut -d"\"" -f 1`.tbz2 / \
--exclude=/dev --exclude=/sys --exclude=/proc --exclude=/var/tmp --exclude=/var/log --exclude=/tmp --exclude=/usr/portage/distfiles --exclude=/usr/portage/packages --exclude=/home --exclude=/mnt --exclude=/media --exclude=/bunker

### e.g.
> cat /etc/make.conf|grep ^CFLAGS
CFLAGS="-march=nocona"
CFLAGS="${CFLAGS} -O2"
CFLAGS="${CFLAGS} -pipe"
###

installing a stage4 backup
mount /dev/<partition> /mnt/gentoo
(mkdir /mnt/gentoo/boot)
mkdir /mnt/gentoo/proc
mkdir /mnt/gentoo/dev
mount /dev/<partition> /mnt/gentoo/boot
tar -xvjpf stage4-<date@host>.tbz2 -C /mnt/gentoo/
mount -t proc none /mnt/gentoo/proc
mount -o bind /dev /mnt/gentoo/dev
chroot /mnt/gentoo
grep -v rootfs /proc/mounts > /etc/mtab
env-update
source /etc/profile
# remember to grub/lilo

<back>

synergy
synergys --config /etc/synergy[-client-4].conf --name <server-hostname>_right --display :0.2
# see:Configuration file
ssh -f -N -L 24800:server-hostname:24800 server-hostname
synergyc localhost/127.0.0.1
# see:http://synergy2.sourceforge.net/faq.html

<back>

sysctl
sysctl -a
sysctl vm.swappiness=0
# see:http://www.gentoo.org/news/de/gwn/20050808-newsletter.xml

<back>

T

U


ufed
ufed

<back>


ulimit
ulimit -a
ulimit -u 30
# see:http://www.gentoo.org/news/de/gwn/20050808-newsletter.xml

<back>

V

W


watch
watch genlop -cn

<back>

X

Y

Z