LoginSignup
14
13

More than 3 years have passed since last update.

【Ubuntu 20.04】ホーム内のディレクトリ名を英語にする

Posted at

前提

全体の設定を英語にするのが一番手っ取り早いです。

基本は日本語環境で使いたいけど、ディレクトリの名前を英語にしたい人向けの記事です。

Ubuntuでホーム内のディレクトリを英語化する

Ubuntuをインストールするとき、日本語に設定するとディレクトリの中身が日本語になる。

image.png

ダウンロードやデスクトップなど、CLI環境で操作したいとき不便になる。

シェルで以下のコマンドを実行

$ LANG=C xdg-user-dirs-update --force

以下のコマンドですべて英語表記になっているか確認する。

$ cat .config/user-dirs.dirs

以下のように表示されればOK

# This file is written by xdg-user-dirs-update
# If you want to change or add directories, just edit the line you're
# interested in. All local changes will be retained on the next run.
# Format is XDG_xxx_DIR="$HOME/yyy", where yyy is a shell-escaped
# homedir-relative path, or XDG_xxx_DIR="/yyy", where /yyy is an
# absolute path. No other format is supported.
# 
XDG_DESKTOP_DIR="$HOME/Desktop"
XDG_DOWNLOAD_DIR="$HOME/Downloads"
XDG_TEMPLATES_DIR="$HOME/Templates"
XDG_PUBLICSHARE_DIR="$HOME/Public"
XDG_DOCUMENTS_DIR="$HOME/Documents"
XDG_MUSIC_DIR="$HOME/Music"
XDG_PICTURES_DIR="$HOME/Pictures"
XDG_VIDEOS_DIR="$HOME/Videos"

ただ、このままだと元の日本語のディレクトリが残って「ダウンロード」「Downloads」のように2つが共存してしまうので、以下のコマンドで中身を移動し、日本語のディレクトリを削除する。

$ cd; mv デスクトップ/* Desktop; mv ダウンロード/* Downloads; mv テンプレート/* Templates; rm -rf テンプレート; mv 公開/* Public; mv ドキュメント/* Documents; mv ミュージック/* Music; mv ピクチャ/* Pictures; mv ビデオ/* Videos
$ rm -rf デスクトップ ダウンロード テンプレート 公開 ドキュメント ミュージック ピクチャ ビデオ

再起動し、ログインすると以下の画面が出てくるので、次回から表示しないにチェックを入れて

古い名前のままにする

を選択する。

image.png

参考

14
13
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
14
13