0

Why are mounted media mounted under /media/<user>/ in Ubuntu 16 counter to how it used to be under /media/?

And, how can I grab the <user> part if I want a script to work in case of username change? (for example, for /home/<user> I use $HOME)

Solution:

  • first part answered here
  • second part: $USER
user10853
  • 1,626

2 Answers2

4

Probably you can use the $USER variable? If you're new in scripting have a look at some basic guides like this

As for the change in path - here is good explanation from other similar question at AskUbuntu.

2

You answered part of your own question; however, I wanted to get you an actual answer to your question of "why?"

Answer to "why" is at this post: How to configure the default automount location?

To actually get the user part, you have three options:

whoami
echo $USER
echo $LOGNAME
D75
  • 142