Problem Scenario:
You want to copy all the contents of a directory (lets say source_dir) which contains lots of other files and subdirectories inside it to another directory (lets say target_dir). If you simply try cp command it may result in the following error:
command: cp source_dir target_dir
output: cp: omitting directory source_dir
If you try recursive copy (using option -r) the directory is copied inside the target directory which you may not be suitable if you want to duplicate the contents of the source directory.
command: cp -r source_dir target_dir
command: ls target_dir
output: source_dir
Solution:
If you want to copy just the contents of the source directory as in duplicating all its contents use the following command:
command: cp -r source_dir/* target_dir
This command will copy all the content (not the directory itself) in the target directory.
Seems like October 2011 is a sad month for tech world. We have lost 3 visionaries who have changed the world by their innovation. First it was Steve Jobs, the founder of Apple Inc then Robert Galvin, Motorola’s cellphone pioneer and now Dennis Ritchie, author of C programming language and co-author of Unix Operating System has died.






