If you want to execute the zsh last command that you ran, the easiest way would be by pressing the up arrow key on your keyboard, the last command is pulled up on your prompt and you press enter. But do you know there is another way in which you can run the previous command using a command? Simply type to exclamation marks !! - this will execute the last executed command on your Zsh shell. Let's see some examples,

As you can see, when I typed !! the previous command that was clear was executed again. In the next example, it was the who command. Also notice that when you run the double exclamation command it displays the command as text in the first line outputted and then the result of the command,
code2care@mac ~ % !!
ls -ltrh
total 0
drwxr-xr-x+ 4 code2care staff 128B Jan 2 23:03 Public
drwx------+ 4 code2care staff 128B Jan 2 23:28 Pictures
drwxr-xr-x 4 code2care staff 128B Jan 17 16:16 ClassRoom
drwx------@ 75 code2care staff 2.3K Feb 13 16:04 Library
drwx------@ 3 code2care staff 96B Feb 13 16:04 Applications
drwxr-xr-x 5 code2care staff 160B Feb 15 22:32 IdeaProjects
drwx------@ 13 code2care staff 416B Mar 6 18:01 Documents
drwx------+ 7 code2care staff 224B Mar 13 22:42 Music
drwx------ 6 code2care staff 192B Mar 20 16:54 Movies
drwx------+ 18 code2care staff 576B Apr 3 12:41 Downloads
drwx------@ 8 code2care staff 256B Apr 3 13:27 Desktop
code2care@mac ~ %
- Fix NVIDIA GeForce Experience ERROR CODE 0x0003
- How to convert byte array to String [Kotlin]
- Unzip a Zip file from Terminal Command
- How to write hello world different languages syntax
- [Error] zsh: command not found: mvn
- How to know the version of OpenSSL
- [Solution] IDEA IntelliJ System.out.println function shortcut (sysout alternative for eclipse IDE)
- The default username and password for RabbitMQ
- ChatGPT Outage: Hmm...something seems to have gone wrong. Maybe try me again in a little bit.
- How to check the version of NodeJS installed
- Gmail Unable to upload because it is a folder or a package (like an application bundle or RTFD document)
- How to remove password from pdf file
- BSNL Broadband upgrades speed to minimum 2MBps for all users 512Kbps 1Mbps
- MongoDB: Failed to connect to 127.0.0.1:27017 reason: Connection refused
- Turn off Focus Mode on Mac
- Steps to Delete or Deactivate Instagram Account
- [IRCTC] Indian railways official eRail API 1.1 for developers to get train info
- CentOS Cannot find a valid baseurl for repo base7x86_64 yum
- Why I see Download pre-built shared indexes in IntelliJ
- Copy file from a remote server to current local directory system using SCP command
- [Fix] Minecraft Error: A JNI error has occurred, please check your installation and try again
- How to install Zsh shell
- Merge multiple zip files without unzipping (extracting)
- How to find someone on Instagram
- How to get an embed code from Vimeo?
- Indent Python code in Notepad++ - Python
- How to find Sublime Text path of packages installed - Sublime-Text
- Call PHP function on Button click using jquery ajax - PHP
- SharePoint Server 2016 Preview installation error - This Product Key isn't a valid Microsoft Office 2016 Product Key. Check that you've entered it correctly. - SharePoint
- Setting up Java JUnit Project with Eclipse + Maven Example - Java
- [fix] Loading class com.mysql.jdbc.Driver is deprecated - MySQL
- [Solution] Error: brew cask is no longer a brew command - MacOS
- Java Stream flatmap() Examples - Java