Categories
Linux

Number of files in directory (recursive file count)

ls -1R | wc -l

ls -1R | grep .*.mp3 | wc -l

Categories
Linux

How to find out Memory Slot / Size on Linux?

$ dmidecode -t 17

Categories
Linux

Finding a File containing a particular text string in Linux server

http://www.cyberciti.biz/faq/howto-search-find-file-for-text-string

Categories
Linux

Recover MySQL root Password

http://www.cyberciti.biz/tips/recover-mysql-root-password.html

Categories
Linux

How to rm files recursively?

find . -name ‘*attach*’ | xargs rm

To be even MORE accurate

find . -name ‘*attach*’ -print0 | xargs -0 rm

Will make sure you process any pesky files with spaces in their names

http://forums.whirlpool.net.au/archive/350903

Categories
Linux

inode count linux command

find ./ -printf %i’\n’ | sort -u | wc -l

Categories
Linux

rsync with any ssh port linux command

rsync -avz -e “ssh -p 2222” /source/directory/ host@domain.com:/destination/directory/

Categories
Linux

tar file copy via ssh

( cd SOURCEDIR && tar cf – . ) | ssh target_address “(cd DESTDIR && tar xpf – )”