General :: Replacing Ownership Of Certain Files?

Jan 30, 2010

Is there any working commandline alternative to # find /some/dir -group xxx -user yyy | chown xxxxx:yyyyyThe main purpose is to replace ownership and goup of certain files in subdirectories. Or nevertheless I need to write shell script for that simple operation ?

View 5 Replies


ADVERTISEMENT

General :: Renaming External Files Changing Ownership Instead Of Root

Mar 28, 2011

i have inherited a mixed bag of sorts: several xp users updating an access mdb with the BE on a lamp stack shared via samba. i have a backup device which gets mounted at: /media/disk... each client record (has) a folder by the companyname on the samba share, and all relative documents are placed there. when the backup script runs, it just copies newer or missing files.

someone has been renaming folders, and not matching the folder name to the related companyname from the mdb. so...the backup script captures and duplicates the data in the renamed folders. some client records also have periods in the name (not required from a data pov), such as 'Company Ltd.' instead of 'Company Ltd'. i can produce a list of company names as the folders should be found easily enough, but get a little stuck with the linux scripting.

i can easily remove and further prevent any unwanted punctuation in the company name on the client record, and create the correct folder name on the samba share with vba, but would also like to:

-for each 'client activity' folder on the backup device
-rename the folder by removing punctuation marks
or
-delete the folder if is a dupe

i tried: ls -al | grep '&' - it properly returns only those lines with an ampersand in the folder name, but returns all folders when i try that with a '.'.

what would be the easiest method to do the renaming? i thought if there was a way to change ownership of the mounted device, then the vba code (easy to write) would be simple.

OK - i just ran chown -R on the external device, changing ownership to (me) instead of root. didn't want to because it took too long, but can now use the MoveFolder method of the filesystemobject from my app to do the renaming instead of some sort of bash script (which i was dreading).

View 1 Replies View Related

CentOS 5 :: Why Do Files Created Via Samba Have Nobody Ownership?

Apr 21, 2011

files and directories are NOT being created with consistent ownership and permissions: when created via Samba, they are created with user/group = nobody, and when created via the OS, they are being created with user/group = root.This causes problems with our automated tools that access the server (via Samba) and do a variety of file system operations (which need root privileges).How do I cofigure Samba so files/directories are created with user/group = root?

View 3 Replies View Related

General :: Searching And Replacing Strings In File With Strings In Other Files

Jul 29, 2010

I want to search and replace strings in a file with strings in other files/i need to do it with big strings(string1 is big) and i want to use a txt file for this.But this code not working :

View 14 Replies View Related

Ubuntu :: Ownership & Permissions Change When Files Burned To DVD+RW?

Jan 18, 2010

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?

View 3 Replies View Related

Debian :: Default Ownership Of Folders And Files - Should Own By A User Without Root Permissions

Feb 12, 2011

Being new to Linux, i've just about got used to the Debian setup procedure now, but had a quick question on the default ownership of files and folders. On my default Debian installation, almost all the folders and files are owned by root:root. Is this the correct advised configuration or should the folders and files be owned by a user without root permissions - eg user:user?

View 12 Replies View Related

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.

View 3 Replies View Related

Ubuntu :: Fixing / Replacing The Bootloader Files?

May 26, 2011

I am having problems with either my boot list (/boot/grub/grub.cfg) or my Master Boot Record. It is possible that something else in this area is causing the problem, however.

Configuration overview:

Machine:Sony Vaio VGN-NS140E laptop
Systems: Dual-booting Vista and Ubuntu
Partitions:Vista Recovery (NTFS)
Vista OS

[code]....

Below is some information on how I believe I created this problem and an overview of steps I took while trying to fix the problem. Several days ago, I ran GParted off of an Ubuntu Natty Narwhal (11.04) LiveUSB to remove an older, broken linux partition containing either the Maverick Meerkat (10.10) or the Lucid Lynx (10.04) release.

That partition had been my original linux partition for this machine. For reference, the partition originally had Intrepid Ibex (8.10) installed. I was unable to load it properly after downgrading from Maverick Meerkat to Lucid Lynx. Maverick had some glaring functionality issues with my laptop model.I needed to remove the partition in a Live session because it was located within an extended partition alongside my currently used Ubuntu partition.

After deleting this partition and rebooting the laptop, it was either the Grub Loader menu or a grub-rescue prompt that appeared. I'm pretty sure that it was the grub-rescue prompt at this point. Unable to move forward from this prompt, I turned off the computer and re-inserted my USB drive to boot into a Live session again. Booting into a Live session worked successfully.

At this point I was able to browse the web for possible solutions. I read somewhere that I should run sudo update-grub from the terminal. After doing this and rebooting the computer, I was taken to the Grub Loader menu. Unfortunately, all of the entries I tried to boot from brought me to the grub-rescue prompt. There were 3 error lines above the prompt, but I don't remember all of them at the moment. I know that one of them did say "Error: You need to load the kernel first."

At the time, I was hoping this could be a fairly easy fix. I had the idea to simply create a new Ubuntu partition where the old one had been. I installed Natty Narwhal to a new partition within my extended partition. When I restarted my computer after the install had been completed, I did not have the results I'd expected or hoped for. The grub-rescue prompt still came up when I attempted to boot into any of the entries listed in the Grub Loader. Also, the new install I had created was not available in the list.

I tried to get information from various commands in either the grub or grub-rescue prompt. Somehow, I was able to determine the kernel name I needed and edited the boot command (the screen accessed when you press 'e' on the Grub Loader) to include it. This was no help at the time. I again restarted the computer and booted into a Live session. I re-installed Natty Narwhal on top of the install I just created, thinking that there may have been a problem with it. After restarting the computer, I was still having the same problems as with the first installation attempt. I ran another Live session.

By looking at other user's Boot Info Script RESULTS.txt files on this forum and following some links, I was able to gain a better understanding of the Grub boot command. With this information and some more experimentation in the grub-rescue prompt, I was able to determine the UUID of my Natty Narwhal partition, edit the boot command mentioned two paragraphs ago, and boot into Ubuntu with only one error. In this new Ubuntu installation, I ran sudo update-grub in the terminal. The command returned entries that matched with those I saw in GParted, but I still had the same problems and incorrect entries when I restarted the computer.

While it is possible that I could determine all of the necessary start-up boot commands to manually enter each of my bootable partitions, this is really rather inconvenient. I want to know how I can permanently fix the Grub or other necessary files so that my bootloader can take back responsibility for this task. It would also be nice to get back into my Lucid Lynx partition because Natty is a bit buggier than I'm okay with. Fixing my problems with Natty is a topic for another post, however.

Code:

Boot Info Script 0.60 from 17 May 2011
============================= Boot Info Summary: ===============================
=> Grub2 (v1.99) is installed in the MBR of /dev/sda and looks at sector 1 of
the same hard drive for core.img. core.img is at this location and looks
for (,msdos6)/boot/grub on this drive.

[code]....

View 1 Replies View Related

Ubuntu :: Fixing/Replacing Bootloader Files

May 26, 2011

I am having problems with either my boot list (/boot/grub/grub.cfg) or my Master Boot Record. It is possible that something else in this area is causing the problem, however.

Computer overview:Make/Model/Type: Sony Vaio/VGN-NS140E/laptop
Operating Systems: Dual-booting Vista and Ubuntu
Partitions: Vista Recovery
Vista OS
Data Files (for sharing between Vista and Ubuntu partitions)
Extended partition containing:Ubuntu 10.04.2 LTS
Ubuntu 11.04
Swap

Note: Vista is 32-bit and Ubuntu is 64-bit

Below is some information on how I believe I created this problem and an overview of steps I took while trying to fix the problem.

Several days ago, I ran GParted off of an Ubuntu Natty Narwhal (11.04) LiveUSB to remove an older, broken linux partition containing either the Maverick Meerkat (10.10) or the Lucid Lynx (10.04) release. That partition had been my original linux partition for this machine. For reference, the partition originally had Intrepid Ibex (8.10) installed. I was unable to load it properly after downgrading from Maverick Meerkat to Lucid Lynx. Maverick had some glaring functionality issues with my laptop model.

I needed to remove the partition in a Live session because it was located within an extended partition alongside my currently used Ubuntu partition.

After deleting this partition and rebooting the laptop, it was either the Grub Loader menu or a grub-rescue prompt that appeared. I'm pretty sure that it was the grub-rescue prompt at this point. Unable to move forward from this prompt, I turned off the computer and re-inserted my USB drive to boot into a Live session again. Booting into a Live session worked successfully.

At this point I was able to browse the web for possible solutions. I read somewhere that I should run sudo update-grub from the terminal. After doing this and rebooting the computer, I was taken to the Grub Loader menu. Unfortunately, all of the entries I tried to boot from brought me to the grub-rescue prompt. There were 3 error lines above the prompt, but I don't remember all of them at the moment. I know that one of them did say "Error: You need to load the kernel first."

At the time, I was hoping this could be a fairly easy fix. I had the idea to simply create a new Ubuntu partition where the old one had been. I installed Natty Narwhal to a new partition within my extended partition. When I restarted my computer after the install had been completed, I did not have the results I'd expected or hoped for. The grub-rescue prompt still came up when I attempted to boot into any of the entries listed in the Grub Loader. Also, the new install I had created was not available in the list.

I tried to get information from various commands in either the grub or grub-rescue prompt. Somehow, I was able to determine the kernel name I needed and edited the boot command (the screen accessed when you press 'e' on the Grub Loader) to include it. This was no help at the time.

I again restarted the computer and booted into a Live session. I re-installed Natty Narwhal on top of the install I just created, thinking that there may have been a problem with it. After restarting the computer, I was still having the same problems as with the first installation attempt. I ran another Live session.

By looking at other user's Boot Info Script RESULTS.txt files on this forum and following some links, I was able to gain a better understanding of the Grub boot command. With this information and some more experimentation in the grub-rescue prompt, I was able to determine the UUID of my Natty Narwhal partition, edit the boot command mentioned two paragraphs ago, and boot into Ubuntu with only one error.

In this new Ubuntu installation, I ran sudo update-grub in the terminal. The command returned entries that matched with those I saw in GParted, but I still had the same problems and incorrect entries when I restarted the computer.

While it is possible that I could determine all of the necessary start-up boot commands to manually enter each of my bootable partitions, this is really rather inconvenient. I want to know how I can permanently fix the Grub or other necessary files so that my bootloader can take back responsibility for this task. It would also be nice to get back into my Lucid Lynx partition because Natty is a bit buggier than I'm okay with. Fixing my problems with Natty is a topic for another post, however.

I am attaching RESULTS.txt from Boot Info Script. Please let me know if you need any other reports of this nature.

Code:

Boot Info Summary:

View 5 Replies View Related

Ubuntu :: Renaming Multiple PDF Files (Replacing Sign)

Jun 21, 2011

I have many pdf files which contain "%" sign also in the name. I want to rename that all files by replacing "%" to "-" Its hierarchy of many files and folders. Is there any solution to do this at one time? OR any script for this?

View 7 Replies View Related

General :: Ownership For All Members Of Group

May 27, 2010

Can I assign ownership of a particular file to everybody of a group?If the file had rwxrw-r-- permissions, will every member of the local-group have owner access privileges (rwx) to this flie now?

View 8 Replies View Related

General :: Restrict Device Ownership To Root Only / Why Is So?

Jul 6, 2011

NSA's Guide to the Secure Configuration of Red Hat Enterprise Linux 5 recommands restricting device ownership to root only.

So my question is why should we restrict device ownership to root? And what does device ownership mean anyway in Linux?

View 2 Replies View Related

General :: Centos Network Settings And Ownership?

May 21, 2011

Installed 5.6 and all is well except my window pc doesn't see the centos laptop on the network, but it is on the network. I have access to the Internet via firefox. Obviously need to set some ipconfig settings, but when I try to edit ipcfg file in sbin, I get a msg, "not the owner, can't save". Is sbin the right directory? Is ipcfg the right file to edit?

View 6 Replies View Related

General :: Change Ownership Of An Entire Directory?

Jul 2, 2010

Installed Sidux over LennySidux didn't want to take my usual username, because a folder with that name existed in my home directory.So, I just mounted the home partition and changed the name of my home directory from shay to shay1.Don't know what that did or didn't do permission wise to the files in my old home directory, but I've got a few unowned files floating around my home directory anyway that have been dragged in from old harddrives and such.

View 3 Replies View Related

General :: Root To Change The Ownership Of A File?

Jun 17, 2011

Why would I need to be root to change the ownership of a file? Example: I'm logged in as dwadmin and I've created a file:

-rw-rw---- 1 dwadmin dgw 0 Jun 17 07:46 testing.txt

I want to change the ownership to another user, but am getting the following error: chown 511 testing.txt chown: changing ownership of `testing.txt': Operation not permitted

View 5 Replies View Related

General :: File Permissions And Ownership Getting Screwed Up

Sep 15, 2010

Is it possible to let users create the directory or files but only user "yat" can delete them.suppose other users are geller ross joe from group FH , who have privileges. whenever these users create file or dir , they should not able delete it.BottomLine: Group users should create file but should not be able to delete them.By the way using sgid bit didnt help .

View 14 Replies View Related

General :: Giving Ownership While Creating Directories?

Jan 27, 2010

Is there any way by which one can give ownership while creating directories itself. It should be one command otherwise it requires root login to change ownership of a directory.

View 4 Replies View Related

General :: How To Change Home Directory Ownership

Jun 24, 2011

I've already done the following commands

Code:
su
chown theif519 /home/theif519
chmod 775 /home/theif519
exit
#usermod -d /home/theif519 login

I've logged out and logged back in, and I was successful in making it the default directory it logs in to. Still, afterwards I noticed that that when I use the list all commands "ls -l" it shows that root owns it and it also shows that I do not, by default, have read write execute over it, only read execute. I'm using Slackware 13.37* in a Virtual Machine* Another thing, I don't think I added any rights to my user, how do I give it more rights as well? Like, wheel and sudo and all of that stuff. Also, this was the website I was using *Although it didn't help much, the comments sure did [URL].

View 4 Replies View Related

General :: How To Change Ownership Of Mp3 Player From Room?

Oct 16, 2010

I am a Linux Noob of the major kind.I have an MP3 player that is owned by root. I have a SANDISK it in also. I can copy files to the player despite it being owned by root but I can't copy them to the SANDISK which is also owned by root. So what is suppose to be after the colon?How do I determine what that is if it is a directory?How do I change to root to change ownership if that is what I need to do?Is there an application that I can use to change ownership easy and what user do I have to be to do that.

View 5 Replies View Related

General :: Changing File And Folder Ownership From Root?

Oct 11, 2010

I created a folder structure as root and now need to transfer ownership to an ordinary user.

This question is linked to this one - [URL]

I have a folder /srv/app-share that needs to be visible/writeable to user1

I tried (as root):

root@server [/]# chown -R user1:user1 /srv/

But that did not work.

View 1 Replies View Related

General :: Change Permissions And Ownership For NTFS Mounts?

Apr 19, 2011

I finally replaced my Windows with Linux.. However, I need to run applications and modify files that are on NTFS mounts. I am unable to change ownership, permissions, and groups on these files so I may modify them without having to copy. I have several times attempted to chmod, chgrp, chown, etc.. while logged-in as root user; however it is to no avail. The owner and permissions are still geared towards root. can I change ownership and permissions on NTFS files so I can modify them without having to convert/copy them over to ext4 or different file system?- Matbtw: I am using OpenSuse 11.4 and running Windows apps with VirtualBox (with Vista installation image). I still have Win7 on my computer (non-emulated) and I would like to keep some files on those NTFS partitions so when I occasionally need to boot into Win7 I can modify those files because Windows blows and doesn't support Linux.

View 5 Replies View Related

General :: Knoppix Data Recovery Ownership Permissions?

Jun 4, 2011

I use Linux but have a computer with windows I use for gaming. It died and put the hard drive into another computer and used knoppix to recover my files. I looked at the ownership of the windows files and the owner is knoppix. Now I am concerned that ownership will not work on my new Windows computer (when I finish building it, that is). Since I don't get into Windows much I have no idea what those permissions should be.

If I copy them with owner knoppix can I even access them in Windows to change the ownership to whatever Windows will accept? If I change the ownership before putting them on a CD with knoppix, can I write the CD? I will have to use the hard drive on the new windows box so will not have access to the files later (unless I also copy them to my Linux computer for safekeeping). At least I know the ownership changes to make with Linux.

View 2 Replies View Related

General :: Changing Ownership Of 'file Name' : Operation Not Permitted

Oct 14, 2010

I`ve been given a project to design a program that will interface with a hardware device through the parallel port.And so far it`s not going go. I managed to write the programe an compiled it, but when runing it the compiler says: 'changing ownership of'and then the file name then it continues to say, 'operation not permitted'.

View 9 Replies View Related

General :: Effect Of Attempting Change Of /FS Ownership Or Rwx Permissions

Aug 9, 2009

My system (CentOs5.3) became erratic after i tried to change wholesale the ownership of the /FS. is it possible to change ownership or rwx permissions of files in linux? what is the safeguard available to preserve the consistency of the program files in linux against such an attempt by su?

View 2 Replies View Related

General :: Replacing Awk With Perl?

Jul 16, 2010

I want the output of this file to be in a column, not next to each ohter. I tired putting a a newline escape character in a few places, but it breaks the script. It is easy in awk, just ls -ltr | awk '{print $8 }'

casper@casper-laptop:~$ pwd
/home/casper
casper@casper-laptop:~$ ls -ltr > /tmp/outfile
casper@casper-laptop:~$ cat -n /tmp/moreawkreplace
1#!/usr/bin/perl

[Code].....

View 1 Replies View Related

General :: Replacing Dot In String But Leaving Last One?

Jan 17, 2011

Possible Duplicate: replacing dot in string, but leaving last one replace the "." [dots], but leave the last one: e.g.: .txt [there could be random number of dots in the string, even zero, i just need the last one]

$ echo 'someth.ing.something.txt' | SOMEMAGIC
someth-ing-something.txt
$

View 1 Replies View Related

General :: Replacing Text In A File?

Jul 26, 2010

how to replace following text in the file name.cfg ?I need to replace

name:=inet.hr=>1|inet.hr=>1
with
name:=none
I am using
sed -i 's/name:=inet.hr=>1|inet.hr=>1/name:=none/g' name.cfg

View 4 Replies View Related

General :: Finding And Replacing Whole Line Using Sed

Mar 19, 2011

assume that i am having the following line in a file called file1. triumph and disaster must be treated same. I want to replace this line with. follow excellence success will chase you. is it possible to do this using sed. if possible kindly post me the code.

View 6 Replies View Related

General :: Replacing A Line With Spaces?

Jan 5, 2011

I have a line like

port = 2566

I want to replace it as

port = 8080

how to do this in shell script. when i tried to do this with sed

sed -i 's/port=.*/port='$3'/' /root/$2

it is not recognizing spaces , it works only if line is port=2566 .

View 6 Replies View Related

General :: Replacing Character / Value In Certain Column

Jun 21, 2011

I need to replace a value in a file. For example the content of data.txt file is:
1 1 23
2 1 42
3 2 52
4 2 62
5 1 77
6 1 88
7 2 99
8 1 100

Could I substitute 2 in second column with 3 using awk and or sed or other command so that the data will be change as follow?
1 1 23
2 1 42
3 3 52
4 3 62
5 1 77
6 1 88
7 3 99
8 1 100

View 3 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved