LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 08-15-2009, 09:32 AM   #1
linus72
LQ Guru
 
Registered: Jan 2009
Location: Gordonsville-AKA Mayberry-Virginia
Distribution: Slack14.2/Many
Posts: 5,573

Rep: Reputation: 470Reputation: 470Reputation: 470Reputation: 470Reputation: 470
how to chown/chmod/touch thru all files/folders in /home/* ??


I'm having another issue again with making chown/chmod/touch work
in all files/folders in my /home/grml folder

Basically, I have to set permissions and restore timestamps to the original settings while chrooted into grml-med squashfs

My problem is if I'm in /home/grml and I issue a command like

Code:
chown -R grml:grml .fluxbox/*
it doesn't seem to affect the "pixmaps" folder(or anything in it) in .fluxbox folder?

so, how can I chown/chmod and do

Code:
touch -ct 08151429 .fluxbox/* change filestamp to 08151429
and have ALL files(hidden too)/folders(hidden too) be affected?
thanks
 
Old 08-15-2009, 10:29 AM   #2
w1k0
Senior Member
 
Registered: May 2008
Location: Poland
Distribution: Slackware (personalized Window Maker), Mint (customized MATE)
Posts: 1,309

Rep: Reputation: 234Reputation: 234Reputation: 234
cd /home/grml

find . * -exec chown grml:grml {} \;
find . * -exec touch -ct 08151429 {} \;

chown grml:grml /home/grml
touch -ct 08151429 /home/grml

Last edited by w1k0; 08-15-2009 at 10:34 AM.
 
Old 08-15-2009, 12:05 PM   #3
linus72
LQ Guru
 
Registered: Jan 2009
Location: Gordonsville-AKA Mayberry-Virginia
Distribution: Slack14.2/Many
Posts: 5,573

Original Poster
Rep: Reputation: 470Reputation: 470Reputation: 470Reputation: 470Reputation: 470
Oh yeah?
I'm gonna try that...

will that aso work on folders files that aren't hidden?
 
Old 08-15-2009, 12:14 PM   #4
w1k0
Senior Member
 
Registered: May 2008
Location: Poland
Distribution: Slackware (personalized Window Maker), Mint (customized MATE)
Posts: 1,309

Rep: Reputation: 234Reputation: 234Reputation: 234
$ ls -laR
Code:
.:
total 1
drwxr-xr-x 4 john users 144 2009-08-15 14:29 .
drwxr-xr-x 3 john users 936 2009-02-09 14:41 ..
drwxr-xr-x 3 john users 120 2009-08-15 14:29 .folder
-rw-r--r-- 1 john users   0 2009-08-15 14:29 .file
drwxr-xr-x 2 john users  48 2009-08-15 14:29 folder
-rw-r--r-- 1 john users   0 2009-08-15 14:29 file

./.folder:
total 0
drwxr-xr-x 3 john users 120 2009-08-15 14:29 .
drwxr-xr-x 4 john users 144 2009-08-15 14:29 ..
drwxr-xr-x 2 john users  48 2009-08-15 14:29 .folder
-rw-r--r-- 1 john users   0 2009-08-15 14:29 .file
-rw-r--r-- 1 john users   0 2009-08-15 14:29 file

./.folder/.folder:
total 0
drwxr-xr-x 2 john users  48 2009-08-15 14:29 .
drwxr-xr-x 3 john users 120 2009-08-15 14:29 ..

./folder:
total 0
drwxr-xr-x 2 john users  48 2009-08-15 14:29 .
drwxr-xr-x 4 john users 144 2009-08-15 14:29 ..
$ find . * -exec chown mary:users {} \;
$ find . * -exec touch -ct 08151800 {} \;

$ ls -laR
Code:
.:
total 1
drwxr-xr-x 4 mary  users 144 2009-08-15 18:00 .
drwxr-xr-x 3 john users 936 2009-02-09 14:41 ..
drwxr-xr-x 3 mary  users 120 2009-08-15 18:00 .folder
-rw-r--r-- 1 mary  users   0 2009-08-15 18:00 .file
drwxr-xr-x 2 mary  users  48 2009-08-15 18:00 folder
-rw-r--r-- 1 mary  users   0 2009-08-15 18:00 file

./.folder:
total 0
drwxr-xr-x 3 mary users 120 2009-08-15 18:00 .
drwxr-xr-x 4 mary users 144 2009-08-15 18:00 ..
drwxr-xr-x 2 mary users  48 2009-08-15 18:00 .folder
-rw-r--r-- 1 mary users   0 2009-08-15 18:00 .file
-rw-r--r-- 1 mary users   0 2009-08-15 18:00 file

./.folder/.folder:
total 0
drwxr-xr-x 2 mary users  48 2009-08-15 18:00 .
drwxr-xr-x 3 mary users 120 2009-08-15 18:00 ..

./folder:
total 0
drwxr-xr-x 2 mary users  48 2009-08-15 18:00 .
drwxr-xr-x 4 mary users 144 2009-08-15 18:00 ..
It means: yes!

Last edited by w1k0; 08-15-2009 at 12:16 PM.
 
Old 08-15-2009, 12:19 PM   #5
linus72
LQ Guru
 
Registered: Jan 2009
Location: Gordonsville-AKA Mayberry-Virginia
Distribution: Slack14.2/Many
Posts: 5,573

Original Poster
Rep: Reputation: 470Reputation: 470Reputation: 470Reputation: 470Reputation: 470
No doubt
I'm mksquashfs'ing it now

Only issues I'm having at the moment is my fluxbox style is not loading
and opera's complaing about it can't save a file to .opera/opera.6adr

only folders in /home/grml are .fluxbox and .opera right now...

I want to put all folders/files from /home/grml there, so if this works thats what I'll do...
 
Old 08-15-2009, 12:21 PM   #6
w1k0
Senior Member
 
Registered: May 2008
Location: Poland
Distribution: Slackware (personalized Window Maker), Mint (customized MATE)
Posts: 1,309

Rep: Reputation: 234Reputation: 234Reputation: 234
Quote:
Originally Posted by linus72 View Post
will that aso work on folders files that aren't hidden?
find . * -exec your command here {} \;

In the above context there is space between . and *. So . means the current directory and * means all the files and folders including hidden.

find .* -exec your command here {} \;

The above command without that space works completely different -- .* means all files in the current directory and its subdirectories as well as all files and folders in the upper directory (../).

Just compare these two commands:

find . *

and:

find .*

starting both from the /home/grml directory.

Last edited by w1k0; 08-15-2009 at 01:26 PM.
 
Old 08-15-2009, 12:23 PM   #7
linus72
LQ Guru
 
Registered: Jan 2009
Location: Gordonsville-AKA Mayberry-Virginia
Distribution: Slack14.2/Many
Posts: 5,573

Original Poster
Rep: Reputation: 470Reputation: 470Reputation: 470Reputation: 470Reputation: 470
uh oh

I think I did , without a space...

Quote:
find .* -exec your command here {} \;
is that bad?
 
Old 08-15-2009, 12:56 PM   #8
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Arch
Posts: 8,529

Rep: Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899
Just wondering,
why don't you disable rsync, and put the files where they belong, and then remaster?
As I understand it, each reboot rsync populates /home/grml with standard settings.
So can you save files or settings in your /home/grml without being overwritten by rsync and the default settings at reboot?
Or do I miss the obvious?
Even if you remaster, and you safe something, will rsync not complain again?
 
Old 08-15-2009, 01:15 PM   #9
w1k0
Senior Member
 
Registered: May 2008
Location: Poland
Distribution: Slackware (personalized Window Maker), Mint (customized MATE)
Posts: 1,309

Rep: Reputation: 234Reputation: 234Reputation: 234
Quote:
Originally Posted by linus72 View Post
I think I did , without a space... is that bad?
Not so bad. You just changed additionally permissions and timestamps of the files in /home directory.

Now jump to the /home directory and use the command:

chown user:group .* *

Of course use your users' and group's names.

Old timestamps are impossible to restore unless you have backup of that directory.
 
Old 08-15-2009, 01:20 PM   #10
linus72
LQ Guru
 
Registered: Jan 2009
Location: Gordonsville-AKA Mayberry-Virginia
Distribution: Slack14.2/Many
Posts: 5,573

Original Poster
Rep: Reputation: 470Reputation: 470Reputation: 470Reputation: 470Reputation: 470
Well
ok, here's the thing

It seems any Debian now has a automatically generated menu system
I have no idea How it generates the flucbox menu

If I put my fluxbox stuff in /etc/X11/fluxbox, it is overwritten or excluded

If I put my stuff in /home/grml/.fluxbox it is great, but has all thees issues
with times and other bs...

I can't seem to figure out how or what generates the menus
it's not fluxbox

here's readme from /usr/share/menu

Quote:
In this directory, each individual package should install it's
menu files. Although changing them in this directory to change
the menus on your local system may work, the sysadmin (you?)
is best advised to put the local menufiles in /etc/menu, as,
otherwise your changes are deleted when you upgrade the corresponding
packages. Users may override the system-wide defaults by putting
their menuentry files in ~/.menu.


For the package maintainer that wants to include menu files in his
package:

The files should have the name of the package that's installing it,
and may contain as many lines (menu entries) as is necessary.

For examples, please look in /usr/share/menu/default
sothats what I'm trying to do
Quote:
Users may override the system-wide defaults by putting
their menuentry files in ~/.menu.
not working...

here's /etc/menu/readme

Quote:
In this directory, the system administrator can install menufiles to
override the menu files provided by Debian in /usr/lib/menu, /usr/share/menu
and /usr/share/menu/default.

The filename should be the name of the package that it is overriding,
and may contain as many lines and menu entries as necessary.

Please run 'update-menus' after changing or adding files.


Now, VERY IMPORTANT:

I am chrooted into the unsquashfs'd grml squashfs on sda3
and I copy my running-from-usb-persistent /home/grml/.fluxbox folder to
the unsquashfs'd /home/
heres procedure

from root terminal

Code:
cd /mnt/sda3/grml/squashfs-root

mount -o bind /dev dev

mount -t proc /proc proc

chroot .
then, I do apt-get update && apt-get install alot

at finish I do "update-menus"

then, I cd back to /
and
Code:
umount proc
umount dev
exit
exit
so, there is no X window, no rebooting

I tried to get Xnest working, but can't seem to get it to work with grml-x
to start user "grml"'s fluxbox you gotta do
Code:
su - grml -c 'grml-x fluxbox' &
which dioesn't work with Xnest

Code:
startfluxbox &
works but it starts the root fluxbox....not what I want

And about rsync
I am no longer getting the rsync errors
just my flux style doesn
t load at dsktop until I go choose a style, then everything works ok

any ideas?
 
Old 08-15-2009, 01:26 PM   #11
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Arch
Posts: 8,529

Rep: Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899
rsync will overwrite all files in /home/grml, and I also think the conf files in /etc, at boot.
So you need to find a way to disable rsync, or find the script that executes rsync,
and make your changes in the original files, rsync uses to restore the settings.
However, this will give problems if you want to make changes, you need to make them in the original files rsync uses,
so not a good idea.
Your best option is to disable rsync
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
File permissions on shared folders: a problem for chmod, chown dedeco Linux - Security 1 07-25-2008 10:15 PM
Chown/Chmod ff Directories/Files Question Genin Linux - Newbie 4 12-27-2006 11:51 AM
chmod/chown and folders :) chibi Linux - Newbie 2 04-28-2005 04:56 PM
help with chmod chown on cdrom copied files spacklebird Linux - Software 2 11-19-2003 12:48 AM
chmod vs chown on some root files and yes apps ergo_sum Linux - Newbie 3 11-12-2003 10:49 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 04:03 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration