Created
March 18, 2017 05:23
-
-
Save byteshiva/eee0564ad514c4f6df46e0217b79cd01 to your computer and use it in GitHub Desktop.
FAQs Shell scripts
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
Set all files to zero. | |
``` | |
ls | xargs -I {} sh -c '> {}' | |
``` |
rsync between servers(ie, from remote to local).
rsync -avz -e ssh [email protected]://root/somefolder/ .
rsync between servers(ie, from local to remote).
rsync -avz -e /root/someFolder1/ ssh [email protected]://root/somefolder1/
How many cores are there in a process?
pgrep chrome | xargs -I {} sh -c 'cat /proc/{}/status | grep Threads' | more
ref: http://ask.xmodulo.com/number-of-threads-process-linux.html
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ref: http://unix.stackexchange.com/questions/92384/how-to-clean-log-file