My most used bash command is probably "sudo !!", which runs the previous command with "sudo" prepended. The book "Unix Power Tools" showed me that higher-level programming languages (Perl, Python, Ruby, etc) are not needed to accomplish most administrative tasks. Awk is incredibly useful (but also very confusing, imo).
I really like '!$' and '!:1' in bash. '!$' holds the last argument of the last command and '!:n' holds the nth argument. $ cd /big/long/path/to/this.txt Oops $ vim !$
Know Your Tools – Terminal and Bash
31–40 of 48 posts
Re: Know Your Tools – Terminal and Bash
#32The first thing I do on any bash terminal is `set -o vi`. This changes the default keybindings from emacs-like to vi-like. I find it to be a huge booster to my speed in navigating the command line. edit: Actually, something cool I learned recently is that if you put the line "set editing-mode vi" in your ~/.inputrc then vi-like editing keys are available in any program that uses readline. This includes bash and the p…
Re: Know Your Tools – Terminal and Bash
#33Very true. I have difficulties in training new recruits with UNIX. For some reason, beginners have developed an aversion to UNIX/shell scripting. I myself have started more and more of Ruby/AWK/Python, but it is always SHELL that blows me off with the sort of impact it has on the daily work. I ended up highly optimizing my work environment to replace long ssh connections with `conn prod` (will use my RSA key and conn…
I'm a relative newbie in the field, but I really love using terminal (I do all my C work for grad school in ViM), it's really essential at work, there's no faster way to do batch file processing a lot of times (especially with ffmpeg, awesome). I'm surprised people don't like terminal, I love using it. It makes me feel old school, sort of like one of those hackers in the movies. That's probably just a personal thing.…
I remember when I first started using the terminal, it was slow and confusing. You had to read the man pages for every little thing. Discovering the command you want is tough, I'd be screwed without the internet.
Now I hate when I need to take my hands of the keyboard to use the mouse. What a waste of time!
Re: Know Your Tools – Terminal and Bash
#34http://xkcd.com/1168/ ^_^
I forget where I got this from, but this is how I remember it: tar -xzf # eXtract Ze Files! EDIT: I missed chadzawistowski's similar comment below
Re: Know Your Tools – Terminal and Bash
#35Earlier quoted context omitted.
Also: Accidentally ran `cd`? Run `cd -` to return I think there are some pop/push mechanics for working directory too, but I can't find them right now.
The commands are pushd and popd, and they're bash (and zsh, and most sane shell) builtins. Pushd to get to a new directory, popd to go back to the last one on the stack.
Re: Know Your Tools – Terminal and Bash
#36This is probably misunderstanding the demographic, but why does he suggest using nano over vim?
Maybe they just prefer nano? More likely, if this is meant to be a gentle introduction to the command line, vim is a pretty scary place. Nano works much more like a "normal" text editor.
Re: Know Your Tools – Terminal and Bash
#37Actually, I think most people who use computers at work, be they writers, designers, whatever, not just programmers, would benefit from learning some bash (or batch). You can automate a lot of useful processes with a few simple scripts.
Re: Know Your Tools – Terminal and Bash
#38Words to live by.
Re: Know Your Tools – Terminal and Bash
#39http://xkcd.com/1168/ ^_^
I forget where I got this from, but this is how I remember it: tar -xzf # eXtract Ze Files! EDIT: I missed chadzawistowski's similar comment below
Re: Know Your Tools – Terminal and Bash
#40Very true. I have difficulties in training new recruits with UNIX. For some reason, beginners have developed an aversion to UNIX/shell scripting. I myself have started more and more of Ruby/AWK/Python, but it is always SHELL that blows me off with the sort of impact it has on the daily work. I ended up highly optimizing my work environment to replace long ssh connections with `conn prod` (will use my RSA key and conn…