Wednesday, July 31, 2013

Count number of files in a directory using Linux command

Following command can be used to get number of files in the directory. This "maxdepth" option lets you to define maximum depth (sub directory levels) to search files.

find ./targetdir/ -maxdepth 20 -type f -follow | wc -l

Thursday, July 4, 2013

Create RSA public & private keys in Linux

Using following command you can create public & private keys in Linux.

ssh-keygen -t rsa

This command can be executed in any SSH enabled Linux machine. RSA keys will be stored in .ssh directory created in your home directory.