LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Questions about what 'mount' does (https://www.linuxquestions.org/questions/linux-newbie-8/questions-about-what-%27mount%27-does-306105/)

Mr Smokin Joe 03-25-2005 07:32 PM

Questions about what 'mount' does
 
While working on an SBC (TS 7200) running Red Hat, I entered the following:

mount /dev/mtdblock/1 /mnt

So far I understand I've mounted my filesystem (happened to be that particular partition) over again but now in /mnt. However, now all my files/directories are appended with the same characters.

An example snippet:

(here's a snippet of my /bin directory)
$ ls /bin
1;36maddgroup0m 1;36mdd0m 1;36mgunzip0m 1;36mmknod0m 1;36 mrm0m 1;36mtrue0m
1;36madduser0m 1;36mdelgroup0m 1;36mgzip0m 1;36mmktemp0m 1;36 mrmdir0m 1;36mumount0m
1;36mash0m 1;36mdeluser0m 1;36mhostname0m 1;36mmore0m 1;36 msed0m 1;36muname0m

Everything has 1;36m and 0m at the beginning and end, respectively. I'm curious as to what it means, and more importantly, how to get rid of it.

Thanks,

Joe

cs-cam 03-25-2005 10:46 PM

What shell are you running? That looks like your colours are screwed. Edit ~/.bashrc and remove the ls alias for a temporary solution.

tisource 03-25-2005 11:50 PM

You are trying to mount a local partition, right? I have never seen such device designations. Usually, its /dev/hda1 (first partition, first ATA hard drive) or /dev/sdb2 (second partition on the second SCSI hard drive).

perfect_circle 03-26-2005 12:06 AM

Quote:

Originally posted by DJ P@CkMaN
What shell are you running? That looks like your colours are screwed. Edit ~/.bashrc and remove the ls alias for a temporary solution.
Why haven't I thought of this...
1;36 is the code for the cyan color.
It's the default color for soft links. (at least in slack).
I think DJ P@CkMaN is right.

Instead of removing the ls alias try this first:
Code:

\ls /bin
If you see the files uncolored and without having code in the beginning, DJ P@CkMaN's theory is correct.

Mr Smokin Joe 03-26-2005 10:29 AM

Unfortunately, I did try your trick and everything is still listed as so. I'm also not quite sure where the .bashrc file is located. I also believe i'm running bourne shell.

Thanks again

Joe

perfect_circle 03-26-2005 11:24 AM

Quote:

Originally posted by Mr Smokin Joe
Unfortunately, I did try your trick and everything is still listed as so. I'm also not quite sure where the .bashrc file is located. I also believe i'm running bourne shell.

Thanks again

Joe

I don't get it....
I don't know if the \ before a command is only for bash, but it's supposed to run the real command (ls)
ignoring any existing allias.
The .bashrc is in the home directory of the user, but not all distros use it. Slackware only use ~/.profile (for each user) and
/etc/profile (for all users).

What distro are you using?

What is the output of this:
Code:

echo -e "\033[1;36mhello\033[0m"
If you get an error thy the command without the -e

Also, can you post us the output of printenv command?

Mr Smokin Joe 03-26-2005 11:53 AM

Running Red Hat.

Here's the first output:

Code:

$ echo -e "/033[1;36mhello\033[0m"
/033[1;36mhellom

And unfortunately, here's the second output:

Code:

$ printenv
-sh: printenv: not found

Thanks for all the help

Joe

Oliv' 03-26-2005 01:51 PM

hello,

you made a mistake: that's not echo -e "/033[1;36mhello\033[0m" but that's echo -e "\033[1;36mhello\033[0m"
and if it works, it should print hello in cyan color ;)
and if printenv does not work, try env command :)

Oliv'

Mr Smokin Joe 03-26-2005 02:03 PM

Code:

$ echo -e "\033[1;36mhello\033[0m"
;36mhellom

and

Code:

$ env
USER=root
HOME=/root
LOGNAME=root
TERM=linux
PATH=/usr/sbin:/bin:/usr/bin:/sbin
SHELL=/bin/sh
PWD=/root

Hope this works out. Thanks for the help again and again....

Joe

bigrigdriver 03-26-2005 03:55 PM

You might be using sh, and then again, you might not. Many distros symlink /bin/sh to /bin/bash. To verify, do this:
ls /bin/sh
If your output looks like this: /bin/sh -> bash, then you are using bash.

perfect_circle 03-26-2005 04:51 PM

Quote:

Originally posted by bigrigdriver
You might be using sh, and then again, you might not. Many distros symlink /bin/sh to /bin/bash. To verify, do this:
ls /bin/sh
If your output looks like this: /bin/sh -> bash, then you are using bash.

That makes sense. In fedora sh is a link to bash, but I don't know how old your distro is.
ALso u need to do
Code:

ls -l /bin/sh
to get the long format output.
In SuSE the ls for root is an allias to ls -la....something I think.
This is why a simple root ls outputs in long format, including hidden files.

Mr Smokin Joe 03-26-2005 05:30 PM

[/CODE]$ ls -l /bin/sh
lrwxrwxrwx 1 root root 7 Mar 1 2005 1;36m/bin/sh0m -> 1;32mb usybox0m[/CODE]

The distro should not be very old at ALL, I just bought this board last week, and the version of Red Hat it came with should be the most up-to-date.

Joe

perfect_circle 03-26-2005 05:46 PM

Quote:

Originally posted by Mr Smokin Joe
[/CODE]$ ls -l /bin/sh
lrwxrwxrwx 1 root root 7 Mar 1 2005 1;36m/bin/sh0m -> 1;32mb usybox0m[/CODE]

The distro should not be very old at ALL, I just bought this board last week, and the version of Red Hat it came with should be the most up-to-date.

Joe

busybox....
I had to search the net to see what this thing is.
Why don't you just time bash in the console to see what happens with the colors.

Oliv' 03-27-2005 06:36 AM

busybox: that's a sort of tiny bash... it's widely used in embedded systems with µlibc (or at least light libc)

Mr Smokin Joe 03-27-2005 12:13 PM

Quote:

Originally posted by perfect_circle

Why don't you just time bash in the console to see what happens with the colors.

Code:

$ time bash
time: cannot run bash
Command exited with non-zero status 127
real    0m 0.01s
user    0m 0.00s
sys    0m 0.01s

Well, an interesting this happened today when I booted up the board, everything works fine, heh. All the colors are correct and no crazy syntax is present everywhere:

Code:

$ ls -l /bin/sh
lrwxrwxrwx    1 root    root            7 Mar  1  2005 /bin/sh -> busybox

I Appreciate all the help i got, learned quite a bit in the process and I'll be probably seeing you all back on here soon.

Thanks a million,

Joe



Joe


All times are GMT -5. The time now is 12:59 PM.