LoginSignup
1
0

More than 3 years have passed since last update.

shellでディレクトリからファイル名を取得

Last updated at Posted at 2019-09-11

ディレクトリ内のファイル名が動的に変わる場合のファイル名の取得方法。
◆使うコマンド
basename パス名 拡張子
ls オプション パス名

◆使い方
bash
kakunou=$(basename 'ls ${ディレクトリパス名}')

複数のファイル名を取得したい場合は
basenameにオプション-aを付与する。

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0