LinuxQuestions.org
Review your favorite Linux distribution.
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 12-11-2015, 01:55 AM   #1
rng
Senior Member
 
Registered: Aug 2011
Posts: 1,198

Rep: Reputation: 47
How to make cpio extract to a folder


To extract an rpm package, following command can be used:

Code:
rpm2cpio packagename.rpm | cpio -idvm
But it extracts to the current folder. Can it be made to extract in a specified folder, eg /home/a_user/mypkg? Following command does not work:

Code:
rpm2cpio packagename.rpm | cpio -idvm /home/a_user/mypkg
Thanks for your help.
 
Old 12-11-2015, 03:00 AM   #2
berndbausch
LQ Addict
 
Registered: Nov 2013
Location: Tokyo
Distribution: Mostly Ubuntu and Centos
Posts: 6,316

Rep: Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002
It seems it doesn't have this option (you should read the man page....), but you can easily overcome this by issuing a cd command to go to the target directory, and a cd - command to go back where you came from.
 
  


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
Extracting the contents of a folder in a CPIO archive to another folder Refractor Linux - Software 4 07-10-2012 05:12 PM
CPIO extract error ramnath Linux - Software 2 06-02-2011 10:22 AM
Extract cpio.gz file iqbal mohd Red Hat 3 07-16-2010 11:16 PM
How to use cpio to extract a cpio archive? linx win Debian 4 06-17-2005 01:53 PM
CPIO will not extract File stress Linux - Software 2 07-22-2004 01:04 AM

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

All times are GMT -5. The time now is 01:34 AM.

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