896 links
  • Links Lounge
  • Home
  • Login
  • RSS Feed
  • Tag cloud
  • Picture wall
  • Daily
Links per page: 20 50 100
page 1 / 1
  • Terminal (Bash) arguments tricks - Jordi Boggiano

    Gah !

    # !$ references the last argument of the previous command.
    mate _posts/2011/2011-04-12-terminal-strings.mdown
    git add !$
    tumblr !$
    
    # Now more complex, let's copy the second argument
    # !! references the last command, and :2 the second arg. 
    echo foo bar baz
    echo !!:2 # outputs "bar"
    
    # Batshit crazy
    # !?baz? references the last command containing baz, :0-1 grabs the two first args
    echo !?baz?:0-1 # should output "echo foo"
    Tue 09 Aug 2016 09:22:22 AM CEST - permalink -
    - - - https://seld.be/notes/terminal-arguments-tricks
    CommandLine Linux Shell
Links per page: 20 50 100
page 1 / 1
Shaarli - The personal, minimalist, super-fast, no-database delicious clone by the Shaarli community - Help/documentation