Earlier quoted context omitted.
Also in that vein on Mac it's worth having a look at Alfred http://alfredapp.com
Alread rocks. You can develop workflows for common groups of tasks and it integrates well with iTunes, 1Password, Terminal and other system actions/apps.
Unix Commands I Wish I’d Discovered Years Earlier
121–130 of 259 posts
Re: Unix Commands I Wish I’d Discovered Years Earlier
#122Re: Unix Commands I Wish I’d Discovered Years Earlier
#123Earlier quoted context omitted.
You can turn that off with: cal | cat
can you please explain how this works?
Re: Unix Commands I Wish I’d Discovered Years Earlier
#124Re: Unix Commands I Wish I’d Discovered Years Earlier
#125Earlier quoted context omitted.
Aliasing to 'cal -3' can also be good if you want a little continuity.
The -3 arg is not available on OS X. Odd, since it's been in BSD Unix since forever. http://www.freebsd.org/cgi/man.cgi?query=cal
NetBSD has had it for 11 years. FreeBSD has had it for three years and six months. DragonFly doesn't have it, OpenBSD doesn't have it...
http://cvsweb.netbsd.org/bsdweb.cgi/src/usr.bin/cal/cal.c?re... http://svnweb.freebsd.org/base?view=revision&revision=204697
Re: Unix Commands I Wish I’d Discovered Years Earlier
#126`cd -` to go back to the previous directory. Saved me LOTS of time over the past few months.
Re: Unix Commands I Wish I’d Discovered Years Earlier
#127Re: Unix Commands I Wish I’d Discovered Years Earlier
#128Earlier quoted context omitted.
The single most useful thing about ssh to me is that it connects stdout/in across the channel (this is behavior inherited from rsh). This allows for e.g.: % (cd /foo; tar cpf - .) | ssh bar \(cd /baz\; tar xpf -\) Or: % cat ~/.ssh/id_rsa.pub | ssh bar tee -a .ssh/authorized_keys
Forgive my ignorance, but I don't know what what it means to connect "across the channel", but it sounds important. Do you know a link that explains the concept? I've failed to Google it.
tar cj $bigdir | ssh host 'tar xj'
That creates a tar.bz2 archive on your machine, sends it over ssh to the remote host, where it's unpacked. Ad hoc compressed and encrypted file transfers made easy.Re: Unix Commands I Wish I’d Discovered Years Earlier
#129Earlier quoted context omitted.
can you please explain how this works?
it's quite a common pattern in commandline apps to check if the stdout is a tty or not, and do things differently if so. So when you pipe it through `cat', it does the no-fancy-included output, much like the colouring that `ls' will apply interactively, but not when piped/redirected.
Re: Unix Commands I Wish I’d Discovered Years Earlier
#130Let's say my pwd is `/home/projects` and i want to edit `/home/projects/a_huge_sprawling_app/940j_394/lol/flight_controller.rb`
`vim **/flight_controller.rb`
opens our flight_controller.rb straight away. In terms of effort, this allows you to basically omit a `find -name` when you're in a rush to edit some damn file where the hell is it again damn we need to reevaluate this directory str...----
Double bang to re-use your last terminal entry. One great use, taking all the pain out of forgetting your sudos
`rm -rf /var/log`
rm: cannot remove `/var/log': Permission denied
`sudo !!`
All evidence of wrongdoing is now destroyed.-----
Ok, here is an awesome one for users of the ultimate cloud IDE: Vim.
In your local ~/.ssh/config:
`ForwardX11 yes`
`SendEnv WINDOWID`
In your remote server's /etc/ssh/sshd_config: `AcceptEnv WINDOWID`
In your vimrc: `set clipboard=unnamedplus`
This has the effect of seamless yank and paste between local and remote vim sessions, no need for ctrl+shift+v.I love linux.