Miscellaneous

Find text within files:

grep "text" *.txt


Find a file by size:

find / -type f -size +20000k -exec ls -lh {} \; 2> /dev/null | awk '{ print $NF ": " $5 }'  | sort -nrk 2,2


See recent device changes:

dmesg


Remove all .svn files recursively:

find ./ -name ".svn" | xargs rm -Rf

mount

Change already mounted read-only FS system to write:

mount -uw /

dd

dd if=file.bin of=/dev/sda2

Display progress (1)

dd if=file.bin | cpipe -vr -vw -vt | dd of=/dev/sda2

Display progress (2)

dd if=file.bin | pv | dd of=/dev/sda2

backup

tar -u -f user@server:file.tar --rsh-command=/usr/bin/ssh --rmt-command=/usr/sbin/rmt /root/backup/sql /etc/ /var/log/

udpcast

On the master:
udp-sender --file /dev/sda

On the clients:
udp-receiver --file /dev/sda

netcat

nc -l -p 9000 | pv | dd of=/dev/sda

# On Slave, run
nc -l -p 9000 | dd of=/dev/sda

# On Master, run
dd if=/dev/sda | nc 192.168.1.220 9000
 
common_shell_commands.txt · Last modified: 2010/03/05 02:16 by sammy
 
Except where otherwise noted, content on this wiki is licensed under the following license:CC Attribution-Noncommercial-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki