Solved

Linux path

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

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

Suggested Solutions

Title # Comments Views Activity
How to change the nameserver on Ubuntu Server 6 71
Apache module 5 60
postfix start error! 9 48
Korn Shell Script - Is there a way to LOOP it? 13 41
Using 'screen' for session sharing, The Simple Edition Step 1: user starts session with command: screen Step 2: other user (logged in with same user account) connects with command: screen -x Done. Both users are connected to the same CLI sessio…
It’s 2016. Password authentication should be dead — or at least close to dying. But, unfortunately, it has not traversed Quagga stage yet. Using password authentication is like laundering hotel guest linens with a washboard — it’s Passé.
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

680 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