What does double slash // in `cd //` mean in Linux? [duplicate]

Actually it means nothing and is ignored. From the Bash FAQ E10:: E10) Why does ‘cd //’ leave $PWD as ‘//’? POSIX.2, in its description of ‘cd’, says that three or more leading slashes may be replaced with a single slash when canonicalizing the current working directory. This is, I presume, for historical compatibility. Certain … Read more

Go up several directories in linux

cd ../../../../../../../ Also another useful navigation tip is if for example lets say you keep switching from a directory (call it A) to another (call it B) that’s 7 directories up, in your case. So if you’re in directory A: A> cd ../../../../../../../ B> // Now you’re in directory B and want to go back … Read more

How to use “cd” command using Java runtime?

There is no executable called cd, because it can’t be implemented in a separate process. The problem is that each process has its own current working directory and implementing cd as a separate process would only ever change that processes current working directory. In a Java program you can’t change your current working directory and … Read more

How do I find the current directory of a batch file, and then use it for the path?

There is no need to know where the files are, because when you launch a bat file the working directory is the directory where it was launched (the “master folder”), so if you have this structure: .\mydocuments\folder\mybat.bat .\mydocuments\folder\subfolder\file.txt And the user starts the “mybat.bat”, the working directory is “.\mydocuments\folder”, so you only need to write … Read more

Run cmd commands through Java

One way to run a process from a different directory to the working directory of your Java program is to change directory and then run the process in the same command line. You can do this by getting cmd.exe to run a command line such as cd some_directory && some_program. The following example changes to … Read more

How to cd into a directory with space in the name?

$ cd “$DOCS” You need to quote “$DOCS” to prevent spaces from being parsed as word separators. More often than not, variable references should be quoted. Note that $HOME would have the same problem. The issue is coming from when the shell evaluates variable references; it’s nothing to do with what variables you use or … Read more