User Tools

Site Tools


Sidebar






newpage

linux:commands

This is an old revision of the document!


Shell Commands

the place for useful commands, 1-liners, mini-howtos & snippets

please give a short description or some links


archives - tar.gz | bz | 7zip

create tar.gz archiv

 tar -czvf myfiles.tar.gz /home/username/myfiles/


backup mirror.tar via ssh & cat

the file-globbing regex /[a-oq-z]* leaves out /p* dirs, to exclude /proc :-)

 ssh -v root@hostname tar cvf - /[a-oq-z]* | cat > /backupdir/mirror.tar



swap

create and use a swapfile

 dd if=/dev/zero of=/swapfile bs=1024 count=100000
 mkswap /swapfile
 

edit /etc/fstab – add a swap-line for auto activation after reboot:

 /swapfile       swap    swap    defaults        0       0

turn it on:

 swapon /swapfile

and verify:

 free -m
 mount



sound

mp3 “normalize” by id3 tag

mp3gain analyses sound files and saves an id3 volume metatag to them. many music-players can read that id3 tag and adjust the volume to that gain.

 find /path/to/music/ -type f -iname '*.mp3' -print0 | xargs -0 mp3gain -r -k



bash completion

debian misses to enable this by default :( it enables a lot of auto complete for file paths, commands, command parameters(!) and more

 apt-get install bash-completion

add this to /etc/profile to enable completion for all users:

 if [ -f /etc/bash_completion ]; then
   . /etc/bash_completion
 fi

enable it by opening a new console or

 source /etc/profile

info from: http://www.howtoforge.com/how-to-add-bash-completion-in-debian

linux/commands.1328406834.txt.gz · Last modified: 2012/02/05 02:53 by tkilla