Questions tagged [path]

The general form of a file or directory name that specifies a unique location in a file system. In many Linux and Unix-like OS the PATH (all upper case) variable specifies the directories where executable programs are searched for.

A path represents a unique file system location using the directory tree hierarchy expressed in a string of characters in which path components, separated by a delimiting character, represent each directory. The delimiting character is most commonly a slash /, a backslash \, or a colon :.

A PATH (all upper case, ) in the Linux, UNIX-like operating systems and Windows contains list of directories, where the shell searches through, when a command is executed. The executables are stored in different directories in the OS. On UNIX-like OS the directories are separated by colon, on Windows by semi-colon.

Examples

Simple way to show the $PATH variable is:

echo "$PATH"
printf "%s\n" "$PATH"

A typical PATH looks like:

/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin

More generally, a path is a sequence of directions that, when followed in order, reach a certain object or location.

In addition to file system paths, there are paths through a tree:

root->left->right->right->left

or, again more generally, a set of attributes on an object.


There might be some other contexts where the term "path" is used to described something non-URI and non-directory related which are not covered by the general description.

One case would be in a context such as in the SCADA software, Ignition, where the term "path" is generally used to refer to tag-path - as Tag is the basic unit in the software, forming a hierarchical system like directory. Typical tag-path in Ignition look like this:

BaseFolder/MyTag

Or, more complexly when tag is not in the BaseFolder but referred from another "Parent" Tag:

BaseFolder/MyAdvanceUDTTag/MyBaseUDTTag/MyTag
19410 questions
148
votes
4 answers

Do you need to use path.join in node.js?

as everyone knows Windows does paths with backslashes where Unix does paths with forward slashes. node.js provides path.join() to always use the correct slash. So for example instead of writing the Unix only 'a/b/c' you would do…
balupton
  • 47,113
  • 32
  • 131
  • 182
148
votes
22 answers

Adding Python to PATH on Windows

I've been trying to add the Python path to the command line on Windows, yet no matter the method I try, nothing seems to work. I've used the set command, I've tried adding it through the Edit Environment Variables prompt, etc. Furthermore, if I run…
rogerklutz
  • 1,481
  • 2
  • 10
  • 4
148
votes
6 answers

How to convert boost path type to string?

Hello I currently have a program that gets a full path of a file's location and is put into a variable that is the type of: boost::filesystem2::path I have looked up how to do this and have found that using: string result1 =…
Johnston
  • 2,873
  • 8
  • 29
  • 39
148
votes
7 answers

mkdir if not exists using golang

I am learning golang(beginner) and I have been searching on both google and stackoverflow but I could not find an answer so excuse me if already asked, but how can I mkdir if not exists in golang. For example in node I would use fs-extra with the…
Alfred
  • 60,935
  • 33
  • 147
  • 186
147
votes
7 answers

Expand Python Search Path to Other Source

I have just joined a project with a rather large existing code base. We develop in linux and do not use and IDE. We run through the command line. I'm trying to figure out how to get python to search for the right path when I run project modules. For…
themaestro
  • 13,750
  • 20
  • 56
  • 75
145
votes
6 answers

Path to Powershell.exe (v 2.0)

Where is the Powershell (version 2.0) located? What is the path to Powershell.exe? I have Windows Server 2008 and Powershell installed. When I look at this folder: PS C:\Windows\System32\WindowsPowerShell> dir Directory:…
jjoras
  • 2,001
  • 5
  • 18
  • 16
143
votes
4 answers

Does Java have a path joining method?

Exact Duplicate: combine paths in java I would like to know if there is such a method in Java. Take this snippet as example : // this will output a/b System.out.println(path_join("a","b")); // a/b System.out.println(path_join("a","/b");
Geo
  • 93,257
  • 117
  • 344
  • 520
143
votes
3 answers

How do I include a path to libraries in g++

I am trying to include the path to extra libraries in my makefile, but I can't figure out how to get the compiler to use that path. So far I have: g++ -g -Wall testing.cpp fileparameters.cpp main.cpp -o test and I want to include the path…
mrswmmr
  • 2,081
  • 5
  • 21
  • 23
143
votes
26 answers

How to get the Full file path from URI

I'd like to get the full file path, from a URI. The URI isn't a Image, but it's a music file, but if i do it like the MediaStore Solution, it won't work if the app user selects eg Astro as browser, instead of Music Player. How do I solve this?
tim687
  • 2,256
  • 2
  • 17
  • 28
140
votes
9 answers

Using Server.MapPath in external C# Classes in ASP.NET

I'm trying to get the absolute path of certain files in a C# class. Server.MapPath works great of course for ASPX and their code-behind pages, but that doesn't exist in another class file. I tried HostingEnvironment.MapPath(), but that complains…
Chet
  • 21,375
  • 10
  • 40
  • 58
139
votes
4 answers

Python Setup Disabling Path Length Limit Pros and Cons?

I recently installed Python 3.7 and at the end of the setup, there is the option to "Disable path length limit". I don't know whether or not I should do this. What are the pros and cons of doing this? Just from the sound of it you should always…
Qwerty Qwerts
  • 1,521
  • 2
  • 9
  • 13
138
votes
6 answers

How do I set $PATH such that `ssh user@host command` works?

I can't seem to set a new $PATH such that it is used when executing commands via ssh user@host command. I have tried adding export PATH=$PATH:$HOME/new_path to ~/.bashrc and ~/.profile on the remote machine, but executing ssh user@host "echo…
Denver Gingerich
  • 1,587
  • 2
  • 12
  • 6
138
votes
10 answers

Set a path variable with spaces in the path in a Windows .cmd file or batch file

I'm new to script writing and can't get this one to work. I could if I moved the files to a path without a space in it, but I'd like it to work with the space if it could. I want to extract a bunch of Office updates to a folder with a .cmd file. …
marcerickson
  • 1,481
  • 2
  • 10
  • 4
137
votes
12 answers

How to get the Parent's parent directory in Powershell?

So if I have a directory stored in a variable, say: $scriptPath = (Get-ScriptDirectory); Now I would like to find the directory two parent levels up. I need a nice way of doing: $parentPath = Split-Path -parent $scriptPath $rootPath = Split-Path…
Mark Kadlec
  • 8,036
  • 17
  • 60
  • 96
137
votes
1 answer

pip freeze creates some weird path instead of the package version

I am working on developing a python package. I use pip freeze > requirements.txt to add the required package into the requirement.txt file. However, I realized that some of the packages, instead of the package version, have some path in front of…
Naeem Khoshnevis
  • 2,001
  • 4
  • 18
  • 30