Iterm man command

In my terminal Iterm, I want to know more about a command in Linux I printed

man vim

But in Mac osx it doesn’t work?

 man tail
sh: most: command not found

That’s weird. What do you get from

echo $SHELL


echo $PATH


 echo $SHELL
 ✝  echo $PATH


What about

which man


I have /usr/bin: in my path

 ✝  /usr/bin  l man
-r-xr-xr-x  1 root  wheel    68K Jul  8 22:03 man

Sure enough. It’s strange that man isn’t working, then. I can read tail’s man page just fine. Did you set up any aliases in your .zshrc file?

 /usr/bin  man
What manual page do you want?
:latin_cross:  /usr/bin  man grep
sh: most: command not found
:latin_cross:  /usr/bin 

my .zshrc I didn’t alias man

# Path to your oh-my-zsh installation.
export ZSH=/Users/mbp/.oh-my-zsh

# Set name of the theme to load.
# Look in ~/.oh-my-zsh/themes/
# Optionally, if you set this to "random", it'll load a random theme each
# time that oh-my-zsh is loaded.

# Uncomment the following line to use case-s ensitive completion.

# Uncomment the following line to use hyphen-insensitive completion. Case
# sensitive completion must be off. _ and - will be interchangeable.

# Uncomment the following line to disable bi-weekly auto-update checks.

# Uncomment the following line to change how often to auto-update (in days).
# export UPDATE_ZSH_DAYS=13

# Uncomment the following line to disable colors in ls.

# Uncomment the following line to disable auto-setting terminal title.

# Uncomment the following line to enable command auto-correction.

# Uncomment the following line to display red dots whilst waiting for completion.

# Uncomment the following line if you want to disable marking untracked files
# under VCS as dirty. This makes repository status check for large repositories
# much, much faster.

# Uncomment the following line if you want to change the command execution time
# stamp shown in the history command output.
# The optional three formats: "mm/dd/yyyy"|""|"yyyy-mm-dd"
# HIST_STAMPS="mm/dd/yyyy"

# Would you like to use another custom folder than $ZSH/custom?
# ZSH_CUSTOM=/path/to/new-custom-folder

# Which plugins would you like to load? (plugins can be found in ~/.oh-my-zsh/plugins/*)
# Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/
# Example format: plugins=(rails git textmate ruby lighthouse)
# Add wisely, as too many plugins slow down shell startup.
plugins=(git bower)

# User configuration

export PATH="/Users/mbp/.npm-packages/bin:/Users/mbp/bin:/Applications/MAMP/bin/php/php5.6.2/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/Cellar:/usr/local/bin:~/Library:/usr/local/lib:/Users/mbp/bash-wordpress:/Users/mbp/.npm/bin:/usr/sbin:/bin:/Users/mbp/arcanist/bin:/usr/bin:/usr/local/bin:/bin:/opt/X11/bin:/usr/local/git/bin:/usr/local/bin/composer"
# export MANPATH="/usr/local/man:$MANPATH"

source $ZSH/

# You may need to manually set your language environment
# export LANG=en_US.UTF-8

# Preferred editor for local and remote sessions
# if [[ -n $SSH_CONNECTION ]]; then
#   export EDITOR='vim'
# else
#   export EDITOR='mvim'
# fi

# Compilation flags
# export ARCHFLAGS="-arch x86_64"

# ssh
# export SSH_KEY_PATH="~/.ssh/dsa_id"

# Set personal aliases, overriding those provided by oh-my-zsh libs,
# plugins, and themes. Aliases can be placed here, though oh-my-zsh
# users are encouraged to define aliases within the ZSH_CUSTOM folder.
# For a full list of active aliases, run `alias`.
# Example aliases
# alias zshconfig="mate ~/.zshrc"
# alias ohmyzsh="mate ~/.oh-my-zsh"

# cd let you do a cd AND a ls in the same command
function cd {
  builtin cd "$@" && ls -Fal

extract () {
    if [ -f $1 ] ; then
      case $1 in
        *.tar.bz2)   tar xjf $1     ;;
        *.tar.gz)    tar xzf $1     ;;
        *.bz2)       bunzip2 $1     ;;
        *.rar)       unrar e $1     ;;
        *.gz)        gunzip $1      ;;
        *.tar)       tar xf $1      ;;
        *.tbz2)      tar xjf $1     ;;
        *.tgz)       tar xzf $1     ;;
        *.zip)       unzip $1       ;;
        *.Z)         uncompress $1  ;;
        *.7z)        7z x $1        ;;
        *)     echo "'$1' cannot be extracted via extract()" ;;
         echo "'$1' is not a valid file"

#Find text in any file
ft() {
  find . -name "$2" -exec grep -il "$1" {} \;

fancy-ctrl-z () {
  if [[ $#BUFFER -eq 0 ]]; then
    zle redisplay
    zle push-input
    zle clear-screen
zle -N fancy-ctrl-z
bindkey '^Z' fancy-ctrl-z

alias h="history"
alias his='$(history -p \!\!)' 
# Add and commit changes with Git
alias m="git add -A;git commit -m"
alias gc="git clone "
alias gp="git push origin master"
#alias pc="pbcopy"
alias pc="pwd | tr -d '\n' | pbcopy"
#alias pp="pbpaste"
# Show which commands you use the most
alias freq='cut -f1 -d" " ~/.bash_history | sort | uniq -c | sort -nr | head -n 30'

alias ....='cd ../../../'
alias .....='cd ../../../../'
alias ......='cd ../../../../../'
alias .2='cd ../../'
alias .3='cd ../../../'
alias .4='cd ../../../../'
alias .5='cd ../../../../../'
alias .6='cd ../../../../../../'
alias .7='cd ../../../../../../../'
alias .8='cd ../../../../../../../../'
# This alias reloads this file
alias rzsh='. ~/.zshrc'

alias c='clear'
alias cl='clear && ls'
alias cll='clear && l'
alias dir='ls -alv'
alias le='ls --sort=extension'
alias lle='ll --sort=extension'
alias lt='ls --sort=time'
alias llt='ll --sort=time'
# This alias recursively destroys all .DS_Store files in the folder I am currently in
alias killDS='find . -name .DS_Store -type f -delete'
#don't display the warning 'swapfile and backup
alias vi='vim'
alias v='vim -n'

# Softwares by alpha
alias chrome='open -a google\ chrome'
alias dropbox='open -a'
alias evernote='open -a evernote'
alias facetime='open -a'
alias firefox='open -a firefox'
alias ff='open -a firefox'
alias github='open -a GitHub\'  
alias illustrator='open -a /Applications/Adobe\ Illustrator\ CS6/Adobe\ Illustrator\'
alias iterm='open -a iTerm'  
alias itunes='open -a'  
alias ios="open -a /Applications/"
alias ivacy='open -a ivacy'  
alias karabiner='open -a' 
alias lynda='open -a'  
alias message='open -a'  
alias mamp='open -a MAMP'  
alias password='open -a'  
alias photoshop='open -a /Applications/Adobe\ Photoshop\ cs6/Adobe\ Photoshop\'
alias psd='open -a /Applications/Adobe\ Photoshop\ CS6/Adobe\ Photoshop\'
alias safari='open -a'
alias simulator="open -a /Applications/"
alias skype='open -a'  
alias slack='open -a'
alias textedit='open -a'
alias transmission='open -a transmission'
alias transmit='open -a transmit'  
alias virtualbox='open -a'
alias vlc='open -a'  

# Shortcuts
alias db="cd ~/Documents/Dropbox"
alias dl="cd ~/Downloads"
alias dt="cd ~/Desktop"
alias w="cd /Applications/MAMP/htdocs"

  #cd /Applications/MAMP/htdocs/$1

export PAGER=most

# loading the prompt
autoload -U promptinit
# list the promts
#prompt -l
#prompt elite

# Kill all the tabs in Chrome to free up memory
# [C] explained:
alias chromekill="ps ux | grep '[C]hrome Helper --type=renderer' | grep -v extension-process | tr -s ' ' | cut -d ' ' -f2 | xargs kill"

alias update='sudo softwareupdate -i -a; brew update; brew upgrade'
# Get week number
alias week='date +%V'

# Always enable colored `grep` output
# Note: `GREP_OPTIONS="--color=auto"` is deprecated, hence the alias usage.
alias grep='grep --color=auto'
alias fgrep='fgrep --color=auto'
alias egrep='egrep --color=auto'

# Recursively delete `.DS_Store` files
alias cleanup="find . -type f -name '*.DS_Store' -ls -delete"

# Flush Directory Service cache
alias flush="dscacheutil -flushcache && killall -HUP mDNSResponder"

#ip adresses
alias ip="dig +short"
alias localip="ipconfig getifaddr en0"
alias ips="ifconfig -a | grep -o 'inet6\? \(\([0-9]\+\.[0-9]\+\.[0-9]\+\.[0-9]\+\)\|[a-fA-F0-9:]\+\)' | sed -e 's/inet6* //'"

# View HTTP traffic
alias sniff="sudo ngrep -d 'en1' -t '^(GET|POST) ' 'tcp and port 80'"
alias httpdump="sudo tcpdump -i en1 -n -s 0 -w - | grep -a -o -E \"Host\: .*|GET \/.*\""
alias rd="rm -Rf"

# Empty the Trash on all mounted volumes and the main HDD.
# Also, clear Apple’s System Logs to improve shell startup speed.
# Finally, clear download history from quarantine.
alias emptytrash="sudo rm -rfv /Volumes/*/.Trashes; sudo rm -rfv ~/.Trash; sudo rm -rfv /private/var/log/asl/*.asl; sqlite3 ~/Library/Preferences/* 'delete from LSQuarantineEvent'"

function fcc() {
  gc $1 && cd $1 && npm install && grunt watch

zstyle ':completion:*' rehash true

Shot in the dark - try the same command in Mac’s Terminal instead of iTerm.

I found the problem. In your .zshrc file, you define the default pager to be most

217 export PAGER=most

Delete that and it should work just fine.

that’s weird I didn’t remember to do that :confused:
You save my day :slight_smile:

I have question about a function I add:

function babel() {
  gc $1 && cd $1 && npm install && grunt watch

that’s clone the repo “gc” with the alias but it’s never ask me to typing the variable $1?

In bash, function parameters are defined by their position, so you’d call

babel myNewProject

which would expand to

gc myNewProject && cd myNewProject && npm install && grunt watch

If you tried

babel myNewProject useless parameters are ignored

then the function would have 5 variables, $1, $2, $3, $4, and $5. Since you only use $1, the rest would be ignored.

1 Like

I forgot this :confused:
I read about it last year…
Thank again

Do you know how can have some color in Less?

Not off the top of my head, but that’s a good question. I’d have to Google it.