
ファイルがあるとします。このファイルは複雑な場所 (100 個のサブフォルダ内) に保存されていますが、それでも頻繁に使用します。このファイルに一連のキーワード (つまり、「お気に入りのファイル」) を割り当て、後でそのキーワードを自然言語プロセッサ (コマンド ライン インターフェイスまたは音声認識ソフトウェア) に入力してファイルを開く方法はありますか? たとえば、コマンド ラインに「お気に入りのファイルを開く」と入力したり、音声認識ソフトウェアで「お気に入りのファイルを開く」と言ったりします。
そのようなサービスは存在するのでしょうか?
答え1
はい、そうです:
@emory の説明に従ってリンクを作成します。
それを環境変数にします。シェルの初期化ファイルに次の行を追加します (
~/.bashrc
bash を使用している場合)。myfile="毎回入力したくないほど長いパス"
次に、コマンドラインから、
$myfile
実際のファイル名であるかのように使用できます。$ echo $myfile /absurdly/long/path/that/you/would/rather/not/type/every/time $ cat > $myfile This is so much easier now! $ cat $myfile This is so much easier now!
たとえば、ファイルを特定の目的で使用する場合は、単に
cat
ターミナルにファイルを置くだけで、同じことを実行するエイリアスを設定することもできます。シェルの初期化ファイルに以下を追加します。alias myfile='cat /absurdly/long/path/that/you/would/rather/not/type/every/time'
次に、それを実行します:
$ myfile This is so much easier now!
答え2
シンボリックリンクを作成できますか
ln -sf /some/complex/location/1/2/{your complex directory structure}/100/FavoriteFile /home/me/Desktop/FavoriteFile
ファイルはまだ複雑な場所にありますが、デスクトップからアクセスできます。
答え3
ctags はおそらくこれに役立つでしょう。これは、コンピュータのソース コード ファイルにインデックスを付け、関数やルーチンがどのファイルに含まれているか、そのファイルがどこにあるのかを正確に知る必要がなく、関数やルーチンを簡単に見つけられるようにするために作成されました。
マニュアルページからの抜粋:
Tag index files are supported by numerous editors, which allow the user
to locate the object associated with a name appearing in a source file
and jump to the file and line which defines the name. Those known about
at the time of this release are:
Vi(1) and its derivatives (e.g. Elvis, Vim, Vile, Lemmy), CRiSP,
Emacs, FTE (Folding Text Editor), JED, jEdit, Mined, NEdit (Nirvana
Edit), TSE (The SemWare Editor), UltraEdit, WorkSpace, X2, Zeus
Ctags is capable of generating different kinds of tags for each of many
different languages. For a complete list of supported languages, the
names by which they are recognized, and the kinds of tags which are
generated for each, see the --list-languages and --list-kinds options.
幸運を。