|
Home > Archive > Unix questions > February 2006 > chmod question
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
|
|
|
| Learning the wonderfull world of UNIX and have a question I can't answer or
google.After I change the security of a file using the command:
chmod 750 mybiog
I use the command:
ls -1 mybiog
to check and instead of the security attributes:
-rwxr-x--- 1 user group 26 Feb mybiog
I get only the file name. I'm performing it right off the assigned text
with no joy! I'm using the bash shell. Any usefull suggestions?
TIA,
David
| |
| Michael Paoli 2006-02-27, 2:48 am |
| Gman wrote:
> I use the command:
> ls -1 mybiog
> to check and instead of the security attributes:
> -rwxr-x--- 1 user group 26 Feb mybiog
> I get only the file name. I'm performing it right off the assigned text
> with no joy! I'm using the bash shell. Any usefull suggestions?
references/excerpts:
ls(1)
-l use a long listing format
-1 list one file per line
| |
| Chris F.A. Johnson 2006-02-27, 2:48 am |
| On 2006-02-27, Gman wrote:
> Learning the wonderfull world of UNIX and have a question I can't answer or
> google.After I change the security of a file using the command:
> chmod 750 mybiog
> I use the command:
> ls -1 mybiog
> to check and instead of the security attributes:
> -rwxr-x--- 1 user group 26 Feb mybiog
> I get only the file name.
That's all you are asking for: a listing of filenames, one to a
line.
If you want the detailed listing, use:
ls -l ## That's a lowercase L, not the number one.
> I'm performing it right off the assigned text
> with no joy! I'm using the bash shell. Any usefull suggestions?
--
Chris F.A. Johnson, author | <http://cfaj.freeshell.org>
Shell Scripting Recipes: | My code in this post, if any,
A Problem-Solution Approach | is released under the
2005, Apress | GNU General Public Licence
| |
|
|
"Chris F.A. Johnson" <cfajohnson@gmail.com> wrote in message
news:ff6ad3-18i.ln1@xword.teksavvy.com...
> On 2006-02-27, Gman wrote:
>
> That's all you are asking for: a listing of filenames, one to a
> line.
>
> If you want the detailed listing, use:
>
> ls -l ## That's a lowercase L, not the number one.
>
>
>
> --
> Chris F.A. Johnson, author | <http://cfaj.freeshell.org>
> Shell Scripting Recipes: | My code in this post, if any,
> A Problem-Solution Approach | is released under the
> 2005, Apress | GNU General Public Licence
Thanks, It always comes down to "attention to detail"
Any idea why when I'm in bash instead of a $ prompt I get a !# prompt?
Thanks again!
David
| |
| Chris F.A. Johnson 2006-02-27, 2:48 am |
| On 2006-02-27, Gman wrote:
>
> "Chris F.A. Johnson" <cfajohnson@gmail.com> wrote in message
> news:ff6ad3-18i.ln1@xword.teksavvy.com...
>
> Thanks, It always comes down to "attention to detail"
> Any idea why when I'm in bash instead of a $ prompt I get a !# prompt?
Probably because you are logged in as root -- not a good idea.
--
Chris F.A. Johnson, author | <http://cfaj.freeshell.org>
Shell Scripting Recipes: | My code in this post, if any,
A Problem-Solution Approach | is released under the
2005, Apress | GNU General Public Licence
| |
| Jordan Abel 2006-02-27, 2:48 am |
| On 2006-02-27, Gman <davidg35@REMOVEcox.net> wrote:
> Learning the wonderfull world of UNIX and have a question I can't answer or
> google.After I change the security of a file using the command:
> chmod 750 mybiog
> I use the command:
> ls -1 mybiog
> to check and instead of the security attributes:
> -rwxr-x--- 1 user group 26 Feb mybiog
> I get only the file name. I'm performing it right off the assigned text
> with no joy! I'm using the bash shell. Any usefull suggestions?
> TIA,
> David
-[ell], not -[one].
| |
| Keith Thompson 2006-02-27, 2:48 am |
| "Gman" <davidg35@REMOVEcox.net> writes:
[...]
> Thanks, It always comes down to "attention to detail"
> Any idea why when I'm in bash instead of a $ prompt I get a !# prompt?
Is it really "!#", not just "#"?
Bash's prompt is determined by the value of the $PS1 variable. This:
echo "$PS1"
will show you its current value. Either it has a literal '#'
character in it, or it has a "\$" sequence, which expands to a '#'
character if you're running as root, or a '$' character if you're not.
(If you're running as root, you probably shouldn't be; use root only
when you actually need it.)
--
Keith Thompson (The_Other_Keith) kst-u@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.
| |
|
|
"Keith Thompson" <kst-u@mib.org> wrote in message
news:lny7zx9xzg.fsf@nuthaus.mib.org...
> "Gman" <davidg35@REMOVEcox.net> writes:
> [...]
>
> Is it really "!#", not just "#"?
>
> Bash's prompt is determined by the value of the $PS1 variable. This:
> echo "$PS1"
> will show you its current value. Either it has a literal '#'
> character in it, or it has a "\$" sequence, which expands to a '#'
> character if you're running as root, or a '$' character if you're not.
>
> (If you're running as root, you probably shouldn't be; use root only
> when you actually need it.)
>
> --
> Keith Thompson (The_Other_Keith) kst-u@mib.org
> <http://www.ghoti.net/~kst>
> San Diego Supercomputer Center <*>
> <http://users.sdsc.edu/~kst>
> We must do something. This is something. Therefore, we must do this.
Here's a cut of the screen: gnix:[students/deguenth] !%
| |
| Jordan Abel 2006-02-27, 8:48 pm |
| On 2006-02-27, Gman <davidg35@REMOVEcox.net> wrote:
>
> "Keith Thompson" <kst-u@mib.org> wrote in message
> news:lny7zx9xzg.fsf@nuthaus.mib.org...
>
> Here's a cut of the screen: gnix:[students/deguenth] !%
what shell are you using? some shells use % instead of $ [why did you
say # when you didn't mean it?]
| |
| Bill Marcum 2006-02-27, 8:48 pm |
| On Sun, 26 Feb 2006 23:50:40 -0700, Gman
<davidg35@REMOVEcox.net> wrote:
>
> Here's a cut of the screen: gnix:[students/deguenth] !%
>
Are you sure you are running bash? Try this:
echo $SHELL
echo $BASH_VERSION
--
A critic is a bundle of biases held loosely together by a sense of taste.
-- Whitney Balliett
| |
|
|
"Bill Marcum" <bmarcum@iglou.com> wrote in message
news:emnbd3-rqk.ln1@don.localnet...
> On Sun, 26 Feb 2006 23:50:40 -0700, Gman
> <davidg35@REMOVEcox.net> wrote:
> Are you sure you are running bash? Try this:
> echo $SHELL
> echo $BASH_VERSION
>
>
> --
> A critic is a bundle of biases held loosely together by a sense of taste.
> -- Whitney Balliett
Makes things interesting. My teacher was unable to figure it out either!
Here's the cut from the screen:
gnix:[students/deguenth] !%echo $SHELL
/bin/bash
gnix:[students/deguenth] !%echo $BASH_VERSION
2.05b.0(1)-release
gnix:[students/deguenth] !%
| |
| Jeremiah DeWitt Weiner 2006-02-27, 8:48 pm |
| Gman <davidg35@removecox.net> wrote:
> Makes things interesting. My teacher was unable to figure it out either!
> Here's the cut from the screen:
> gnix:[students/deguenth] !%echo $SHELL
> /bin/bash
> gnix:[students/deguenth] !%echo $BASH_VERSION
> 2.05b.0(1)-release
> gnix:[students/deguenth] !%
Did you or your teacher try 'echo $PS1'? From the man page:
PS1 The value of this parameter is expanded (see
PROMPTING below) and used as the primary prompt
string.
Frankly, I would find a better teacher if your current one is unable to
explain prompting.
--
Oh to have a lodge in some vast wilderness. Where rumors of oppression
and deceit, of unsuccessful and successful wars may never reach me
anymore.
-- William Cowper
| |
| Jordan Abel 2006-02-27, 8:48 pm |
| On 2006-02-27, Gman <davidg35@REMOVEcox.net> wrote:
>
> "Bill Marcum" <bmarcum@iglou.com> wrote in message
> news:emnbd3-rqk.ln1@don.localnet...
>
> Makes things interesting. My teacher was unable to figure it out either!
> Here's the cut from the screen:
> gnix:[students/deguenth] !%echo $SHELL
> /bin/bash
> gnix:[students/deguenth] !%echo $BASH_VERSION
> 2.05b.0(1)-release
> gnix:[students/deguenth] !%
try echo $PS1
| |
|
|
"Jordan Abel" <random832@gmail.com> wrote in message
news:slrne06mpt.1tsm.random832@random.yi.org...
> On 2006-02-27, Gman <davidg35@REMOVEcox.net> wrote:
>
> try echo $PS1
-----------------------------------
My teacher tried the same things with the same results. He's been teaching
UNIX about 9 years and hasn't seen this either.
Here's the new cut:
gnix:[students/deguenth] !%cd
gnix:[students/deguenth] !%echo $SHELL
/bin/bash
gnix:[students/deguenth] !%echo $BASH_VERSION
2.05b.0(1)-release
gnix:[students/deguenth] !%echo $PS1
gnix:[${PWD#${PWD%/*/*}/}] !%
gnix:[students/deguenth] !%
Thanks,
Gman
| |
| Jordan Abel 2006-02-27, 8:48 pm |
| On 2006-02-28, Gman <davidg35@REMOVEcox.net> wrote:
>
> "Jordan Abel" <random832@gmail.com> wrote in message
> news:slrne06mpt.1tsm.random832@random.yi.org...
> -----------------------------------
> My teacher tried the same things with the same results. He's been teaching
> UNIX about 9 years and hasn't seen this either.
> Here's the new cut:
> gnix:[students/deguenth] !%cd
> gnix:[students/deguenth] !%echo $SHELL
> /bin/bash
> gnix:[students/deguenth] !%echo $BASH_VERSION
> 2.05b.0(1)-release
> gnix:[students/deguenth] !%echo $PS1
> gnix:[${PWD#${PWD%/*/*}/}] !%
> gnix:[students/deguenth] !%
> Thanks,
> Gman
It looks like your PS1 is designed to run on a shell that doesn't have
its own prompting system
| |
| Bill Marcum 2006-02-28, 7:51 am |
| On Mon, 27 Feb 2006 10:39:05 -0700, Gman
<davidg35@REMOVEcox.net> wrote:
>
> "Bill Marcum" <bmarcum@iglou.com> wrote in message
> news:emnbd3-rqk.ln1@don.localnet...
>
> Makes things interesting. My teacher was unable to figure it out either!
> Here's the cut from the screen:
> gnix:[students/deguenth] !%echo $SHELL
> /bin/bash
> gnix:[students/deguenth] !%echo $BASH_VERSION
> 2.05b.0(1)-release
> gnix:[students/deguenth] !%
>
>
Apparently you are running bash, so one of the startup scripts must be
setting PS1. It could be /etc/profile, /etc/bash_bashrc, ~/.profile,
~/.bash_profile or ~/.bashrc, or a script sourced by one of those.
In any case, you should be able to change the prompt by modifying one of
these scripts, preferably ~/.bashrc.
--
Lake Erie died for your sins.
|
|
|
|
|