Forrest logo
back to the echo tool

echo:ai:292ff

Converts 1G and 1K into numbers (1024 and 1) using awk and shell commands
$ echo '1G 1K' | tr 'GK' ' ' | awk '{print $1 * 1024}' | tr '\n' ' '
try on your machine

Converts 1G and 1K into numbers (1024 and 1) using awk and shell commands

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.

Questions that are answered by this command:

  • how can I convert 1G or 1K into numbers using a commandline tool exept numfmt in macos?
back to the echo tool