Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Fix permissions on your files copied from NTFS
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
beandog
Developer
Developer


Joined: 04 May 2003
Posts: 2063
Location: /usa/utah

PostPosted: Sat Mar 06, 2004 6:15 am    Post subject: Fix permissions on your files copied from NTFS Reply with quote

Whenever you copy anything from an NTFS mounted drive to your hd under Linux, the permissions are all screwed up. Here's an alias I use called 'fixntfs' which scans from the directory you're in, and covers everything under that to make the file permissions "normal"

alias fixntfs='find . -type f -print0 | xargs -0 chmod 644; find . -type d -print0 | xargs -0 chmod 755'

steve
_________________
If it ain't broke, tweak it. packages | dvds | blurays | blog | wiki
Back to top
View user's profile Send private message
monotux
l33t
l33t


Joined: 09 Sep 2003
Posts: 751
Location: Stockholm, Sweden

PostPosted: Sat Mar 06, 2004 8:20 am    Post subject: Reply with quote

wow, that's a smart script :)
_________________
Computer science is no more about computers than astronomy is about telescopes.
Back to top
View user's profile Send private message
Deebster
Tux's lil' helper
Tux's lil' helper


Joined: 16 Nov 2003
Posts: 126
Location: Reading, England

PostPosted: Sat Mar 06, 2004 2:43 pm    Post subject: Reply with quote

I have something similar:

find . -type f -exec chmod 644 {} \;; find . -type d -exec chmod 755 {} \;

However, yours runs faster. Damn ;)
Back to top
View user's profile Send private message
beandog
Developer
Developer


Joined: 04 May 2003
Posts: 2063
Location: /usa/utah

PostPosted: Sat Mar 06, 2004 9:20 pm    Post subject: Reply with quote

retribrute wrote:
wow, that's a smart script :)


I cant take credit ... I asked how to fix it on my LUG mailing list and someone told me about it. :)

Aren't lugs great?
_________________
If it ain't broke, tweak it. packages | dvds | blurays | blog | wiki
Back to top
View user's profile Send private message
allucid
Veteran
Veteran


Joined: 02 Nov 2002
Posts: 1314
Location: atlanta

PostPosted: Sun Mar 07, 2004 1:20 am    Post subject: Reply with quote

wish i knew about this earlier. thanks, very useful.
Back to top
View user's profile Send private message
semiSfear
Guru
Guru


Joined: 08 Jul 2003
Posts: 302
Location: Adelaide, SA

PostPosted: Sat Jun 26, 2004 3:54 am    Post subject: Reply with quote

I have a similar helper script for that particular issue. Well not only when copying from ntf partitions but also from CD's

Code:

#!/bin/bash
#
#  A simple script for changing permissions on all
#  files and directories. Including in sub directories.
#  Permissions will be set to 644 on files and 755 on
#  directories.
#
#  Written by semiSfear (C) 2004
#

for DIR in `find ./ -type d`; do
    chmod 755 $DIR
    chown semisfear:users $DIR
done

for FILE in `find ./ -type f`; do
    chmod 644 $FILE
    chown semisfear:users $FILE
done


WARNING: This script assumes that all files and directories in current working dir should be changed. So far I haven't been in a unwanted directory. Knock, knock, knocking on wood. :wink:
_________________
DnB is my religion, Jungle is my church.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum