ファイルに含める内容に応じて:
touch /path/to/file空のファイル-
somecommand > /path/to/fileコマンドの出力を含むファイルの場合。eg: grep --help > randomtext.txt echo "This is some text" > randomtext.txt -
nano /path/to/fileまたはvi /path/to/file(またはany other editor emacs,gedit etc)
既存のファイルを開いて編集するか、空のファイルが存在しない場合は作成して開いて入力します
タッチを使用
touch filename