Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
I'm working with the sed editor and I realize that my command prompt is:
[darkchild#localhost ~]$
How can I change this so that it ends in #....and what does this mean?
for example:
[darkchild#localhost ~]#
A friend told me to write this command #!/bin/bash but it does not change the prompt to #.
Can someone educate me?
Canonically # means root shell. You probably do not actually want to do this, because it would confuse other users of your system. If you do actually want to do this, you can edit the PROMPT variable.
http://tldp.org/HOWTO/Bash-Prompt-HOWTO/
You can run the following command:
set prompt=\[`id -nu`#`hostname -s`\]\#\
This is the root user. You can go to this user using the su command.
More info: http://en.wikipedia.org/wiki/Su_(Unix)
Related
Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 9 years ago.
Improve this question
I need to execute the script after system boot.
For example:
(sleep 5 && (sudo dhcpcd wlp4s0))
What I need: Executing the script.
What I have: [sudo] password for eugene:
I has been edited /etc/sudoers so:
eugene ALL=NOPASSWD: /home/eugene/dhcpcdstart.sh
But it's ineffectually. How I can to execute the current script without password?
Arch Linux 2013.05.01
I just tested your sudoers configuration and it works (not with dhcpcd, since I don't have it). Just make sure that you put that line at the end of sudoers file containing dhcpcd in the file list (I guess your script has executing rights for eugene user, but dhcpcd doesn't).
eugene ALL=NOPASSWD: dhcpcd_path/dhcpcd
Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 9 years ago.
Improve this question
like if I'm in a directory called makefile_assignment, what command would give me the higher up directories and display it like
/home/linux/ieng6/cs80w/public/makefile_assignment
I believe you're looking for:
pwd
Just the environment variable of $PWD
echo $PWD
The pwd command is what you are looking for.
The command is pwd (present working directory).
Usually, echo $PWD also works and produces the same answer.
pwd #present working directory
cd / #to your root directory
Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
I am receiving an error from an application I am running
The error looks like this:
I am curious what the dots mean in /usr/local/bin/../../etc/
Is this a shortcut I can use for something when writing a bash script?
I know this is probably a Linux noob question...
cd /usr/local/bin/../../etc/yarbu/conf/default
Is simply
cd /usr/etc/yarbu/conf/default
And that directory doesn't exist. It's likely located in /etc/yarbu/conf/default which is why it doesn't find it in /usr/etc...
.. is the shortcut for parent directory and . is the shortcut for current directory.
Well...
. means same directory
.. means parent directory
~ means home
/ means root
So,
/usr/local/bin/../../etc/yarbu/conf/default
is the same as,
/usr/etc/yarbu/conf/default
Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
Supposing that i want to know how my statements are axpanded and interpreted by the bash, how i'm supposed to act ?
Inside your script
set -x
to start debug and
set +x
to stop debug mode. This way, you can debug just a part of your script instead of all of the stuff.
try the debug mode:
bash -x script_name
Just guessing what you mean. Try set -v.
Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 11 years ago.
Improve this question
I just reformated my HD and had to overwrite my /home partition. Everything is fine in Linux Mint 11.
Except that the command stack recall with cursor up/down displays repeats of the same command.
Like:
ls
ls
ls
cd ~
should be:
ls
cd ~
Any ideas how to fix this?
Assuming you're using bash:
export HISTIGNORE="&"
I assume you're using bash.
Add this to to your ~/.bashrc
HISTCONTROL=ignoreboth