commandlinefu.com is the place to record those command-line gems that you return to again and again.
You can sign-in using OpenID credentials, or register a traditional username and password.
Subscribe to the feed for:
This is useful when you want to copy a file and also force a user, a group and a mode for that file.
Note: if you want to move that file instead of copying it, you can use
install -o user -g group -m 755 /path/to/file /path/to/dir/ && rm -f /path/to/file
which will remove the file only if the install command went fine.
There is 1 alternative - vote for the best!
If you can do better, submit your command here.
You must be signed in to comment.