Friday, May 17, 2024
4
rated 0 times [  4] [ 0]  / answers: 1 / hits: 5031  / 3 Years ago, wed, november 17, 2021, 2:55:08

When reading the content of a script, I found something like:



echo "An Example" > !$


So I wonder what does !$ mean in bash .


More From » command-line

 Answers
2

Well i found that !$ means last argument so for an example :



touch /tmp/file1


Here the argument is /tmp/file1 , so !$ replaced /tmp/file1 in echo example .



If then you type the command du -b !$ , the output will be the disk usage in bytes for /tmp/file1


[#24192] Friday, November 19, 2021, 3 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
ainubt

Total Points: 496
Total Questions: 98
Total Answers: 126

Location: Sao Tome and Principe
Member since Wed, Dec 21, 2022
1 Year ago
;