Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

little oddity I don't understand

New to Debian (Or Linux in general)? Ask your questions here!
Post Reply
Message
Author
User avatar
Fedora
Posts: 16
Joined: 2019-03-14 16:50

little oddity I don't understand

#1 Post by Fedora »

Hello,

I had this strange thing when i was editing a file in vi. I get to root and i am going down the file tree and i have to switch between front / and \ to make it work. Is there a reason to do this.

Code: Select all

root@wood:/home/lincoln# cd
root@mypcname:~# cd /etc
root@mypcname:/etc# cd \apt
root@mypcname:/etc/apt# 
 
Why do i have to switch back and forth whats the deal?

User avatar
Head_on_a_Stick
Posts: 14114
Joined: 2014-06-01 17:46
Location: London, England
Has thanked: 81 times
Been thanked: 133 times

Re: little oddity I don't understand

#2 Post by Head_on_a_Stick »

The backslash (\) is an escape character so in your example it is effectively ignored.

Code: Select all

empty@thanatos:~ $ cd /etc/                                             
empty@thanatos:/etc $ cd \apt
empty@thanatos:/etc/apt $ cd -
/etc
empty@thanatos:/etc $ cd apt
empty@thanatos:/etc/apt $ cd
empty@thanatos:~ $ cd /etc/apt
empty@thanatos:/etc/apt $ cd
empty@thanatos:~ $ cd /etc
empty@thanatos:/etc $ cd /apt
mksh-static: cd: /apt: No such file or directory
2|empty@thanatos:/etc $
The last command fails because it calls the full path to /apt and there is no such directory.
deadbang

Post Reply