January 12, 2008

Another nice trick on my Unix machine

My computer had a problem. I could only mount the root and tmp partitions as read-only. But I had to copy the output of a command from my computer to another computer. I would usually run the command with the output redirected to a temporary file. Then I will scp that temporary file to whatever machine the file has to be transfered to. Since the hard disk was mounted as read-only, I could not create a temporary file with the command's output. So, I ran the command (dpkg --get-selections) as follows:
dkpg --get-selections | ssh server 'cat >~/package.txt'
This saved the output of dpkg command on the machine server. Cool, no? :) PS: I am writing this down here because I don't want to forget this and reinvent the same trick again. When I need it sometime later, I can just a do a Google Search and find this :-)

No comments:

Post a Comment