Bash and zsh support a surprising amount of emacs editing functionality. Cursor navigation (M-b, M-f, C-a, C-e), text selection (C-space), copy/paste (C-w, M-w, C-y, M-y), and undo (C-_).
Unix tricks
41–50 of 232 posts
Re: Unix tricks
#42tar czf - . | ssh destination "tar xz" To pipe all the contents of your current directory (including dotfiles) to the destination machine. Greetings from LSI-UPC!
Re: Unix tricks
#43Re: Unix tricks
#44 find . -type d -exec chmod g+x {} \;'
you can usually use chmod -R g+X .
which gives additionally the group execute permission to files which have already user/everyone execute permission.Re: Unix tricks
#45 'find . -type d -exec chmod g+x {} \;'
If you happen to have a malicious directory named (without double quotes): ".;sudo rm -rf /"
You'd be stuffed.It's better practice to use the '-print0' flag of find(1) and pipe the result into xargs(1) with the '-0' flag set. For safety, it's best to also use '-r #' for expected number of arguments, '-n' to stop xargs from running without arguments, and "-J %" so you can use quoting.
find . -type d -print0 | xargs -0 -n -r 1 -J % chmod g+x "%"
I believe some on implementations '-n' is unnecessary when '-r #' is
specified, but on other implementations it's is the maximum.EDIT: thanks for the vim tip on for finding spelling mistakes!
Re: Unix tricks
#46tar czf - . | ssh destination "tar xz" To pipe all the contents of your current directory (including dotfiles) to the destination machine. Greetings from LSI-UPC!
tar czf - . | ssh destination "cd /remote/dir; tar xz"
Re: Unix tricks
#47Re: Unix tricks
#48The special bash command I'm most often asked about by shoulder surfers is !$. It substitutes the last argument in the previous command into the current one. For example: $ ls /some/long/path/somewhere/looking/around/ $ cd !$ cd /some/long/path/somewhere/looking/around/
Re: Unix tricks
#49To my surprise, this also works with git:
git checkout - # to checkout the previous branchRe: Unix tricks
#50Earlier quoted context omitted.
NFS has 2 mount types, soft and hard. http://tldp.org/HOWTO/NFS-HOWTO/client.html Soft mounts report errors immediately, hard mounts hang. And for permissions, NFS provides everything under the sun that you could possibly need via ACLs. NFSv4 is a very modern protocol, much as SMBv2 is (not SMB though, it's awful). Linux has had NFSv4 for what, 6 years now, at least, and even v2 and v3 had some limited ACL support? h…
That's nice to know, it seems that we have the "hard" configuration at the lab and it's a real pain. Backwards compatibility, you know. For my mini-cluster we use SMB and couldn't be happier.