Created
May 1, 2011 13:51
-
-
Save tovbinm/950514 to your computer and use it in GitHub Desktop.
File System manipulations
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| On source: | |
| dd if=/dev/sda | gzip -cf | nc <destination-system-ip> <port> | |
| On destination: | |
| nc -l -p <port> | gzip –dfc | dd of=/dev/sda | |
| (http://conshell.net/wiki/index.php/Linux_P2V) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ls <folder> | xargs -n 100 du -k | sort -n | tail -n <number_of_files> | awk '{if ($1 > <desired_size>) print $2}' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ls -d *.<old_extension> | sed 's/\(.*\).<old_extension>$/mv "&" "\1.<new_extension>"/' | sh |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| echo blahblah | sudo tee /somefile |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| rm -rf `find ./<you folder> -type d -name <criteria>` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| find /<your folder>* -mtime +X -exec rm {} -f \; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| rsync -r --partial --progress --rsh=ssh user@server:/sorce/ /dest/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment