Solved

Linux path

Posted on 2011-03-15
4
482 Views
Last Modified: 2012-05-11
I am not sure my understanding for path correctly or not.
Suppose I am in the root "abc", I want to access the file "test.txt" in subfolder "xyz".
Then in the command or batch file, I used
xyz\test.txt

Open in new window

0
Comment
Question by:zhshqzyc
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 31

Expert Comment

by:farzanj
ID: 35137631
Linux uses forward slash NOT Windows back slash

Issue this
ls xyz/test.txt
0
 
LVL 12

Expert Comment

by:upanwar
ID: 35137645
I will sugest you to access it with full path.

like:
/xyz/test.txt

0
 
LVL 8

Accepted Solution

by:
point_pleasant earned 50 total points
ID: 35137646
you could use either

relative path of xyz/test.txt
absolute path /abc/xyz/test.txt

linux uses the forward slash "/" while dos uses the backslash "\"


0
 
LVL 68

Expert Comment

by:woolmilkporc
ID: 35137679
Since you're under Linux you should use forward slashes (/) instead of backslashes (\).

And yes, xyz/test.txt is OK to access the file e.g. using an editor.

cat xyz/test.txt
vi xyz/test.txt

In order to execute it (if it's a script or a program) you should prepend "./" meaning the "current directory" because most often the current directory (".") is not in the search PATH for executables:

./xyz/test.txt


wmp

0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I. Introduction There's an interesting discussion going on now in an Experts Exchange Group — Attachments with no extension (http://www.experts-exchange.com/discussions/210281/Attachments-with-no-extension.html). This reminded me of questions tha…
Active Directory replication delay is the cause to many problems.  Here is a super easy script to force Active Directory replication to all sites with by using an elevated PowerShell command prompt, and a tool to verify your changes.
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

717 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question