am in the Desktop but I cd is not see the desktop - linux

How can I fixs that problem meanwhie I fix last code Selenim
Selenium but I am take same error. And cd is not see the Desktop but I am in the Desktop.

Here ~ is equal to /home/levidonates so when you type cd ~/Selenium it's actually cd /home/levidonates/Selenium but the folder Selenium is in your folder Desktop, so you need to type :
cd ~/Desktop/Selenium

~ is a shorthand for your home directory, /home/levidomates. The directories you're accessing are under there, not under the root, /. That is, ~/Desktop is not the same as /Desktop.

Firstly I see which folder do you try to enter / at the beginning? this is not true method.
/ characters means top of all folders root level.
You should not confuse it with the root user's home folder.
cd: change directory
cd .. : Back to the previous folder or up folder.
Firstly You can check your home folder
echo $HOME
then you must be enter pwd
if the your home folder /home/levidomates/
you must only cd ~ command
than cd Desktop
You shouldn't use / at the beginning of folders

Your absolute way to Deskotp is not correct...You forgot /home/levidomates
So then it should be cd /home/levidomates/Desktop instead of cd /Desktop

Related

When I create a file in my user directory it displays on my desktop directory. can anyone help me?

I tried to change the name of my desktop directory but I did something wrong. Now when I create a file in the user directory the file shows up on my desktop. I think that I changed the name of my desktop for my user directory.
anyone can help me to fix this problem?
what's the return of cd $HOME ; pwd and cd $HOME/Desktop ; pwd ?
verify if the $HOME/Desktop is really a folder or an symbolic link to your $HOME or other folder. To do that execute cd $HOME ; ls -la | grep ^l if Desktop appears in list you turned the desktop folder into an symbolic link.

Ubuntu: how to enter a directory in shell

On my Desktop I have created a folder called "Files", I would like to know how to access that folder through a shell script
When in Linux file system using bash you can navigate to the home directory in many ways:
After you reach the home directory everything is easy from there including reaching Desktop.
The ~ or $HOME reference:
In Linux based systems the keyword ~ or $HOME refers to the home directory of the computer.
For example say you are currently at /bin, to navigate to home if you know your username you would do :
$ cd /home/yourusername
#The directory is now switched to :
$ pwd #This command stands for print working directory
'/home/yourusername'
Now you can do it alternatively by:
(Again assuming you are in /bin)
$ cd $HOME
$ pwd
'/home/yourusername'
#Alternatively
$ cd /bin
$ cd ~
$ pwd
'/home/yourusername'
These shortcuts let you go to home without writing much and are even recommended.
Now for your problem you can easily navigate to your folder by:
cd ~/Desktop/Files/

How to go to another directory sharing same parent directory?

I am beginner in linux and wondering about a shorter way to go a directory having same parent directory. Here I elaborate that.
dir1
- dir11
- dir12
- dir13
- dir14
Directory dir1 has sub-directories dir11,...,dir14. I am at directory dir13 and want to go to dir12. What is direct way to do this?
I can do
cd..
cd dir12/
But I am wondering whether I can do this in single step. Any ideas?
cd doesn't only take one directory to change to. You can provide a complete path to which you want to go.
You can simply type cd ../dir12
You can also go all nuts with cd ../dir12/../dir13/../dir14/..
Try also the following: type cd ..<press Tag twice>. This will list you all directories in the path you have given.
There are wildcards that cd can use. For example ~ is your home directory. cd ~ or just cd will change into your $HOME.
See man cd (in a terminal) for more.

Why does "cd -" behave as it does?

What does cd - exactly do ? ( the change directory command, plus a dash )
I noticed that if I run it in my /home/user folder repeatedly it outputs either /home/user or /home, this changes if I run it from a different folder.
cd -
pop the last directory you were from the stack of directory. It's like hitting "back" on the browser.
Exemple :
you are in /user/alex
you can test that with :
pwd
that give you
/user/alex
then if you do
%cd project1/subfolder
%pwd
/user/alex/project1/subfolder
%cd subsubfolder
%pwd
/user/alex/project1/subfolder/subsubfolder
%cd -
pwd
/user/alex/project1/subfolder
cd -
pwd
/user/alex
NB : it's not going back a level upper in the folder hierarchy. it's going to the previous current folder. ( a level upper is cd .. ).
The syntax
cd -
allows you to switch back to the "last directory you were in when you changed to the current directory". Running the command twice allows you to switch back to the current directory (since the current directory would then become the "last directory you were in when you changed to the current directory").
This is very useful if you are in a very long directory which you don't want to type out over and over, and you go to another lengthy named directory. Instead of retyping it, you can just do a 'cd -', which is similar to how some people use the alt-tab (or command-tab) to switch between applications. This key combo shortcut lets you essentially toggle between the last two applications.
cd stands for Change Directory
It is used to navigate arond your folders
So if you're in /home/user and have a folder in that directory called 'top-secret', you would access it by typing:
cd /top-secret

What directory is the default bash directory

I am using the bash console for Ubuntu and my console location is
user#MyServer:~$
If user#MyServer:/$ is the root directory, what is user#MyServer:~$ ?
~ represents your home directory. If you are logged in as root, this will typically be /root if you are logged in with another user (say with username user) this will typically be /home/user. The best way to know for certain though is either run echo ~ which will print where ~ points to, or you can run the pwd command while in ~ which will show your present working directory - this command is generally useful to know when navigating.
As noted in other replies, it's your home directory, which is shortened to ~.
You can find out what directory you're in using the pwd command. eg:
[atticus:pgl]:~ $ pwd
/home/pgl
“user#MyServer:~$” is the command prompt. You can echo $PS1 to see the setting of your environment.
Its your home directory you can go to your home directory by cd ~
Not always, you can list all users' home directory by:
cut -d : -f1,6 /etc/passwd
so you will get different paths, some under /export/home/USERNAME, some under /home/USERNAME, some has no home directory. For root account, normal / is its home directly.

Resources