Files
mkdocs/docs/macos/terminal/terminal.md
2020-01-25 06:47:22 +01:00

1.3 KiB

Terminal

Ouvrir une page man dans un fenêtre spécifique:
$ open x-man-page://ls

# fonction:
function xmanpage() { open x-man-page://$@ ; }
Ouvrir une page man dans Aperçu:
$ man -t ls | open -f -a "Preview"

# fonction:
function preman() { man -t "$@" | open -f -a "Preview" ;}
Obtenir le chemin de la fenêtre courante du Finder:
$ osascript -e 'tell app "Finder" to get posix path of ((target of window 1) as alias)'
/Users/bruno/.kymsu/plugins.d/
# fonction:
# prints the path of the front Finder window. Desktop if no window open
function pwdf () {
    osascript <<EOS
        tell application "Finder"
            if (count of Finder windows) is 0 then
                set dir to (desktop as alias)
            else
                set dir to ((target of Finder window 1) as alias)
            end if
            return POSIX path of dir
        end tell
EOS
}

# changes directory to frontmost Finder window
alias cdf='pwdf; cd "$(pwdf)"'

Raccourcis:

Aller en début de ligne: CTRL+A

Aller en fin de ligne: CTRL+E

Déplacer le curseur: OPTION+clic

Supprimer du curseur jusqu'à la fin de ligne: CTRL+K

Coller les texte supprimer: CTRL+Y

Supprimer le mot précédent: CTRL+W

Rechercher dans l'historique: CTRL+R