### Start typing a command, say "nm", $ nm # Realize you've done this before, so just press up arrow $ nm /usr/bin/wine # Bash completes from history ignoring anything not starting with "nm" ### Not the one you wanted? Just keep hitting up arrow until you find the one you want. $ nm /usr/bin/wineserver ### Hit down arrow to go back. $ nm /usr/bin/wine # This is like normal up and down arrows but taking first characters into account. ### Need to be more specific? Note that the cursor is still after the "nm" that we typed at first, so if we hit "a" it shows this: $ nma /usr/bin/wineserver ### ...but then, another press of up/down arrows and, voila, we get: $ nmap -sUT -p- localhost ### Just go ahead and hit enter (you don't need to be at the end of the line) and it runs: Starting Nmap 7.21 ( http://nmap.org ) at 2020-02-29 09:20 XGT Interesting ports on localhost (127.0.0.1): Not shown: 131045 closed ports PORT STATE SERVICE 22/tcp open ssh [bla, bla....]
Any thoughts on this command? Does it work on your machine? Can you do the same thing with only 14 characters?
You must be signed in to comment.
commandlinefu.com is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.
Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.
» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10
Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):
Subscribe to the feed for: