-3

this is my terminal

my terminal shows the model of my laptop and not any directory. whenever I try to access a directory it shows no such directory when it actually exists. Even the home directory! I think the problem is this. is there any solution or am I just mistaken? I am new to linux and ask ubuntu so please do forgive me if I am making any mistake. any help will be much appreciated.

2 Answers2

2

Your prompt says you are in ~, which is your home directory. /lenovo is an absolute path. But that path does not exist, hence the error.

  • Relative path ---> relative/path/to/directory
  • Absolute path starts with / ---> /absolute/path/to/directory

If this directory existed, it would still not work (unless you have autocd enabled), but with a different error message: Is a directory.
Use cd directory to change to a directory or ls directory to list its contents.


If lenovo is a directory in your $HOME, you can type cd lenovo (relative path) from your $HOME or an absolute path like cd ~/lenovo or cd /home/hasan/lenovo to change to that directory.

pLumo
  • 26,947
  • 1
    thank you very much for explaining and especially telling me about the 'ls' command. I figured out what was going on. – hasan ramp Mar 01 '21 at 14:32
1

With regards to the very long hostname, if you do not want your machine to be called hasan-Lenovo-ideapad-110-15ISK on the network and in the terminal, you can use the hostnamectl command.

Here's how:

  1. Open Terminal (if it's not already open)
  2. Set a new hostname:
    hostnamectl set-hostname <new-hostname>
    
    Note: There is no output when you do this, so do not be surprised if it looks like "nothing happened".
  3. Confirm that everything is good by typing just hostnamectl. You should see something like this:
       Static hostname: my-computer
             Icon name: computer-laptop
               Chassis: laptop
            Machine ID: f45f012d60fc49fabea7b623cd7ae891
               Boot ID: 6aee67bd6bc647158dc2a3c4e43d34c3
      Operating System: Ubuntu 20.04.1 LTS
                Kernel: Linux 5.4.0-66-generic
          Architecture: x86-64
    
  4. Close Terminal
  5. Re-open Terminal

Your hostname will now be the new value.