Category Archives: linux

Linux Tip: How to create a list of directories inside a directory and place an empty file in each of them

Today, I wanted to create a list of directories inside a directory and place an empty file in each of them. In this quick post, I will share two commands that can do that for you.

$ mkdir $(printf "%02i-day " $(seq 1 50))
$ find . -type d -exec touch {}/.gitkeep \;

You don’t have to type $. It is only to signify command-prompt.

SCP command for Copying files from remote linux machine to local machine

I just faced a requirement that I needed to copy a zip file containing logs from a remote server to my local machine for some analysis.
I googled around and found at that you can use scp command to that for you.

scp -r <username of remote machine>:<remote location> <location of local directory>

scp -r shekhar@dev.xebia.com:/home/xebia/application/logs/logs-1-09-2011.zip /home/shekhar/tmp