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 [2012/02/05 02:53]
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, mini-howtos & snippets** **the place for useful commands, 1-liners, mini-howtos & snippets**
Line 13: Line 13:
    tar -czvf myfiles.tar.gz /home/username/myfiles/    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 :-)+**create tar.gz archiv of full system without ** 
 + 
 +   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 
  
 \\ \\
 ---- ----
  
-===== swap =====+===== compressed dump of complete filesystems ===== 
  
-**create and use swapfile**+**backup raw data of disc (as root): **
  
-   dd if=/dev/zero of=/swapfile bs=1024 count=100000 +  dd if=/dev/sdX | gzip -c9 > /PATH/TO/BACKUP.gz
-   mkswap /swapfile +
-    +
-edit /etc/fstab -- add a swap-line for auto activation after reboot:+
  
-   /swapfile       swap    swap    defaults        0       0+**restore to a __drive of same size__ as original medium:**
  
 +  gunzip -c /PATH/TO/BACKUP.gz | dd of=/dev/sdX
 +\\
 +----
  
-turn it on: +===== various methods howto backup & restore =====
-   swapon /swapfile+
  
-and verify: +**[[http://wiki.eeeuser.com/backup_restore]]**
-   free -m +
-   mount+
  
 \\ \\
 ---- ----
 +
  
 ===== sound ===== ===== sound =====
Line 74: Line 71:
 info from: http://www.howtoforge.com/how-to-add-bash-completion-in-debian 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.1328406834.txt.gz · Last modified: 2012/02/05 02:53 by tkilla