Thursday, May 2, 2024
45
rated 0 times [  45] [ 0]  / answers: 1 / hits: 266449  / 3 Years ago, mon, november 1, 2021, 1:32:42

I'm completely new and lost in Ubuntu 12.04, I'm having trouble navigating to my Sublime folder which I know is in my /opt folder. Yet I've tried to no avail to navigate into it via Terminal window. The directory is colored in blue, no idea what this means...but I am able to access the folder using the GUI explorer...?



k@k-Ubuntu:~$ cd /opt
k@k-Ubuntu:/opt$ ls
Sublime Text 2
k@k-Ubuntu:/opt$ cd Sublime Text 2
bash: cd: Sublime: No such file or directory
k@k-Ubuntu:/opt$ cd /Sublime Text 2
bash: cd: /Sublime: No such file or directory

More From » command-line

 Answers
6

Go inside the /opt directory via terminal and then run below command,



k@k-Ubuntu:~$ cd /opt
k@k-Ubuntu:/opt$ cd "Sublime Text 2"


As the folder you want to connect has spaces in the name, you must surround the name with quotes in order for the Shell to read it correctly (as one name). In other case it will read only the Sublime and this doesn’t exist.



Another way to avoid this issue, is to use Tab Completion. This is a feature that will help you to auto-fill weird names and/or long names. Read here about Tab Completion and learn it. It is very useful(in Ubuntu is pre-installed).



A third way for names with spaces is the backslash . Above command with quotes could be



cd Sublime Text 2/


the backslash followed by a space explicitly denotes a space.



A suggestion could be: Do not create folders in Linux with space in name. Prefer something like
Sublime-Text-2 or Sublime_Text_2


[#27731] Tuesday, November 2, 2021, 3 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
tudatchful

Total Points: 270
Total Questions: 109
Total Answers: 122

Location: Palau
Member since Tue, May 30, 2023
1 Year ago
;