Solved

Linux path

Posted on 2011-03-15
4
474 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
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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Suggested Solutions

Recently, an awarded photographer, Selina De Maeyer (http://www.selinademaeyer.com/), completed a photo shoot of a beautiful event (http://www.sintjacobantwerpen.be/verslag-en-fotoreportage-van-de-sacramentsprocessie-door-antwerpen#thumbnails) in An…
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.
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

775 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