LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 06-09-2008, 12:32 PM   #1
carlosinfl
Senior Member
 
Registered: May 2004
Location: Orlando, FL
Distribution: Debian
Posts: 2,896

Rep: Reputation: 73
Removing a Specific Dir From All /home Dir


I am moving everyone's home directory from server_old to server_new.

Code:
[root@server_old carlwill]# ls -la
total 52
drwx------    4 carlwill it_dept  4096 Apr 16  2007 .
drwxr-xr-x  420 root      root  16384 Jun  9 08:53 ..
-rw-r--r--    1 carlwill it_dept    24 Oct 18  2006 .bash_logout
-rw-r--r--    1 carlwill it_dept   191 Oct 18  2006 .bash_profile
-rw-r--r--    1 carlwill it_dept   124 Oct 18  2006 .bashrc
-rw-r--r--    1 carlwill it_dept   120 Oct 18  2006 .gtkrc
drwxr-xr-x    3 carlwill it_dept  4096 Oct 18  2006 .kde
drwx------    9 carlwill it_dept  4096 Apr 16  2007 data
My question is can I simply run rm -rf *.kde to delete everyone's .kde hidden directory in their home dir? The new server does not have KDE and I don't want to migrate over useless files / folders especially on a critical server like this one.

I know if I remove KDE from server_old, that will not remove their ~/.kde directories sadly unless there is a switch I am unaware of.

Anyone know what the best course of action would be? I am trying to delete the two .directories in red on all 500 users on this server...

Last edited by carlosinfl; 06-09-2008 at 12:40 PM.
 
Old 06-09-2008, 12:43 PM   #2
anomie
Senior Member
 
Registered: Nov 2004
Location: Texas
Distribution: RHEL, Scientific Linux, Debian, Fedora, Lubuntu, FreeBSD
Posts: 3,930
Blog Entries: 5

Rep: Reputation: Disabled
Quote:
Originally Posted by Carlwill
My question is can I simply run rm -rf *.kde to delete everyone's .kde hidden directory in their home dir?
Depending on where you run that from, it's probably not going to match anything (or it won't match what you want it to).

Quote:
Originally Posted by Carlwill
I know if I remove KDE from server_old, that will not remove their ~/.kde directories sadly unless there is a switch I am unaware of.
IMO, that's a good thing. I would be irked if removing (or upgrading) a DE decided to blow away personalized configurations.

Quote:
Originally Posted by Carlwill
Anyone know what the best course of action would be?
One option would be a simple find, e.g.:
Code:
# find /home -name '.kde' -exec echo rm -r {} \;
See that echo in there? Run the command once and make sure you're very certain it is only going to delete what you'd expect. Then run it again without the echo...
 
Old 06-09-2008, 12:49 PM   #3
carlosinfl
Senior Member
 
Registered: May 2004
Location: Orlando, FL
Distribution: Debian
Posts: 2,896

Original Poster
Rep: Reputation: 73
Quote:
Originally Posted by anomie View Post
One option would be a simple find, e.g.:
Code:
# find /home -name '.kde' -exec echo rm -r {} \;
See that echo in there? Run the command once and make sure you're very certain it is only going to delete what you'd expect. Then run it again without the echo...
I ran the following in the command prompt:

Code:
# find /home -name '.kde' -exec echo rm -r {} \;
It came back immediately with no results...did I do it wrong?
 
Old 06-09-2008, 12:57 PM   #4
anomie
Senior Member
 
Registered: Nov 2004
Location: Texas
Distribution: RHEL, Scientific Linux, Debian, Fedora, Lubuntu, FreeBSD
Posts: 3,930
Blog Entries: 5

Rep: Reputation: Disabled
I don't want to be offensive here, but you didn't include the # in that command did you? That's intended to be a root prompt.
 
Old 06-09-2008, 01:08 PM   #5
carlosinfl
Senior Member
 
Registered: May 2004
Location: Orlando, FL
Distribution: Debian
Posts: 2,896

Original Poster
Rep: Reputation: 73
No offense taken and yes - its Monday so I am allowed to make one stupid mistake...
 
  


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
rsync -u Does it update the contents of a dir if that dir is changed? crazyivan Linux - Software 1 04-02-2008 03:08 AM
Command to display /dir, /dir/sub, /dir/sub/files knockout_artist Linux - Newbie 9 10-25-2007 02:57 PM
Q. moving /bin dir files to /dev dir?? Texas_student Linux - Software 2 03-26-2006 11:42 PM
Share configuratin dir (.dir) for 3 accounts on local computer LiNuXkOlOnIe Linux - Software 5 01-08-2006 03:36 AM
howto make a dir shared that is not in my home dir Schmurff Linux - Newbie 2 06-19-2004 07:54 PM


All times are GMT -5. The time now is 03:40 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration