---
title: "Back up a file with same name + prefix"
description: "NOTE: Actually you can use !#:1 in every command 'cause that's last argument passed to a command."
canonical: https://oozou.com/til/back-up-a-file-with-same-name-prefix-42
locale: en
date: 2020-10-13
topic: shell
---

# Back up a file with same name + prefix

> NOTE: Actually you can use !#:1 in every command 'cause that's last argument passed to a command.

Published: 2020-10-13 · Topic: [shell](https://oozou.com/til-topics/shell) ([markdown](https://oozou.com/til-topics/shell.md))

```shell
$ cp todo.txt !#:1.bak
cp todo.txt todo.txt.bak
```

NOTE: Actually you can use *!#:1* in every command 'cause that's last argument passed to a command.

UPDATED: Now it works with zsh

---

Contact OOZOU: hello@oozou.com · +66 2544 0000 · https://oozou.com/contact

More for AI agents: https://oozou.com/llms.txt · every page has a markdown twin at its URL plus ".md"
