Ubuntu Servers :: Change The Ownership Of Multiple Files And Directories Under A Specific Subdirectory?
Feb 19, 2010
I have a vary unique problem with file and directory ownership. I need to change the ownership of multiple files and directories under a specific subdirectory.Under this directory structure there are files and directories owned my different users and groups. I need to change all files and directories owned by "user1" to "user2". but if any are owned by "user3" I need those left alone.Is there a simple way to do this or will I need to traverse the structure and change things one at a time.
After burning files to DVD+RW, the owner is changed to root, and all permissions are read only. I want to periodically open these files, update them, and save to the DVD again, but I no longer have permission and cannot change the permissions since I am no longer the owner. I tried sudo commands, but get responses "Read only file system". I have erased and reformatted the DVD and started over but get the same results. I have Ubuntu 9.04, and have tried Brasero and Nautilus and get the same problem. Am I using the wrong kind of DVD/CD?
process of migrating my server to Ubuntu Server 11.04 after my Server 2003 installation suffered a HDD failure. All my data is on an NTFS drive (not ideal but not much I can do about that). I can currently only read the disk as a user. root has ownership of everything on the disk. Whenever I try and change ownership of a file it doesn't bring up any errors but when running ls -l it shows that nothing has actually changed.
suppose in my current directory, I have 50 sub-directories. Now, I am interested only in about 20 of those sub-directories (whose names match a pattern). I would like to recursively list the contents of these 20 sub-directories. How do I do that ? I would like to do this in Solaris 10 and Linux(RHEL 5.x).
I am using CentOS 5.5 and I created few users (useradd john etc.) and now I want to assign privileges to this user on some directories and files in those directories. For example I want to give read privileges to directory "/documents" and all of files under that directory.
I'd like to create a tar file on my machine to distribute software to other machines which are all alike (including, usernames, groupnames, etc). I need to create certain files and directories with specific owners on the target machine. In order to do that, I use
Code: tar --create --owner=someone --group=somegroup --file package.tar files. However, for this to work, someone must be in my /etc/passwd and somegroup must be in my /etc/group. Is there a way to fake this so I don't have to create a bunch of users only for that purpose?
I have a directory tree with lots of folders. I need to gather all files of same type, say .txt, and place them in a different folder all by themselves.
I know I can use the mv command, but it won't let me go through all the subdirectories of my folder, just the current one. How can I search through all subdirectories for all .txts or whatever and move them to a folder of my choosing?
I currently have samba setup and connecting. What I am trying to do is have multiple users with access to different directories. For example , let's say there are folders A B C on my Linux machine. I want one guy to see A and C and another guy to see B and C and a third guy to see them all. But I want each user to have access to change delete or execute the files within these directories that they have access to
I have 60+ directory's each containing multiple .doc files. I need to move them to a single directory and keep their file name intact. I don't think cp will do that with out listing all the file names. I was thinking of something like: cp -r /dir/*.doc /newdir . Or should I use a combo like find -type *.doc|cp /newdir?
I'd like to move a selection of files from all the sub-directories within an overall directory to a single destination. I don't want any of the directory structure, just the files themselves. This is what I tried so far:
mv /dir1/*/igs*.sp3.Z /dir2
There are other .sp3.Z files in the * directories within /dir1 but I just need the ones that start with igs..
How can I set specific ID3 tags for multiple files? For example, I would like to set all files in a directory to the same album. (directly setting the album tag for files in a directory to the directory name would be even better)
Description: I am a newly appointed system engineer taking care of linux servers. We have a new set of data coming in which need below configuration: How to do a script with function?:
for files with ".txt" in sm copy each of the files to folder : sm1 and sm2 (log every copy) if succesful: remove original log into the log file if not successful: (not successful copying 1 particular file to all the folders) retain and retry log into the log file mail out the admin with that particular file name
I have already do try a bit: cd /export/home/ for dir in sm1 sm2; do cp -p sm/*.txt $dir/ done Is my starting right? How to do the rest parts?
I want to make a webserver with multiple users allowed to login through SFTP to a specific folder, www.Multiple users are added, lets say user1 and user2, and all of them belonging to the www-data group. The www directory has an owner www-data and a group www-data.
I have used chmod -R 775 on the www folder, but after I try to create a folder test through my SFTP server (using Filezilla) the group of the directory created has only r and x permissions, and I am not able to log in with the second user user2 and create a directory within www/test due to a lack of w permission to the group.
I also tried using chmod 2775 on www directory, but without luck. Can somebody explain to me, how can I make it so that a newly created directory inherits the root directory group permissions?
I am trying to copy the files from my WHS disk to my Ubuntu Server disk. I have the windows disk mounted at /media/WINDOWS and I want to transfer to /storage so I ran;Code:sudo cp -r /media/WINDOWS /storageIt takes about 4-5 seconds and is complete, but there is about 500 GB worth of data there so I know it didn't really copy everything over. When I look at the files in console it shows them, but when I look at the /storage through SAMBA on my Windows machine, it only shows the directories.?
A function by name abc is called in many files. I want to copy all the lines with the function call to an output file.A simple grep on function name doesn't help me as the function call is spanning across multiple lines as follows:
abc(parameter1, parameter2, parameter3);
So I want to copy all the three lines (till semicolon) to the output file.The problem is because there are more than 200 calls for the same function and I cannot do it manually
When I try to upload files via FTP to a specific folder (/var/www/myfolder/) I get the message 550 permission is denied. I set CHMOD 777 for this folder (I had to do this via SSH cause I was not allowed to do this in FileZilla)
I have configured a file server with samba and winbind in RHEL5.I am able to allot permission for the active directory groups to my Linux folder.No issues.But i want to set multiple groups of active directory to get ownership to a single directory. Say there are 3 groups a,b,c to have permissions to a folder of the Linux machine.
I've tried using chown to change the owner on one of my folders - but to no luck? This is what I run on the terminal - and there's no output. And when i view the permissions of the folder it's still set to root?[URL]
I need to install a script into my Gimp folder which is owned by root. I tried "chown my name usr/ share/ gimp2.0/scripts" in terminal, but it tells me folder does not exist. I know I'm missing something, but I haven't done this in a while, so I'm not sure what it is.