LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 06-16-2009, 01:44 AM   #1
Anfield_84
LQ Newbie
 
Registered: Jun 2009
Posts: 4

Rep: Reputation: 0
Copying the /proc directory


Hey guys, I'm a first time poster so go easy on me =P

What is the most simplest way to copy the proc directory to a flash/portable hard drive? I don't want to go in to too much detail, but i basically want to be able to view these files whenever i want, wherever i am.

Any help would be greatly appreciated =)
 
Old 06-16-2009, 02:24 AM   #2
sonnik
Member
 
Registered: May 2001
Posts: 149

Rep: Reputation: 17
/proc is mostly "special" files, and a copy like you may be thinking of may not be what you want.

For example, in my proc directory right now, the "2756" directory contains information about the Firefox process I'm using to post this message.

Code:
ls -l /proc/2756/fd
Provides information about file sockets currently in use by Firefox.

This information changes from session to session of course.

Unfortunately, you'll need to provide the details on what you're trying to accomplish.
 
Old 06-16-2009, 02:42 AM   #3
Anfield_84
LQ Newbie
 
Registered: Jun 2009
Posts: 4

Original Poster
Rep: Reputation: 0
Thanks for your reply sonnik,

Basically i want to be able to save these files and then upload them to a network where everyone can view them. I know they are per session as you already said, but some obviously don't change such as meminfo and cpuinfo.
 
Old 06-16-2009, 02:46 AM   #4
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 15,049

Rep: Reputation: 1915Reputation: 1915Reputation: 1915Reputation: 1915Reputation: 1915Reputation: 1915Reputation: 1915Reputation: 1915Reputation: 1915Reputation: 1915Reputation: 1915
If you can read it, you can copy (cp) it. With /proc, being a pseudo filesystem, there are a lot of "files" you can't read, a lot it makes no sense to read, and a few you wouldn't really want to.

Pick a sensible subset and copy those.

Edit: seems our posts crossed in flight.

Last edited by syg00; 06-16-2009 at 02:47 AM.
 
Old 06-16-2009, 02:52 AM   #5
Anfield_84
LQ Newbie
 
Registered: Jun 2009
Posts: 4

Original Poster
Rep: Reputation: 0
Haha that's ok. I've tried a cp but i keep getting messages saying that some files are being omitted, however i believe those could be for the current running processes. Ill give it another try on particular files individually that I'll require and see how i go from there.

Thank you for your help sonnik!
 
Old 06-16-2009, 02:56 AM   #6
sonnik
Member
 
Registered: May 2001
Posts: 149

Rep: Reputation: 17
sounds like you may be trying to copy as a regular user ... You'll need root privs for this...

Code:
cd /my/path/to/copy/to
cp -r /proc/* .
Please post here if I'm misunderstanding. You can of course send this to a tar.gz if you like as well.
 
Old 06-16-2009, 03:23 AM   #7
BeacoN
Member
 
Registered: Nov 2008
Distribution: Linux Mint
Posts: 56

Rep: Reputation: 17
copying proc dir

I'm guessing you don't want the process info. I'd use the blessed find command. perhaps just grabbing the files will work (processes are in directories)
try...

find /proc -type f -exec cp -iv '{}' */media/put/here* \;

and of course write the dir where to go in *...* above.
 
Old 06-16-2009, 03:25 AM   #8
Anfield_84
LQ Newbie
 
Registered: Jun 2009
Posts: 4

Original Poster
Rep: Reputation: 0
Thank you to everyone for their replies, I'll make sure to give these all a try =)
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
copying files to /proc/bus/usb ic_torres Linux - Newbie 8 10-09-2007 07:56 AM
Copying a single file into each directory of a directory tree mlapl1 Linux - Newbie 2 06-27-2007 11:18 PM
Copying a Directory into Another Directory with Subdirectories oadvantage Linux - Newbie 4 03-06-2006 06:27 PM
Automatically Copying files from the ftp directory into the html directory swatward Linux - General 3 04-17-2005 11:55 PM
/proc directory robeb Linux - General 4 06-04-2002 02:34 AM


All times are GMT -5. The time now is 02:16 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration