实用Linux命令行 —— 进制的转换

来源:互联网 发布:让2g网络变4g网络 编辑:程序博客网 时间:2024/05/05 00:23

工作中进制的转换问题

1. 你还用windows calc.exe???

OH! My God! 千万别用了,太不优雅了。

这里写图片描述

2 优雅的Linux命令行 “bc“

不解释,看这里:

bc –help

XXXXX@XXXX:~/code/shellcode/03_reverse_tcp_shell_with_password$ bc --helpusage: bc [options] [file ...]  -h  --help         print this usage and exit  -i  --interactive  force interactive mode  -l  --mathlib      use the predefined math routines  -q  --quiet        don't print initial banner  -s  --standard     non-standard bc constructs are errors  -w  --warn         warn about non-standard bc constructs  -v  --version      print version information and exit

十进制转十六进制

river@RiverPc:~/code/shellcode/03_reverse_tcp_shell_with_password$ bcbc 1.06.95Copyright 1991-1994, 1997, 1998, 2000, 2004, 2006 Free Software Foundation, Inc.This is free software with ABSOLUTELY NO WARRANTY.For details type `warranty'. ibase=10obase=164129

ibase设置输入的进制形式,obase设置输出的进制形式

其他一些转换

obase10ibaseAibase=16obase=2AAA101010101010ibase=8obase=101231238877

直接输入ibase查看当前的输入进制状态,obase查看输出的进制状态。

0 0
原创粉丝点击