LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 07-29-2021, 09:04 AM   #1
MrClip
LQ Newbie
 
Registered: Jul 2021
Posts: 2

Rep: Reputation: Disabled
Terminal command not acceptable in Mint


Distro: Linux Mint 20.2 Uma base: Ubuntu 20.04

As a newbie I was having a bit of a nightmare with things not adding up when trying to use the simple Terminal command to change directory. Whatever websites or forum posts I was looking at just gave me information that didn't seem to work for me.

Eventually I found what I was looking for but now I want to know WHY...

clip@clip-HP-Laptop-15-da0xxx:/$ cd Downloads
bash: cd: Downloads: No such file or directory

But

clip@clip-HP-Laptop-15-da0xxx:/$ cd ~/Downloads
clip@clip-HP-Laptop-15-da0xxx:~/Downloads$


So why?

Why not:

cd Downloads

..like I see as an answer given in so many places?

Is this a distro thing, and that I need to be a lot more specific about where I get my information from? I can understand that, say, using Ubuntu and using Mint are not entirely the same thing, but surely something so basic as a change directory command shouldn't be so different between these two distros, rite?

Please bear in mind I am at the very beginning of my Linux journey so I probably require kid gloves!

Cheers!
 
Old 07-29-2021, 05:28 PM   #2
computersavvy
Senior Member
 
Registered: Aug 2016
Posts: 3,345

Rep: Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484
Your home directory is likely /home/username and can be seen by using "echo $HOME"

When you initially log in you are located in your home directory.

The shell sees ~/ as equal to $HOME
Therefore "cd ~/Downloads" is the same as "cd $HOME/Downloads" and is the same as "cd Downloads" when you first log in.

Any time you have changed the directory you are currently in you can see where you are with a simple "pwd" which will display the present working directory. You also can always return to your home directory with a simple "cd" with nothing following.

The command "ls" displays the content of the current directory and thus you can see what is located there.

Use the man pages to see how ls, cd, pwd, echo, and almost any other command function and are used.

A simple bash tutorial will assist tremendously in learning how to navigate and manage the system.
 
Old 07-29-2021, 06:11 PM   #3
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,728

Rep: Reputation: 5919Reputation: 5919Reputation: 5919Reputation: 5919Reputation: 5919Reputation: 5919Reputation: 5919Reputation: 5919Reputation: 5919Reputation: 5919Reputation: 5919
Selcome to LinuxQuestions.

To elaborate on computersavvy's post, the difference is based on relative versus absolute paths.

Quote:
clip@clip-HP-Laptop-15-da0xxx:/$ cd Downloads
Since your destination (Downloads) does not have a leading / it is considered a relative path and the destination would be a subdirectory from your current working directory. However since your current working directory is / there is no subdirectory called Downloads.

Quote:
clip@clip-HP-Laptop-15-da0xxx:/$ cd ~/Downloads
~ is a short cut for your home directory which is /home/username and since it has a leading / is an absolute path. Using absolute paths you can "jump" anywhere in the directory tree.

The advantage is that it can save you some typing time going to the next subdirectory.

All linux distributions with respect to absolute vs relative paths are the same.
 
1 members found this post helpful.
Old 07-29-2021, 07:12 PM   #4
SlowCoder
Senior Member
 
Registered: Oct 2004
Location: Southeast, U.S.A.
Distribution: Debian based
Posts: 1,250

Rep: Reputation: 164Reputation: 164
Quote:
Originally Posted by MrClip View Post
clip@clip-HP-Laptop-15-da0xxx:/$ cd Downloads
Welcome to Linux!
The red part appears to be your path, and / is the filesystem root, not your home directory. If it showed a ~ (tilde) then you would be in your home directory, which is where your Downloads directory resides.
 
Old 07-30-2021, 05:31 AM   #5
MrClip
LQ Newbie
 
Registered: Jul 2021
Posts: 2

Original Poster
Rep: Reputation: Disabled
Thanks for the helpful replies.

The relative versus absolute paths obviously confused me. I did see some information about that but being so new I was too confused to take it on board.
 
Old 08-08-2021, 03:47 AM   #6
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
Quote:
Originally Posted by MrClip View Post
Thanks for the helpful replies.

The relative versus absolute paths obviously confused me. I did see some information about that but being so new I was too confused to take it on board.
I hope you're less confused now.
It's really quite simple once you know it.
Please mark your thread SOLVED now (see my signature).
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] cant fix: "CLEAR: command not found" when trying to execute in terminal. "CLEAR" is part of code not the command to wipe the terminal screen Kintaro Linux - Newbie 12 08-03-2020 04:27 PM
strange message "Not Acceptable! ..." skippy1729 Ubuntu 11 09-27-2014 03:36 AM
Please HEEELP...Softphone problem "488 Not acceptable here" Jaybul Linux - Software 8 03-19-2010 08:48 PM
NIC not acceptable at RH8 mazlan Linux - Newbie 2 09-18-2006 11:10 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 02:51 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration