LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 12-08-2010, 10:39 AM   #1
karthigan
LQ Newbie
 
Registered: Dec 2010
Posts: 3

Rep: Reputation: 0
Delete all .orig config files after slackpkg update process


How do I delete all the .orig config files after I go throught the following process?

slackpkg update
slackpkg install-new
slackpkg upgrade-all

Best Regards,
Karthigan.
 
Old 12-08-2010, 02:14 PM   #2
jan61
Member
 
Registered: Jun 2008
Posts: 235

Rep: Reputation: 47
Moin,

do you look for a common way to find (and delete) files with the suffix ".orig"? I'm not firm with the commands you posted (Slackware?), but for such tasks find is your friend:
Code:
find /etc -type f -name '*.orig' -print0 | xargs -0 rm
find ~ -type f -name '*.orig' -print0 | xargs -0 rm
The commands recursively search in /etc and your HOME for all regular files with the suffix .orig and print the pathnames. The output is piped to the xargs command which executes the rm for each file. It is possible to execute the rm within the find (find ... -exec rm {}\;) but this will start a new process for each file. xargs collects as much file names as possible for one command execution.

The "-print0" and the "-0" options use 0x00 as separator instead of \n to avoid problems with blanks and other special characters in file names.

hth
Jan
 
Old 12-08-2010, 02:28 PM   #3
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,148
Blog Entries: 2

Rep: Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886
Quote:
Originally Posted by jan61 View Post
Moin,

do you look for a common way to find (and delete) files with the suffix ".orig"? I'm not firm with the commands you posted (Slackware?), but for such tasks find is your friend:
Code:
find /etc -type f -name '*.orig' -print0 | xargs -0 rm
find ~ -type f -name '*.orig' -print0 | xargs -0 rm
The commands recursively search in /etc and your HOME for all regular files with the suffix .orig and print the pathnames. The output is piped to the xargs command which executes the rm for each file. It is possible to execute the rm within the find (find ... -exec rm {}\;) but this will start a new process for each file. xargs collects as much file names as possible for one command execution.

The "-print0" and the "-0" options use 0x00 as separator instead of \n to avoid problems with blanks and other special characters in file names.

hth
Jan
You can make it even shorter:
Code:
find /etc -type f -name '*.orig' -delete
 
Old 12-08-2010, 03:20 PM   #4
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
Moved: This thread is more suitable in <SLACKWARE> and has been moved accordingly to help your thread/question get the exposure it deserves.
 
  


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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
source code files orig.tar.gz, .diff.gz, .dsc fakie_flip Linux - Software 3 09-27-2008 07:12 AM
hacker got into system and root cannot delete files, See my recovery process. Senza Paura Linux - Security 9 10-26-2007 12:54 PM
Delete old update files left by Yast/YOU? asmirnov SUSE / openSUSE 1 02-27-2007 09:55 PM
update config files w/o rebooting slack66 Linux - Newbie 1 05-23-2004 05:46 AM
Should I update config files when asked? DeathsCow Linux - Software 1 02-22-2004 05:13 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

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