![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| unix questions | ccp | UNIX for Dummies Questions & Answers | 4 | 07-22-2008 04:51 AM |
| some questions about UNIX 5.0.6 , Help me please | mrr53 | SCO | 2 | 10-26-2007 11:53 PM |
| New To Unix - Some Questions! | yahoo14 | UNIX for Dummies Questions & Answers | 1 | 06-07-2006 10:43 PM |
| Some UNIX Questions! | JoeTheMan | UNIX for Dummies Questions & Answers | 1 | 01-18-2006 09:30 PM |
| I have a few questions about Unix.. | SolidWing68 | UNIX for Dummies Questions & Answers | 1 | 08-11-2005 02:22 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Display Modes |
|
|||
|
2 Unix questions
If I wanted to do the following things to all the files in a directory how could I do it. Make all the files in a directory and in its sub directories to hidden status and make a different directory and all its sub directories copy inhibit. I am really stumped and have been looking through the internet for the answer and no luck so far. I was thinking chmod but I think that is incorrect so please help me.
|
| Forum Sponsor | ||
|
|
|
|||
|
so how would i go about renaming all the files in a directory and its sub dirctories to the same names with a . in front of them????
like a mv -R * .* or something so all the files keep there original name and just add a . infront???? Last edited by kaka; 10-19-2007 at 02:36 PM. |
|
|||
|
you would need to do something like
Code:
find PRIVATE -type f | while read N
dir=`dirname $N`
base=`basename $N`
mv $N ${dir}/.${base}
done
By the way, why not just make the directory 0700? Also, simply making something hidden does not stop people reading it. |
|
|||
|
find PRIVATE -type f | while read N
dir=`dirname $N` base=`basename $N` mv $N ${dir}/.${base} done I am new to unix can you explain that code? Does it do this: my Main directory is name in name is a file and a sub directory with a name like jon in that is a file will that code rename all of the files under it to hidden |