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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
11-10-2005, 08:39 PM
|
#1
|
Member
Registered: Jul 2005
Location: West Coast South, USA
Distribution: debian 3.1
Posts: 267
Rep:
|
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 ??
|
|
|
11-10-2005, 09:51 PM
|
#2
|
Member
Registered: Aug 2005
Location: Oregon
Distribution: Kubuntu.
Posts: 848
Rep:
|
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).
|
|
|
11-10-2005, 10:01 PM
|
#3
|
Member
Registered: Aug 2005
Posts: 80
Rep:
|
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.
|
|
|
11-10-2005, 11:02 PM
|
#4
|
Member
Registered: Aug 2005
Location: Oregon
Distribution: Kubuntu.
Posts: 848
Rep:
|
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.
|
|
|
11-11-2005, 01:19 AM
|
#5
|
Member
Registered: Jul 2005
Location: West Coast South, USA
Distribution: debian 3.1
Posts: 267
Original Poster
Rep:
|
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...!
|
|
|
11-11-2005, 01:28 AM
|
#6
|
Member
Registered: Jul 2005
Location: West Coast South, USA
Distribution: debian 3.1
Posts: 267
Original Poster
Rep:
|
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
|
|
|
11-11-2005, 03:02 AM
|
#7
|
Member
Registered: Aug 2005
Location: Oregon
Distribution: Kubuntu.
Posts: 848
Rep:
|
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.
|
|
|
11-11-2005, 03:22 AM
|
#8
|
Member
Registered: Jul 2005
Location: West Coast South, USA
Distribution: debian 3.1
Posts: 267
Original Poster
Rep:
|
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...)
!!
|
|
|
11-11-2005, 03:38 AM
|
#9
|
Member
Registered: Jul 2005
Location: West Coast South, USA
Distribution: debian 3.1
Posts: 267
Original Poster
Rep:
|
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.
|
|
|
11-11-2005, 01:30 PM
|
#10
|
Member
Registered: Aug 2005
Location: Oregon
Distribution: Kubuntu.
Posts: 848
Rep:
|
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.
|
|
|
All times are GMT -5. The time now is 02:20 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|