Escaping those commands…

If you work like me, editing & moving files constantly between two users on the same linux box, you know that copying files from one home directory to another is hell! Specially because each time you have to switch to root, copy & then chown it to the new user!

I’ve got a better idea…
1) Open /etc/hosts file & add a very short name for your localhost, like “a” or “b” or something small.
2) Now when you want to copy, use scp [to localhost] instead of cp. It will automatically do the things for you :)

Though there might be other *smart* hacks to do this, i’m pretty content with this one.

No related posts.

Related posts brought to you by Yet Another Related Posts Plugin.

  • http://www.vishal-tech.co.uk vishal

    cool hack

  • http://makuchaku.in makuchaku

    vishal, what did you used to do in such a situation? I’m pretty sure you must have faced such a thing when you work on your servers?

  • http://www.vishal-tech.co.uk vishal

    i dont do anything else then dance man :P i created another user (normal user ) which i use to do these things it has some rights like instead of using root account for everything i use this account so need not tochange permissions everytime i do some copying or creating something new

  • http://makuchaku.in makuchaku

    Hmm…

  • http://rockybhai.blogspot.com rocky

    Nice hack, Well i never worked with two users, But aren`t users in same group have read permission to the FIles.

  • Kai

    You don’t even need to alter /etc/hosts. “0” is one of the default aliases for “localhost”.

  • http://makuchaku.in makuchaku

    Oh wow!

    Thanks.