• About My website
  • Search

Amit Agarwal Linux Blog

bash – refer the first parameter from last command quickly

2014-09-22 1 min read Bash

To refer to first parameter from the last command quickly, you can use

!^

Note: This can also be referred as “!!:1“

Back-Reference Bash Shell Shell Scripting

bash refer parameters from the current command

2014-09-15 1 min read Bash

In bash you can use

!#

to refer to any parameter from the current command, example:

mv ak amit.!#:1.txt
ls amit.ak.txt
Back-Reference Bash Shell Shell Script Variables
Latest posts
  • Mobile_App_Mindmap
  • Check Price and Token Limits in ZapGPT with OpenAI Provider
  • How to Use AI to Create Commit Messages with ZapGPT
  • Working with Gzip Files in Linux: Seamless Integration with Popular Tools
  • Exploring AI Models with ZapGPT: A Simplified Approach
  • Don’t Enter Your Password Into That Website: A Rant You Need to Hear
  • How Vim Can Make a Hacker’s Life Easier with Macros and Registers
Categories
  • Linux (529)
  • Fedora (343)
  • Bash (215)
  • Uncategorized (191)
  • Learning (156)
  • Photo (76)
  • Vim Tips (37)
Social media
© 2018 - 2025 by Amit Agarwal - rss
Bilberry Hugo Theme