AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |
Back to Blog
Command line decode base6412/3/2023 ![]() When decoding, the input may contain newlines in addition to the bytes of The data are encoded as described for the base64 alphabet in RFC 4648. version output version information and exit w, -wrap=COLS wrap encoded lines after COLS character (default 76). i, -ignore-garbage when decoding, ignore non-alphabet characters Mandatory arguments to long options are mandatory for short options too. With no FILE, or when FILE is -, read standard input. base64 -helpīase64 encode or decode FILE, or standard input, to standard output. You can also check all the options available with base64 command using base64 -help command. echo "SGksIFRoaXMgaXMgZnJvbSBDeWJlcklUSHViCg=" | base64 -decode -i If you want to ignore Non-Alphabet Characters during decoding then you need to use -i option with base64 utility as shown below. There is NO WARRANTY, to the extent permitted by law.Įxample 6: How to Ignore Non-Alphabet Characters This is free software: you are free to change and redistribute it. License GPLv3+: GNU GPL version 3 or later. ![]() ![]() base64 -versionĬopyright (C) 2018 Free Software Foundation, Inc. As you can see from the below output, current version is 8.30. If you want to check the current installed version of base64 utility then you need to use base64 -version command. echo "SGksIFRoaXMgaXMgZnJvbSBDeWJlcklUSHViCg=" | base64 -decode Similarly, if you have sent any file or stored it somewhere in encoded format and now you are looking to decode it back to the original data then you need to pass the encoded data to base64 utility as shown below. echo Y3liZXJpdGh1Yi5jb20K | base64 -decodeĮxample 4: How to do base64 Decoding of a File Data You will be able to see the original data on the output. If you have sent the data or stored it somewhere in encoded format and now you want to decode it back to the original data then you need to pass that encoded data to base64 utility with -decode option enabled as shown below. base64 example.txtĮxample 3: How to do base64 Decoding of Data You just need to use base64 example.txt command to encode the contents of example.txt file as shown below. If you have a text file with some data like below then you can pass this file as an argument to base64 utility to encode the contents. echo "" | base64Įxample 2: How to do base64 Encoding of a File Data If you have some sample data to encode then you can pass it to base64 utility using echo "" | base64 command and get the encoded output as shown below. How to Perform base64 Encoding and Decoding Using Linux Command LineĪlso Read: How to Password Protect GRUB Boot Loader in Ubuntu 20.04 LTS Example 1: How to do base64 Encoding of Data We will see some real world examples to perform base64 Encoding and decoding in below section. At the receiving end, it can then be decoded back to the original data. Base64 encoding are mostly used to encode data into ASCII format so that it can be stored or transferred very easily. In this article, I will take you through different examples to perform base64 Encoding and Decoding Using Linux Command Line but before that let me ask you a quick question - Do you know where exactly base64 encoding and decoding is required ? Well, the first and foremost thing you need to understand is that encoding and decoding is not the same as encryption and decryption.
0 Comments
Read More
Leave a Reply. |