Ah, finding out the hard way you should have used tar to back / restore. :(
find . -type f -name '*.txt' -exec chmod -x {} +
Or with any other selector you want, e.g.
find -regextype posix-extended . -type f -iregex '.*\.(txt|css|html)' -exec chmod -x {} +
Actually, hardly anything in your home directory should be executable, so I'd start with just find -type f
(without -name), and then make things executable as necessary. Maybe chmod to mode 664, if you ended up with everything mode 777, since you don't want world write permission on your files (or directories either). So actually,
chmod o-w -R ~ is a good idea.
Some files should not be readable by other users on the same machine, e.g. ~/.bash_history, ~/.ssh, ~/Mail, and so (based on what I have in my home directory that might actually matter)
cd
chmod 600 .bash_history .esd_auth .githistory .ICEauthority .lesshst .mcoprc .netrc* .pulse-cookie .recently-used* .viminfo .Xauthority .xsession-errors
chmod 700 .dbus .gconf* .gnome* .gnupg .icedteaplugin .kde .macromedia .metacity Mail .mozilla .openoffice.org* .pulse .purple .Skype .ssh .thumbnails .tsclient .update-notifier
chmod 2700 .gnupg # super-ultra-paranoid, I guess.
chmod 500 .gvfs # gvfs is weird, and maybe not present on current ubuntu?
copy/paste that into a terminal. Don't worry about errors, I'm sure you don't have all the same dotfiles and directories I do. (and I left out a lot of obscure ones that are really just game save directories, and could be publicly readable without harm.) Generally, if you don't want your pr0n stash or any mention of it to show up in other users' locate results, or other searches, make sure your history files and so on are private.
this duplicate has the same basic question and a much better answer: http://superuser.com/questions/91935/how-to-chmod-755-all-directories-but-no-file-recursively
– quack quixote – 2010-02-13T07:56:15.9072Please change the title to reflect the actual question. – None – 2009-09-12T23:16:47.457