In Unix I have to copy bulk files from one folder to another they are in below form
but while copying to the destination want to remove time part and copy as below:
Continue reading “Bulk file copy in unix with custom name”
I was working today on one production issue where a requirement came to restore files from a archive directory in batch of 250, so i created this command to run in unix, have a look might be helpful for you.
Continue reading “Copy First N files from current directory to other directory”
Yesterday, I was working on some shell script piece for my project and I came across a situation where I have to copy some files from one server to another using ‘scp’ command and also some time have to execute some command on other server. One requirement was we don’t need to pass the password of functional id inside the script.
User should be able to login to other server without password using command “ssh -l username remotehost”.
For this I used SSH public key based authentication as below:-
Continue reading “UNIX: How to Automate SSH Login”
In continuation to my earlier post regarding concatenation similar files into one. I am writing this post to demonstrate counting lines of similar kind of files in a given directory and sub-directory.
Below command will find all the logs with given name pattern inside the directory including sub directories and then WC will count it’s lines and display on screen in total.
Continue reading “Count lines of multiple similar files in unix”