Discussion
Loading...

Post

  • About
  • Code of conduct
  • Privacy
  • Users
  • Instances
  • About Bonfire
Nick | OneThingWell.dev
@unixroot@indieweb.social  ·  activity timestamp 2 months ago

I'm using this shell shortcut a lot - you can use Alt+. to insert the last argument from your previous command into the command you're currently typing.

#cli #shell #linux #unix

  • Copy link
  • Flag this post
  • Block
Darren Meyer :donor:
@darrenpmeyer@infosec.exchange replied  ·  activity timestamp 2 months ago
@unixroot @alcinnz you can also use `!$` in whatever place you want the last argument to the previous command to be for the current command. So you could do

```
vim a-file.txt
mv !$ ~/
```

this will edit a-file.txt and then move it to your home directory. Bash/Zsh have other ! expansions for other arguments including `!!` for the entire last command. (`sudo !!` gets typed a lot…)

  • Copy link
  • Flag this comment
  • Block
musicmatze :rust: :nixos:
@musicmatze@social.linux.pizza replied  ·  activity timestamp 2 months ago
@darrenpmeyer
@unixroot @alcinnz

Some people have

alias fuck="sudo !!"

  • Copy link
  • Flag this comment
  • Block
Log in

bonfire.cafe

A space for Bonfire maintainers and contributors to communicate

bonfire.cafe: About · Code of conduct · Privacy · Users · Instances
Bonfire social · 1.0.0-rc.3.1 no JS en
Automatic federation enabled
  • Explore
  • About
  • Members
  • Code of Conduct
Home
Login