Command-line Editing On Mon, 30 Apr 2001, Gareth Jones wrote: > Would appreciate any thips on command line type stuff. I know there's > a ^ type thingy too but can't remember how to use it. I'm sure there's > others too. Uh. right. Big topic First point: RTFM. Print out the bash man page, and then leave it in your toilet. Seriously. Read bits of it whenever you're taking a busying yourself in the littlest room, and I can assure you you'll learn more than you could possibly imagine. I have been there, done that. Anyway. For a start, $ command param1 runs command with param1, yes? [I know, I know...] $ ^param1^nipples runs the previous command with "param1" replaced with "nipples" Only the first instance of the command, though... so, for example, $ command param param then $ ^param^nipples will run $ command nipples param You've got a command !! which just runs the last command again. !-n runs the nth last command. Will be a mindfuck. You can find out old commands with "history", and grep will come in useful. ctrl+r is your friend. Also, there's a !command which is where it runs the last instance of "command" that you typed, eg: $ ls /something $ !ls ls /something Hmmm. And that's about it. Wait. Actually, it's not even close. When you're looking for a command you /know/ you've typed, you can try: "history | grep whatever-I'm-looking-for " And use screen's copy'n'paste functions to copy'n'paste it. If you know to look for a command you've typed reasonably recently, just hit ctrl+r, then start typing in any part of the command you're looking for. It'll search for the most recent match for whatever you are typing in - keep going until it's unique. Usually, this won't take more than a few letters...