1
vote
2answers
347 views

How to exclude hidden files in recursive chmod?

I am having to do chmod -R 755 some_dir where 'some_dir' contains '.git' folders. Is there any way I can exclude hidden files and folder when doing recursive chmod? Note: chmoding .git folder is ...
4
votes
2answers
4k views

Difference between cp -r and cp -a

Looking for the difference between cp -r and cp -a? What does recursive mean in terms of copying files from a folder?
8
votes
6answers
29k views

How to remove all the files in a directory?

I am trying to remove all files and subdirectories in a directory. I used rm -r to remove all files, but I want to remove all files and subdirectories, excluding the top directory itself. For ...
8
votes
4answers
6k views

Finding a substring in files across subdirectories with a single built-in command?

In Windows, if I wanted to find a string across all files in all subdirectories, I would do something like findstr /C:"the string" /S *.h However, in Linux (say, Ubuntu) I have found no other way ...