Sometimes while working on rails applications and running them on different ports, I end up getting ‘Address already in use’ error when starting a new application. Usually you can look for the processes with ps and grep the ones you are looking for. But if you are unable to find the process with ps or […]Read more "Address already in use errors – Find and kill process"
When you want to recursively copy files from one directory to another, use find and pipe its output to cpio. find . -name ‘*.jpg’ | cpio -pdm /path/to/<dest_dir> This will find all files with extension ‘jpg’ and copy them to <dest_dir> directory. cpio -pdm copies files to destination directory and also creates the directory structure. […]Read more "Linux – Copy files recursively preserving directory structure"