Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Useful tip, on linux (not sure about other *nixes) you can view the ascii table by opening its manpage:

  man ascii
It's been useful to me more than once every year, mostly to know about shell escape codes and when doing weird character ranges in regex and C.

It can be a bit confusing, but the gist is that you have 2 chars being show in each line, I would prefer a view where you see the same char with shift and/or ctrl flags, but you can only ask so much



The reason I know this is because in 2004 I was squatting in an apartment with no TV and no internet. So each day after work I would go home and just read manpages for fun.

Ended up learning ipfw through the firewall manpage on FreeBSD, and using my skills to setup and manage an IPFW at work.

It's amazing how much you get done with no TV and no internet. Also played a lot of nethack.


I learned vim proper by reading :help on an eeepc while flying back and forth over the Atlantic alone one year.


Damn, thanks!

Why the hell did I never try this? Maybe because typing ascii table into my favorite search engine and clicking one of the first links was fast enough


I used to do that until the experience became degraded enough, reflecting the general state of the web, that I took the time to look for a better way and found `man ascii`.


Or even simpler use the ascii command, when installed: https://packages.debian.org/bookworm/ascii


> not sure about other *nixes

Should be available on any UNIX, it was added to V7 UNIX back in the 1970s: https://github.com/dspinellis/unix-history-repo/blob/Researc...

Even before that, it existed as a standalone text file https://github.com/dspinellis/unix-history-repo/blob/8cf2a84... This still exists on many systems -- for instance as /usr/share/misc/ascii on MacOS


Similar in FreeBSD. It has octal, hex, decimal, and binary ASCII tables, along with the full names of the control characters.


strange: on MacOS 14.5 I get output for `man ascii` but `ascii` goes "command not found"


On my Linux VM, it's the same, and it's because 'man ascii' comes from man(7), not man(1). It's not a man page for a program. It's just a man page.


Not sure why anyone would downvote your comment, because it is a genuine question

`man` is basically manual documentation on anything on your system, not only commands. Most commands do have a manpage for them, but it is not a requirement. The argument of the command is just the file name for the document


Indeed `man ascii` (on MacOS but the same for Linux for the most part) shows the manpage for 'ASCII(7)' - the '7' denotes the section of the manual the manpage is from. If you use `man man`, you can see the section numbers and names, e.g. Section 1 General Commands, 5 File Formats, 7 Misc Info, 8 System Manager's Manual. If a word, e.g. 'crontab', has multiple entries in different sections, then you might have to specify the section you want, e.g.`man crontab` shows the crontab(1) (General Command) and use `man -s 5 crontab` to see the crontab(5) (File Format). `apropos crontab` will show entries related to crontab, i.e. cron(8), crontab(1), and crontab(5).


Works on mac




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: