- 追加された行はこの色です。
- 削除された行はこの色です。
#author("2019-03-02T05:56:14+00:00","default:haikikyou","haikikyou")
#author("2019-03-04T14:24:31+00:00","default:haikikyou","haikikyou")
[[Windows/コマンドプロンプト/コマンド]]
#contents
* 内容 [#cb6ab331]
- ディレクトリを作成する。
- 再帰的にディレクトリを作成できる。
出力をWindowsのクリップボードにリダイレクトする。~
出力は、Ctrl+Vとかで貼り付け可能。
macOSで言うと、pbcobyにあたる。
* 使用方法 [#if03e8c7]
#geshi(bash){{{
md [<Drive>:]<Path>
mkdir [<Drive>:]<Path>
<Command> | clip
clip < <FileName>
}}}
** オプション [#vc06f8f5]
|オプション|説明|h
|<Command>|クリップにリダイレクトする出力をするコマンド|
|<FileName>|クリップにリダイレクトしたいファイル|
* 使用例 [#j6f81195]
** ディレクトリを作成する [#cd50313a]
** コマンドの結果をクリップボードにリダイレクト [#ka310eaf]
以下では、PostgreSQLのメタコマンド\dの出力をクリップボードにリダイレクトしている。
#geshi(dos){{{
C:\Users\Administrator\dos>md parent\child
c:\test>psql -d postgres -c "\d"
リレーション一覧
スキーマ | 名前 | 型 | 所有者
----------+------+----------+--------
public | t | テーブル | admin
(1 行)
C:\Users\Administrator\dos>dir /s parent
ドライブ C のボリューム ラベルがありません。
ボリューム シリアル番号は 0A12-47B4 です
C:\Users\Administrator\dos\parent のディレクトリ
2019/03/02 14:12 <DIR> .
2019/03/02 14:12 <DIR> ..
2019/03/02 14:12 <DIR> child
0 個のファイル 0 バイト
c:\test>psql -d postgres -c "\d" | clip
C:\Users\Administrator\dos\parent\child のディレクトリ
}}}
2019/03/02 14:12 <DIR> .
2019/03/02 14:12 <DIR> ..
0 個のファイル 0 バイト
** ファイルの内容をクリップボードにリダイレクト [#rfd96f57]
ファイルの総数:
0 個のファイル 0 バイト
5 個のディレクトリ 296,915,824,640 バイトの空き領域
以下では、com.txtのコマンド(dir)をクリップボードにリダイレクトし、Ctrl+Vで貼り付けてコマンド実行している。
#geshi(bash){{{
c:\test>type com.txt
dir
c:\test>clip < com.txt
c:\test>dir
ドライブ C のボリューム ラベルがありません。
ボリューム シリアル番号は 7241-A2C2 です
c:\test のディレクトリ
2019/03/04 23:22 <DIR> .
2019/03/04 23:22 <DIR> ..
2019/03/04 23:02 0 child
2019/03/04 23:22 6 com.txt
2019/03/04 23:02 0 dir
2019/03/04 23:02 0 md
4 個のファイル 6 バイト
2 個のディレクトリ 37,171,908,608 バイトの空き領域
}}}
* 参考リンク [#hbe46d31]
- https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/md
- https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/clip