0

Is there, in linux variables, or some other means to find per/system paths, similar to windows path variables, like %AppData%, %UserProfile%, %AllUsersProfile%, %ProgramFiles%, %SystemRoot%, %SystemDrive%, %Temp%, %Tmp%, etc.?

Update: OK, I've found out, that:
home, you can find from: "env|egrep '^HOME$'"
various user folders from command: xdg-user-dir
various system folders are from: "env|egrep '^XDG-'"

It works fine on my Ubuntu 16.04, but when I try to do it on Ubuntu 14.04, it only has xdg-user-dir and "env|egrep '^HOME$'", but "env|egrep '^XDG-'" doesn't have any path results.

Any suggestions?

igoryonya
  • 185
  • 1
  • 2
  • 14

2 Answers2

0

Most of the things you mention just have no equivalent on a Linux system (in the sense that the concept behind this doesn't exist), but the user home directory is usually in the variable $HOME.

Despite your claim to the opposite, these concepts have to clear equivalent on Linux and the feature you require does not exist.

Sven
  • 97,248
  • 13
  • 177
  • 225
  • @igoryonya: No. Take software. It might be installed in `/usr/bin`, `/usr/local/bin`, `/opt` or any other number of places. While there might be something like `%AppData%` for some desktop environments, it's then a convention by that DE and not a "Linux standard". There is nothing like `%AllUsersProfile%`, except you consider `/etc/profile` etc. `%SystemRoot%` is always `/`, there are no drive letters so no `%SystemDrive%` ... – Sven Jul 17 '16 at 12:28
  • 1st of all - most of things I mention, have equivalents on a Linux system: %AppData%=/home/user/.config; %UserProfile%=/home/user; %AllUsersProfile%=/etc; %ProgramFiles%=/bin; %SystemRoot%=/boot; %SystemDrive%=/; %Temp%=/tmp. But wait, I didn't ask about exact equivalents. I asked for Linux "variables or some other means to fibd per/system paths, (windows vars, were just examples).". – igoryonya Jul 17 '16 at 12:33
  • The problem, is that not all (li|u)n[ui]x|bsd systems follow the same folder standards, for example - some systems use /var/etc, instead of /etc, some systems use /usr instead of /home, some systems use /mnt instead of /media, etc., etc., etc.. – igoryonya Jul 17 '16 at 12:33
  • 1
    `/etc` is not `%AllUsersProfile%` but much more. `~/.config` isn't used by an awful lot of things, `/boot` is certainly no equivalent to `%SystemRoot%`. But to make it more explicit: What you want does not exist. – Sven Jul 17 '16 at 12:36
  • I disagree, that %AllUsersProfile% is more ~/.config, because it's a profile with settings for all users (i.e. systemwide), /etc is for sytemwide settings also, but, on the second thought /etc is "%AllUsersProfile%/Application Data" or "%AllUsersProfile%/AppData" (depending on the Win version) – igoryonya Jul 17 '16 at 12:49
0

I've made a small table with windows and Linux equivalents.

This is the source:

Windows and Linux variable equivalents

Windows cmd vs Linux shell commands

This is based on my experience(with Windows 7 and Linux Ubuntu).

DataScientYst
  • 111
  • 1
  • 3