what is the command for man open(2)?
when using
man open
I get the description of OPENVT(1).
Thanks!
Try man 2 open. This will look for open in section 2 of the manual.
Related
Zsh
MAC 11.4
I am writing an alias that opens two new Terminals and runs a script in each.
The command for opening a new terminal I have found to work is:
open -a Terminal -n; *program*
I am trying to locate the docs on this command to better understand what '-a' and '-n' mean and how I can use it better, but am unsure of where to look? Is it built in Zsh, applescript, etc???
Thanks in advance
man shows the manual pages of a command.
The syntax is man open. You can even do man man with this result.
NAME
man - format and display the on-line manual pages
SYNOPSIS
man [-acdfFhkKtwW] [--path] [-m system] [-p string] [-C config_file] [-M pathlist] [-P pager] [-B browser] [-H htmlpager] [-S section_list] [section] name ...
DESCRIPTION
man formats and displays the on-line manual pages. If you specify section, man only looks in that section of the manual. name is normally the name of the manual page, which
is typically the name of a command, function, or file. However, if name contains a slash (/) then man interprets it as a file specification, so that you can do man ./foo.5
or even man /cd/foo/bar.1.gz.
See below for a description of where man looks for the manual page files.
I see many times flags such as if [-n ${Parameter}] or echo -n <string>. Sometimes, I have seen flags like -r and others used. However, I don't know how to search for the meaning of these flags on web. Could someone send me some link where I can understand as to what they mean or some general note as to how should I search for them on google? Thanks!
You can of course check the doc on internet https://ss64.com/bash/if.html
Or if you have access to a linux or mac machine, just check out the installed doc !
Try man if for example.
Also, man could have multiple pages for the same query, for example man open will show the manual of openvt on my machine and is a command line executable. But writting man 2 open gives you the manual of the C open function.
So by default man gives you manual of bash/command line and then C function.
So man open could be written man 1 open
This is really useful if you don't have an internet access or if the version of the tools that you want to use is different from the "normal" one. I think about sed for example, that is different from linux and mac. So they has different manual.
Of course there is a man of man ... :)
man man
I forgot to talk about help, most (and decent) program has the -h or/and --help. Most of the time the manual page shows much more information.
The popular man package on Linux seemingly comes as two components, a binary and a database. The binary is the code that executes man commands and the database contains the manual pages for the man command to serve.
With a fairly basic install of Windows 10 and Git Bash for Windows how can I install the man binary and the manual pages for the Git Bash commands which appear to be here.
The goal being the ability to run man curl, man bash or man git and things Just Work.
On git bash you can use Command-name --help insted of the man command-name
(from Git: man command don't work)
If I use man command just in Terminal, it works well.
However, under tmux, it will print out No manual entry for any command. For example:
$man find
No manual entry for find
Any idea? Thanks in advance.
Found out that $MANPATH is different under tmux. It misses some paths like /usr/share/man.
Change $MANPATH under tmux will work.
I've got this neat little function to open man pages in the Preview.app in my bash profile
pman() {
man -t $# | open -f -a /Applications/Preview.app
}
and I want to use it in my zshrc but it doesn't work does anybody know how to fix it? Preview.app still opens but it ask which file to preview and not like in bash which opens the man page.
Thanks in advance