![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | 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 !! |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| unix questions | ccp | UNIX for Dummies Questions & Answers | 4 | 07-22-2008 08:51 AM |
| some questions about UNIX 5.0.6 , Help me please | mrr53 | SCO | 2 | 10-27-2007 03:53 AM |
| New To Unix - Some Questions! | yahoo14 | UNIX for Dummies Questions & Answers | 1 | 06-08-2006 02:43 AM |
| Some UNIX Questions! | JoeTheMan | UNIX for Dummies Questions & Answers | 1 | 01-19-2006 01:30 AM |
| I have a few questions about Unix.. | SolidWing68 | UNIX for Dummies Questions & Answers | 1 | 08-11-2005 06:22 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | 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.
|
|
||||
|
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 06: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 |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|