LinuxQuestions.org
Help answer threads with 0 replies.
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 11-10-2005, 08:39 PM   #1
danimalz
Member
 
Registered: Jul 2005
Location: West Coast South, USA
Distribution: debian 3.1
Posts: 267

Rep: Reputation: 36
File system guru - please help!! weird /home


Okay there's something Im not getting. Ive hacked around and tried a few things but still cannot figure this out...

The issue is my /home directory, specifically:

/home/dummy

if I issue the command (as user: dummy, of course)

find /home/dummy -iname *png

I get a whole lot of listings, from the hidden directories within /home/dummy

This holds true until i issue the exact same command while I am actually
in /home/dummy

Then it only finds a single file.

I hate not being able to figure this stuff out.

What is changing when i cd to /home/dummy ??
 
Old 11-10-2005, 09:51 PM   #2
GrueMaster
Member
 
Registered: Aug 2005
Location: Oregon
Distribution: Kubuntu.
Posts: 848

Rep: Reputation: 30
Try the same command this way:

find /home/dummy -iname "*png"

The problem may be that the shell is trying to expand the * in the filename before passing it to the find utility (shells will parse the cmdline for any preparsing that needs to be done, like pipes and typeglobs).
 
Old 11-10-2005, 10:01 PM   #3
bb002
Member
 
Registered: Aug 2005
Posts: 80

Rep: Reputation: 15
Man that is wierd...I tried everything like you said but it worked as expected both times. I got a huge list of png's.

When you cd to a different directory that's all that change's. I think you have a whigged out find command. The only time your current directory should affect "find" is if you don't specify a path but you have in your case, so "find" should return the same result no matter the currect directory.
 
Old 11-10-2005, 11:02 PM   #4
GrueMaster
Member
 
Registered: Aug 2005
Location: Oregon
Distribution: Kubuntu.
Posts: 848

Rep: Reputation: 30
Actually, what happens without the quotes, is the shell assumes you are passing a list of files to the command, and expands it for you. With the quotes, the shell will ignore all metacharacters (*?\ and spaces), passing them straight to the command.
 
Old 11-11-2005, 01:19 AM   #5
danimalz
Member
 
Registered: Jul 2005
Location: West Coast South, USA
Distribution: debian 3.1
Posts: 267

Original Poster
Rep: Reputation: 36
GrueMaster,

You are the Guru-Gruemaster...!

Spot on. I have one damn file in /home/dummy that matches *png - that's the bloody thing.

sheesh...

The quotes are the key here. Actually something similar happened to me before & i should have
caught this...

I always learn something the moment i've got it all figured out.

Listen, thanks guys, well done...!
 
Old 11-11-2005, 01:28 AM   #6
danimalz
Member
 
Registered: Jul 2005
Location: West Coast South, USA
Distribution: debian 3.1
Posts: 267

Original Poster
Rep: Reputation: 36
Actually Grue-ster,

Since i have your attention; the reason i ran into this whole thing was I was trying
to find some .jpg files that I had 'lost'. Still cant find them. These were wallpaper files that
i downloaded from gnome-look.org. YOu see, i downloaded the w-paper files (jpgs) then used the gnome tools for changing the wallpaper, and got everything the way i wanted, i then logged out. Next time i logged back into gdm, I had no wallpaper at all, and the .jpg files were (and still are) quite gone.

this is still a mystery, but i think it has something to do with gnome. any ideas?

Also, to burden you further , and going back one more step, all of these troubles relate to me trying to figure out how to add a new user, say 'dummy2' via bash; and then copy the necessary files and set the proper chowns and chmods to enable the same desktop and settings for dummy2 as are set for 'dummy'.

Does this make sense??

Cheers,
Danimalz
 
Old 11-11-2005, 03:02 AM   #7
GrueMaster
Member
 
Registered: Aug 2005
Location: Oregon
Distribution: Kubuntu.
Posts: 848

Rep: Reputation: 30
It's possible they were moved to a different directory, like /tmp or /usr/share/, but I'm not sure about that. Another posibility is that when you log in, your ~/.gnome directory is getting wiped and reset (I've seen it before, but it's been a while). I haven't worked with Debian at all, and I'm not much of a Gnome user (I prefer KDE). I'll download a copy tonight via bittorrent and install it on a spare system tomorrow, to see what I can come up with.

As to adding a new user then copying the settings, the easiest way to do this on a small scale (one or two users) is with adduser (useradd on some systems). Once you have a new user directory, as root, copy the files from /home/user1 to /home/user2, then "chown -Rf user2 /home/user2/*".

If user1 is going to be a template to multiple new users, you can copy all of user1 to /etc/skel/ (this is where all the default settings for new users originate). Then, everytime you run adduser, it will create their entire home directory structure to match your new default config.

P.S. Cool cmdline speed copy trick. cd <source directory>;tar -cf - . |(cd <destination>;tar -xvf -). This will create a dual threaded copy that is faster than cp, especially on multiple files.
 
Old 11-11-2005, 03:22 AM   #8
danimalz
Member
 
Registered: Jul 2005
Location: West Coast South, USA
Distribution: debian 3.1
Posts: 267

Original Poster
Rep: Reputation: 36
Grue,

Thanks so much, but don't go installing a system just to answer my stupid question about where files went.. I'll figure this out (probably) myself..!

Regarding the copying of files from one /home to another. This is what i am testing, but here's the rub:

I've got user 'dummy' set up the way i want within gnome. But user 'dummy' also has his own personal files, data, whatever, and these files might exist anywhere within and 'underneath' /home/dummy. If i just copy /home/dummy to /home/dummy2, i'll be sharing stuff that i may not want to. Thing is, im looking for the best way to copy only the gnome environment stuff - duplicating the desktop, but not ever risking the mixing of other files amongst the dummies. Or in the case that dummy and dummy2 have both exististed awhile; i don't want to over-write dummy2's non-gnome stuff. See?

(Grateful for your help thus far...)

!!
 
Old 11-11-2005, 03:38 AM   #9
danimalz
Member
 
Registered: Jul 2005
Location: West Coast South, USA
Distribution: debian 3.1
Posts: 267

Original Poster
Rep: Reputation: 36
Uh, and oh....

regarding your copying tip...

can u xplain how the system handles this command string, and why it is 'threaded' and faster? than simply copying....??

(when i see this kinda stuff, i wanto quit linux cause i get so humbled.)


but i cant.
 
Old 11-11-2005, 01:30 PM   #10
GrueMaster
Member
 
Registered: Aug 2005
Location: Oregon
Distribution: Kubuntu.
Posts: 848

Rep: Reputation: 30
To answer your first question "If i just copy /home/dummy to /home/dummy2, i'll be sharing stuff that i may not want to.":

From what I can tell, gnome stores it's desktop configuration files in several hidden directories in the home directory. Here's a list of what I'm seeing:

.fonts.cache-1
.gconf/
.gconfd/
.gnome/
.gnome2/
.gnome2_private/
.gstreamer-0.8/
.gtkrc-1.2-gnome2
.ICEauthority
.screenrc
.xautherR4rr
.Xauthority
.xsession-errors

I'd start by copying those.

As to your second question regarding tar copying, the first invocation (tar -cf - .) creates a tar file stream to standard output (-) reading files listed starting with (.). The pipe (|) tells the shell to launch another program to read it's output. The second program launched is actually two sub commands surrounded by (), the first command (cd <dest>) moves to our destination directory, the second program (tar -xvf -) extracts verbally from file, in this case, standard input (-). The reason this is faster, is you have one program reading (tar -cf), and one program writing (tar -xvf) as opposed to only one program reading & writing (cp). In a multitasking operating system, splitting a job across multiple threads can speed up the job by how many independant threads can execute at once.

It seams intimidating at first, but as you start using Linux more, you'll start learning shortcuts and tricks that will greatly speed up your productivity. Like knowing how to have multiple X sessions (the default display is :0, but you could have several more if you wanted to). I won't go into it here, but there is more documentation on this at http://gd.tuwien.ac.at/opsys/linux/L...multiple.html.

BTW: Don't worry about me having to download Debian just for you. This is how I learn, and can help others.

Last edited by GrueMaster; 11-11-2005 at 02:32 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Really weird Mac system File?: _VUC69~7 Jared Lewis Linux - Networking 1 02-07-2006 06:33 AM
/home partition changed to read-only file system! Echo Kilo Linux - Software 1 03-30-2005 02:59 PM
recent attack via phpBB, log files deleted? accessed file system outside /home/ enzo250gto Linux - Security 8 12-17-2004 02:51 PM
/home file system 100% full gromo Linux - Enterprise 5 11-04-2004 10:47 PM
A Really Weird File System Problem atheist Linux - Software 13 07-08-2004 04:36 AM

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

All times are GMT -5. The time now is 02:20 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