MENU
  • このブログに関して
  • 特集アーカイブ
    • Windows更新情報
    • Windows11使いこなし
    • Windows 10使いこなし
    • macOS/iOS/iPadOS更新情報
    • macOS使いこなし
    • iOS使いこなし
    • Webブラウザ更新情報
  • ソフトウェア
  • Windows
  • Mac
  • iOS
  • セール
PCやMacの性能を100%発揮
ソフトアンテナ
  • このブログに関して
  • 特集アーカイブ
    • Windows更新情報
    • Windows11使いこなし
    • Windows 10使いこなし
    • macOS/iOS/iPadOS更新情報
    • macOS使いこなし
    • iOS使いこなし
    • Webブラウザ更新情報
  • ソフトウェア
  • Windows
  • Mac
  • iOS
  • セール
ソフトアンテナ
  • このブログに関して
  • 特集アーカイブ
    • Windows更新情報
    • Windows11使いこなし
    • Windows 10使いこなし
    • macOS/iOS/iPadOS更新情報
    • macOS使いこなし
    • iOS使いこなし
    • Webブラウザ更新情報
  • ソフトウェア
  • Windows
  • Mac
  • iOS
  • セール
  1. ホーム
  2. Tips
  3. macOSでターミナルからChromeやFinderを起動する方法

macOSでターミナルからChromeやFinderを起動する方法

2022 11/29
Tips
2022年11月29日 2022年11月29日
  • URLをコピーしました!

S 20221128 202708

macOSはGUIアプリが充実しているだけではなく、UNIX系のOSとして、ターミナルの使い勝手が良い事も魅力の一つです。

このため、普段からターミナルを使って作業している方のなかには、ChromeやFinderなどのアプリを起動するために、ターミナルから離れなければならいのが面倒だと思っている方もいるかもしれません。

実はこれらのアプリはターミナルの内部からコマンドを打ち込んで簡単に実行することができるのです。

以下具体的な方法を説明します。

目次

openコマンドを使おう

ターミナルからアプリを起動するには「open」コマンドを使用します。「open -a "アプリ名"」でアプリを起動することができます。

Google Chromeを起動する場合:

open -a "google chrome.app"

Firefoxを起動する場合:

open -a firefox.app

アプリの名前はアプリケーションフォルダの中を調べればわかります(大文字小文字は無視しても起動できるようです)。

Finderを起動したい場合「open フォルダ名」を実行します。

Finderを起動(~/tmpを表示):

open ~/tmp

Finderを起動(カレントフォルダを表示):

open .

すると指定したフォルダを表示した状態でFinderが起動します。

S 20221128 202806

openには以下のオプションが存在します。

$ open
Usage: open [-e] [-t] [-f] [-W] [-R] [-n] [-g] [-h] [-s ][-b ] [-a ] [-u URL] [filenames] [--args arguments]
Help: Open opens files from a shell.
      By default, opens each file using the default application for that file.
      If the file is in the form of a URL, the file will be opened as a URL.
Options:
      -a                    Opens with the specified application.
      -b                    Opens with the specified application bundle identifier.
      -e                    Opens with TextEdit.
      -t                    Opens with default text editor.
      -f                    Reads input from standard input and opens with TextEdit.
      -F  --fresh           Launches the app fresh, that is, without restoring windows. Saved persistent state is lost, excluding Untitled documents.
      -R, --reveal          Selects in the Finder instead of opening.
      -W, --wait-apps       Blocks until the used applications are closed (even if they were already running).
          --args            All remaining arguments are passed in argv to the application's main() function instead of opened.
      -n, --new             Open a new instance of the application even if one is already running.
      -j, --hide            Launches the app hidden.
      -g, --background      Does not bring the application to the foreground.
      -h, --header          Searches header file locations for headers matching the given filenames, and opens them.
      -s                    For -h, the SDK to use; if supplied, only SDKs whose names contain the argument value are searched.
                            Otherwise the highest versioned SDK in each platform is used.
      -u, --url URL         Open this URL, even if it matches exactly a filepath
      -i, --stdin  PATH     Launches the application with stdin connected to PATH; defaults to /dev/null
      -o, --stdout PATH     Launches the application with /dev/stdout connected to PATH;
          --stderr PATH     Launches the application with /dev/stderr connected to PATH to
          --env    VAR      Add an enviroment variable to the launched process, where VAR is formatted AAA=foo or just AAA for a null string value.

詳しくは「man open」で確認可能です。

まとめ

macOSではopenコマンドを使用してアプリを起動することができます。シェルスクリプトに組み込むこともできますので覚えておくと便利です。

macOSの使い方のコツは次のページにまとめています。

macOS使いこなし
Appleのオペレーティングシステム「macOS」全般に関する特集ページです。 インストール関連 macOSのインストールに役立つ記事をご紹介します。
Tips
macos
よかったらシェアしてね!
  • URLをコピーしました!
  • URLをコピーしました!
  • Amazonブラックフライデーで最強のスティック「Fire TV Stick 4K Max」が3480円(50%OFF)で販売中
  • Windows 11 Insider Preview Build 25252がリリース - Devチャンネル向け、感謝祭の休暇から復帰

関連記事

  • Windows 11の製品版でタブ付きメモ帳を今すぐ使用する裏技
    2023年1月24日
  • ChromeやFirefox、Safariでタイムアウト値を変更する方法
    2023年1月24日
  • macOSのメニューバーを自動的に表示・非表示にする方法
    2023年1月22日
  • Microsoft Edge 109で印刷できない問題を修正する方法
    2023年1月19日
  • PowerToys: マウスユーティリティ - さまざまな方法でマウスカーソルを分かりやすく表示
    2023年1月19日
  • Windowsでdmgファイルを開く方法
    2023年1月18日
  • macOSのメモアプリでテキストのみを貼り付ける方法
    2023年1月17日
  • バッテリー使用時にMacBookのディスプレイが暗くなるのを防ぐ方法
    2023年1月16日
スポンサーリンク
サイト内検索
特集アーカイブ
  • Windows更新情報
  • Windows11使いこなし
  • Windows 10使いこなし
  • macOS/iOS/iPadOS更新情報
  • macOS使いこなし
  • iOS使いこなし
  • Webブラウザ更新情報
Feedlyに登録

登録お願いします!

follow us in feedly

人気記事
  • Lp logo 3 1000x657 質問に対し流暢な日本語で回答してくれる「ChatGPT」が公開 - 試し方はこちら
  • S 20230119 111028 Microsoft、Windows 11 22H2でシステムの復元ポイントがアプリを破壊する事を確認
  • Pexels photo 777001 Windows 11/10のディスプレイ問題は「MPO」を無効にすれば魔法のように解決?
  • S 20221123 111042 Windows 11のタスクトレイ時計の秒表示を有効にする方法
  • 1674457395 with special id enabled refs win 11 install fails source xeno twitter  1 MicrosoftがWindows 11でReFSをサポート。そろそろNTFSからの移行が実現か?
  • S 20210923 114221 Windows 11で「管理ツール」を開く方法
  • Mac mini M2 2023 【悲報】M2搭載ローエンドMac miniとMacBook ProのSSD速度は前世代より低下
  • S 20230120 111540 Microsoft、サポート対象外のOfficeがインストールされているかどうかを確認するKB5021751を公開
  • S 20220219 172234 【Tips】iPhoneで撮影した特定の写真だけをiCloudに保存する方法
  • 【2022年版】macOSの古いバージョンを入手する方法
カテゴリー
タグ
Amazon Android App Apple applewatch appsale Chrome Edge Firefox Git Github Google iOS iPad ipados iPhone iPhone6 iphone7 iphone8 iTunes JavaScript Kindle Linux Mac MacBook MacBookPro macos Microsoft Nintendo OS X OSX Parallels Rails Ruby Sale Steam Swift Twitter VMware Windows windows7 windows10 windows11 Wine Yosemite
新着記事
  • 写真をアート風に変換できる「Photo Art Filters: DeepStyle」がセール価格になった本日のアプリセールまとめ
  • 【2/9まで】Kindleストアで「僕だけがいない街」などが最大80%OFF!サスペンス・ミステリーキャンペーンが開催中
  • AirPods Proはもはや耳栓
src256
ソフトアンテナを開発しています。

Windows/Mac/Linux全部使用中。ソフトウェア、ハードウェアいろいろなモノに興味があります。

好きなエディタはEmacs。好きな言語はRubyです。


srcw.net
  • プライバシーポリシー

© 2022 ソフトアンテナ

目次