User Tools

Site Tools


linux:commands

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
linux:commands [2011/12/03 17:48]
tkilla
linux:commands [2020/11/12 00:20] (current)
tkilla
Line 1: Line 1:
-====== Shell Commands ======+====== Shell Commands & Oneliner ======
  
-**the place for useful commands, 1-liners and snippets**+**the place for useful commands, 1-liners, mini-howtos & snippets**
  
-please leave a short description or some links here+please give a short description or some links
  
 +----
  
 ===== archives - tar.gz | bz | 7zip ===== ===== archives - tar.gz | bz | 7zip =====
Line 13: Line 14:
  
  
-**backup mirror.tar via ssh & cat **+**create tar.gz archiv of full system without **
  
-the file-globbing regex /[a-oq-z]* leaves out /p* dirs, to exclude /proc :-)+   tar cvpzf /mnt/somewhere/backup.tgz --exclude=/data --exclude=/proc --exclude=/lost+found --exclude=/mnt --exclude=/sys --exclude=/dev /
  
-   ssh -v root@hostname tar cvf - /[a-oq-z]* | cat > /backupdir/mirror.tar 
  
 \\ \\
 ---- ----
 +
 +===== compressed dump of complete filesystems ===== 
 +
 +**backup raw data of a disc (as root): **
 +
 +  dd if=/dev/sdX | gzip -c9 > /PATH/TO/BACKUP.gz
 +
 +**restore to a __drive of same size__ as original medium:**
 +
 +  gunzip -c /PATH/TO/BACKUP.gz | dd of=/dev/sdX
 +\\
 +----
 +
 +===== various methods howto backup & restore =====
 +
 +**[[http://wiki.eeeuser.com/backup_restore]]**
 +
 +\\
 +----
 +
  
 ===== sound ===== ===== sound =====
Line 26: Line 46:
 **mp3 "normalize" by id3 tag** **mp3 "normalize" by id3 tag**
  
-mp3gain analyses sound files and saves an id3 volume metatag to them. +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.
- +
-many music-players can read that id3 tag and adjust the volume.+
  
    find /path/to/music/ -type f -iname '*.mp3' -print0 | xargs -0 mp3gain -r -k    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
 +
 +==== Create Random File ====
 +
 +count is in KiB
 +
 +  dd bs=1024 count=1000 </dev/urandom >myfile  
 +
 +===== Fix locales ===== 
 +
 +  export LANGUAGE=en_US.UTF-8; export LANG=en_US.UTF-8; export LC_ALL=en_US.UTF-8; locale-gen en_US.UTF-8 
 +
  
  
linux/commands.1322930911.txt.gz · Last modified: 2011/12/03 17:48 by tkilla