Actually, my path was jjw or jjw/home
but when i run Terminal, it become
how do i return original path?
pwd - return working directory name (PWD - Print Working Directory)
Related
I'm using Ubuntu 20.4.05 LTS. It is not locating any directory as you can see in the image. For example, cd ~/Downloads doesn't take me to the directory.No such file or directory image What should I do?
as a first step you must know the position of the directory by writing the command pwd
pwd
then you can write the ls command to see the contents of the list of folders or directories
ls
if the file you need is in that directory, you can enter that file by writing the command cd
cd
access folder
I am using ubuntu 16.04 and created a virtual environment called 'tensorflow1' as shown above. I am using putty to access a machine remotely. So I was trying to change directory by typing "cd /tensorflow1/models/research" but it says "-bash: cd: /tensorflow1: No such file or directory" in ubuntu, but the file is there. I typed "ls" and it also shows the file. Why is it so?
When you type ls you see the content of the current directory. When you type cd /tensorflow1 you're trying to enter a directory tensorflow1 at the root (/) of the filesystem and the directory is certainly not there. You just need
cd tensorflow1/models/research
to enter a subdirectory of the current directory. Or
cd ./tensorflow1/models/research
because . means "the current directory".
You probably want cd ./tensorflow1/models/research or just cd tensorflow1/models/research.
Read about root directory, home directory, working directory then about path_resolution(7)
When I simply try to cd into a directory on my desktop (cd command + drag folder to terminal to generate file path) I get an error that says "No such file or directory" however, as you can see in the screenshot the folder is there on my desktop. What could be the problem? Thanks.
Seems you have to put a space after the cd command, otherwise the Desktop is available with ~/Desktop on macos shell
I have a bash script that runs my Go program. That's all it does, and when I run it from the command line, it works fine.
But when I run it by double clicking on it in Finder, it returns
/Users/colin/go/metgen/metaphorgenerator.sh: line 2: ./binary: No such file or directory
So I made it echo it's working directory, and it just prints /Users/colin, my home directory.
How do I get it to run the code from the directory the file is in? (I want it to work no matter what directory it's in)
You need to point it to the location of the executable, either with a relative path from the working directory as in go/metgen/binary, absolute path like /Users/colin/go/metgen/binary, or absolute path based on the parent executable (unfortunately not reliable).
$0 is the full program name. So you can get the directory with HERE=$(dirname "$0").
Then, line 2 should have ${HERE}/binary.
I am beginning to learn ruby and was following the instructions of one video to access the desktop through the -ls command in the terminal. Now, I would like to get out of the desktop in the terminal and don't know how. I know, I know I am a total noob... but can someone please help. Thanks. BTW the command I wrote was:
my-iMac~ me$ cd Desktop/
my-iMac:Desktop samuel$ ls
Where would you like to go?
Go home: cd or cd ~
Go to the previous working directory: cd $OLDPWD
Go to parent of the current directory: cd ..
Go to any directory you want: cd /path/to/directory
cd .. will take you back up 1 level.
for windows, you can open up the file explorer copy path then in your command prompt type "cd" then paste path. Your command prompt should now default to that path. (you can also type the entire path)
cd C:\Users\username\Documents\Folder