Re:A great list of command-line tips
by avar on Sunday April 15, 2012 @03:29PM
(#3844448)
The #1 thing that'll improve most people's workflow is learning how to use readline effectively. I'm continually amazed by how many people who use shells daily use the arrow keys to navigate around, don't know about common things like C-r to reverse-search through history and other commands that make editing on the command-line a breeze.
Re:A great list of command-line tips
by thirdhaf on Sunday April 15, 2012 @03:53PM
(#3844516)
In aid of helping others along this path, here's a crib sheet I've found for readline shortcuts. I've been meaning to become more efficient in using bash and this might just be the push I need.
http://www.bigsmoke.us/readline/shortcuts
Re:A great list of command-line tips
by avar on Sunday April 15, 2012 @04:09PM
(#3844573)
Thanks. That's an excellent reference. I've been pointing people towards the relevant section in the readline or bash manuals, but this is much better.
Re:A great list of command-line tips
by thirdhaf on Sunday April 15, 2012 @05:31PM
(#3844838)
I've honestly tried to use the man pages for bash before, they are unarguably complete but unfortunately difficult to get started with. The chances of me knowing ahead of time to either search first for "readline" followed "Commands for Moving" or read the full man page until I get to line 2957 is slim.
Re:A great list of command-line tips
by vog on Sunday April 15, 2012 @09:36AM
(#3843660)
> Next time you are using your shell, try typing ctrl-x e [...]. The shell will take what you've written on the command line thus far and paste it into the editor specified by $EDITOR.
Re:A great list of command-line tips
by Aethaeryn on Sunday April 15, 2012 @01:33PM
(#3844145)
This is almost a useful resource, but there are many bashisms on the list! Its utility is kind of limited for those of us who use a different shell when they don't have some sort of standardized "this only works in bash" warning.
Re:A great list of command-line tips
by chimeracoder on Sunday April 15, 2012 @01:41PM
(#3844162)
I have the opposite complaint: I'm using bash, but thinks like mtr aren't part of coreutils, so I think of them as just separate programs that happen to work at the command-line. I could just as easily list ttyter as a command-line 'tool' for tweeting from the command line.
I don't really have a solution to this, because at the end of the day, the goal is to do more things at the command line, but it'd be nice to have a way to distinguish between features of the shell, features of the OS, and non-OS programs that have command-line interfaces. Even if I'm interested in all three, it's nice to know that 'sudo !!' can be expected to work machines than mtr, for example.
Re:A great list of command-line tips
by secoif on Sunday April 15, 2012 @12:48PM
(#3844045)
I love the autojump, but it's not exactly using a built-in *nix tool like most of these are. Would love to see more people open their eyes to how awesome autojump really is. Using cd to change directories is so broken.
Re:A great list of command-line tips
by K2h on Sunday April 15, 2012 @12:14PM
(#3843964)
On win7 I found forfiles command the other day that allows me to do a dir with a date restriction. By using the > redirect to output to file I got a list of files that changed in a certain time.
I have to give Peteris Krumins credit for creating some great references like http://www.catonmat.net/blog/the-definitive-guide-to-bash-co... and http://www.catonmat.net/blog/bash-vi-editing-mode-cheat-shee... (or for the depraved, http://www.catonmat.net/blog/bash-emacs-editing-mode-cheat-s...)
I'm astonished this works in bash but not in zsh.
I don't really have a solution to this, because at the end of the day, the goal is to do more things at the command line, but it'd be nice to have a way to distinguish between features of the shell, features of the OS, and non-OS programs that have command-line interfaces. Even if I'm interested in all three, it's nice to know that 'sudo !!' can be expected to work machines than mtr, for example.
http://technet.microsoft.com/en-us/library/cc772390(v=ws.10)...
https://github.com/samirahmed/fu
Put it in your .bash_profile file in your home directory on OSX, or your .bashrc file on Linux.
Simply type 'fu' on the command line to jog your memory!