Console Commands (Solved)

Quick to answer questions about finding your way around Linux Mint as a new user.
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions use the other forums in the support section.
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Cheemag

Console Commands (Solved)

Post by Cheemag »

What am I to make of this nonsense:

Code: Select all

mint ~ # cd /
bash: cd /: No such file or directory
mint ~ # cd usr/bin
bash: cd usr/bin: No such file or directory
mint ~ # 
I know damn well that there is such a directory as /usr/bin !  Why can't I cd to it?

Also:  very often I issue a command without parameters, to be told to goto  <command> --help ... On doing so, I'm there's no
such command!!!!

Confused!
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 2 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
User avatar
MALsPa
Level 8
Level 8
Posts: 2040
Joined: Mon Nov 19, 2007 10:17 pm
Location: albuquerque

Re: Console Commands

Post by MALsPa »

Second one, left out the "/" looks like -- should be cd /usr/bin, right?

First one looks okay, I don't know.
DrHu

Re: Console Commands

Post by DrHu »

mint ~ # cd /
No time to experiment for you, but you seem to be root in your own home directory (~)
--that might also explain why some commands don't work for you; they are not in root's PATH

  • cd /
    drhu@Mint / $ cd usr/bin
    drhu@Mint /usr/bin $
Yup looks ok, and of course there should be a /bin and a /usr/bin directory
So what does your ls / show as being available ?
User avatar
MALsPa
Level 8
Level 8
Posts: 2040
Joined: Mon Nov 19, 2007 10:17 pm
Location: albuquerque

Re: Console Commands

Post by MALsPa »

Cheemag wrote:What am I to make of this nonsense:

Code: Select all

mint ~ # cd /
bash: cd /: No such file or directory
mint ~ # cd usr/bin
bash: cd usr/bin: No such file or directory
mint ~ # 
Well, the 2nd command won't work if the first one doesn't, from where you are.

Code: Select all

root[~]#  cd usr/bin
bash: cd: usr/bin: No such file or directory
The question is, why doesn't the first one work?

Code: Select all

root[~]#  cd /
root[/]#  cd usr/bin
root[/usr/bin]#
Does this one work?

Code: Select all

root[~]#  cd ..
root[/]#
Cheemag

Re: Console Commands

Post by Cheemag »

MALsPa wrote:Second one, left out the "/" looks like -- should be cd /usr/bin, right?

First one looks okay, I don't know.
OK:

Code: Select all

mint mint # 
mint mint # whoami
root
mint mint # cd /usr/bin
bash: cd /usr/bin: No such file or directory
mint mint # 
Cheemag

Re: Console Commands

Post by Cheemag »

DrHu wrote:
mint ~ # cd /
No time to experiment for you, but you seem to be root in your own home directory (~)
--that might also explain why some commands don't work for you; they are not in root's PATH
Yes, I am root in /home:

Code: Select all

mint mint # 
mint mint # pwd
/home/mint
mint mint # 
mint mint # 
mint mint # ls
Desktop    Download  Pictures  Public     Tempo
Documents  Music     Projects  Templates  Videos
mint mint # 
mint mint # 
What's wrong with being root in /home ? (I don't have any of these problems moving around
directories in my other distro!)

So how do I get access to "/", to /usr/bin or any other directory for that matter?  I've been there in Krusader, but don't
have permission to do anything there.
  • cd /
    drhu@Mint / $ cd usr/bin
    drhu@Mint /usr/bin $
Yup looks ok, and of course there should be a /bin and a /usr/bin directory
So what does your ls / show as being available ?
It may well work for you, but it doesn't for me.

Code: Select all

mint mint # ls
Desktop    Download  Pictures  Public     Tempo
Documents  Music     Projects  Templates  Videos
mint mint # 

mint mint # pwd
/home/mint
mint mint # 
StanTheMan

Re: Console Commands

Post by StanTheMan »

The only way I couuld approximately duuplicate your line , is to separate the cd with something else besides a space , such as 'underline' as here - - -

stanley@mydesktop / $ cd_/
bash: cd_/: No such file or directory
Chasester

Re: Console Commands

Post by Chasester »

what do you get if you type

Code: Select all

find /usr/bin
User avatar
MALsPa
Level 8
Level 8
Posts: 2040
Joined: Mon Nov 19, 2007 10:17 pm
Location: albuquerque

Re: Console Commands

Post by MALsPa »

Cheemag, I think you might have missed DrHu's question -- or at least the "/" at the end:
DrHu wrote:So what does your ls / show as being available ?
Here, I get:

Code: Select all

steve[~]$  ls /
bin    dev   initrd          lib         mnt   sbin  tmp  vmlinuz
boot   etc   initrd.img      lost+found  proc  srv   usr  vmlinuz.old
cdrom  home  initrd.img.old  media       root  sys   var
Either that command or find /usr/bin (as Chasester mentioned) might shed a little light on the mystery.
Cheemag

Re: Console Commands

Post by Cheemag »

Chasester wrote:what do you get if you type

Code: Select all

find /usr/bin
OK:

Code: Select all

mint mint # whoami
root
mint mint # pwd
/home/mint
mint mint # 
mint mint # find /usr/bin
bash: find /usr/bin: No such file or directory
mint mint # 
It DOES exist (obviously); I've been there in Krusader, but unable to do
anything.

I'm clearly root as whoami shows (I get there with a console root launcher) so I
should be able to surf the directory system.

Why am I getting two 'mints' before the hash at the prompt? Others of you seem to be able
to become something other than 'mint'. I was never asked for a user-name or password at
any stage of the installation.
Cheemag

Re: Console Commands

Post by Cheemag »

MALsPa wrote:Cheemag, I think you might have missed DrHu's question -- or at least the "/" at the end:
DrHu wrote:So what does your ls / show as being available ?
Here, I get:

Code: Select all

steve[~]$  ls /
bin    dev   initrd          lib         mnt   sbin  tmp  vmlinuz
boot   etc   initrd.img      lost+found  proc  srv   usr  vmlinuz.old
cdrom  home  initrd.img.old  media       root  sys   var
Either that command or find /usr/bin (as Chasester mentioned) might shed a little light on the mystery.
Indeed I did miss the oblique stroke in DrHu's post. Apologies.

Code: Select all

mint mint # whoami
root
mint mint # pwd
/home/mint
mint mint # ls /
bash: ls /: No such file or directory
mint mint # 
mint mint # 
Cheemag

Re: Console Commands

Post by Cheemag »

Cheemag wrote:[

Indeed I did miss the oblique stroke in DrHu's post. Apologies.

Code: Select all

mint mint # whoami
root
mint mint # pwd
/home/mint
mint mint # ls /
bash: ls /: No such file or directory
mint mint # 
mint mint # 
It gets worse, much worse:

Code: Select all

mint@mint ~ $ pwd
/home/mint
mint@mint ~ $ whoami
mint
mint@mint ~ $ ls
Desktop    Download  Pictures  Public     Tempo
Documents  Music     Projects  Templates  Videos
mint@mint ~ $ ls Download
ls Download: command not found
mint@mint ~ $ ls Documents
ls Documents: command not found
mint@mint ~ $ 

Seems I'm also unable to access my /home directory, even when root.
User avatar
MALsPa
Level 8
Level 8
Posts: 2040
Joined: Mon Nov 19, 2007 10:17 pm
Location: albuquerque

Re: Console Commands

Post by MALsPa »

Quite puzzling -- not least of all, this:
Cheemag wrote:Why am I getting two 'mints' before the hash at the prompt? Others of you seem to be able
to become something other than 'mint'. I was never asked for a user-name or password at
any stage of the installation.
Yeah, you're supposed to be prompted for a username during the installation. Is yours a brand new installation? If so, maybe you should reinstall. Sorry, I have no idea what's going on with your system.
Cheemag

Re: Console Commands

Post by Cheemag »

MALsPa wrote:Quite puzzling -- not least of all, this:
Cheemag wrote:Why am I getting two 'mints' before the hash at the prompt? Others of you seem to be able
to become something other than 'mint'. I was never asked for a user-name or password at
any stage of the installation.
Yeah, you're supposed to be prompted for a username during the installation. Is yours a brand new installation? If so, maybe you should reinstall. Sorry, I have no idea what's going on with your system.
Well, it's a month or two old on a 16GB key. I was never asked for a username or password
at any stage.

Fortunately there is practically nothing in the installation as yet, regarding programmes or
data, so yes I'll try a re-install,

Thank you all for your help.
caris_mere

Re: Console Commands

Post by caris_mere »

If it's on a USB key, like you mentioned, it could be that your file system has been corrupted. I had strange problems like that (not quite so bad, though), when my usb stick had been improperly disconnected. Can you run a fsck on the key?
Cheemag

Re: Console Commands

Post by Cheemag »

caris_mere wrote:If it's on a USB key, like you mentioned, it could be that your file system has been corrupted. I had strange problems like that (not quite so bad, though), when my usb stick had been improperly disconnected. Can you run a fsck on the key?
Not at the moment as the machine is in XP. I always remove the key safely (in XP).

In any case, I re-installed Helena. Twice. The first time I used the latest pen-drive installer
from http://www.pendrivelinux.com The results were spectacularly bad.

I then used pendrivelinux's older installer and got back more-or-less to where I was before
with the exception that I can now navigate the file system as 'mint', but it won't accept
sudo root. The logout screen says I'm logged in as a 'live session user' which makes it
appear as though I were running the system from a live CD (?) Possibly Mint 8 on a key
is in fact a live disc and you can't have a full system on a key (?)

I shall try to put a root console launcher in place to see what that will allow me to do.
I think it's " gnome-terminal -e 'sudo su' " (?) as the launcher parameter.
gn2

Re: Console Commands

Post by gn2 »

How do you plan on getting root access when you don't have a password...?
What you have is a persistent Live USB.
This is not a full installed system, it will always run as a Live Session.
Once you have a proper fully installed system you will have a username, password and admin privileges.
Cheemag

Re: Console Commands

Post by Cheemag »

gn2 wrote:How do you plan on getting root access when you don't have a password...?
What you have is a persistent Live USB.
This is not a full installed system, it will always run as a Live Session.
Once you have a proper fully installed system you will have a username, password and admin privileges.
I understood that it was a properly installed system.

I was root yesterday in the previous install, but couldn't browse the file system.
In this new install I can browse the file system as 'mint'. I'll try to install a root
console again, see what happens.

If I can't get it to work then, ah well. Nice distro, but I don't have another computer to
install it on. Pity.
Cheemag

Re: Console Commands

Post by Cheemag »

gn2 wrote:How do you plan on getting root access when you don't have a password...?
What you have is a persistent Live USB.
This is not a full installed system, it will always run as a Live Session.
Who says you can't be root with a persistent live session on a key? o)

Code: Select all

 ________________________________________
( Celebrate Hannibal Day this year. Take )
( an elephant to lunch.                  )
 ----------------------------------------
  o
   o
       ___  
     {~._.~}
      ( Y )
     ()~*~()   
     (_)-(_) 
  
mint mint # whoami
root
mint mint # ls
Desktop  Documents  Downloads  Music  Pictures  Public  Templates  Videos

mint mint # cd /
mint / # ls
bin   cdrom  etc   initrd.img  media  opt   rofs  sbin     srv  tmp  var
boot  dev    home  lib         mnt    proc  root  selinux  sys  usr  vmlinuz
mint / #
 
Done by generating a root console launcher with gnome-terminal -e 'sudo - su'
Whether I can actually DO anything remains to be be seen - best not mess around
in root.
Cheemag

Re: Console Commands

Post by Cheemag »

Cheemag wrote:
gn2 wrote:How do you plan on getting root access when you don't have a password...?
What you have is a persistent Live USB.
This is not a full installed system, it will always run as a Live Session.
Once you have a proper fully installed system you will have a username, password and admin privileges.
I understood that it was a properly installed system.

I was root yesterday in the previous install, but couldn't browse the file system.
In this new install I can browse the file system as 'mint'. I'll try to install a root
console again, see what happens.

If I can't get it to work then, ah well. Nice distro, but I don't have another computer to
install it on. Pity.
I'll have to give up on this idea as the system is no longer saving my
settings from session to session.

It's all a bag of nails this persistent key business ...
Locked

Return to “Beginner Questions”