LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 07-18-2015, 03:50 PM   #1
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (15 current), Slack15, Ubuntu studio, MX Linux, FreeBSD 13.1, WIn10
Posts: 10,342

Rep: Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242
enalbing command-line history for root user


all I can find on the net is how to use commands in the terminal not how to set up command-line history especailly for my root account. where it is not enabled. so when ever I have to go to su to do things I do not have the little arrows to use to put back what i already wrote only getting them useless little marks on the screen instead.

does any one know whatit is I need to type in what file I need to put it in and where to make it golbal ? for root account, as it works in user account. oh yes I am using
Code:
bash -version
GNU bash, version 4.3.39(1)-release (x86_64-unknown-linux-gnu)
Copyright (C) 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>

This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

tanks
 
Old 07-18-2015, 04:15 PM   #2
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
http://www.linuxquestions.org/questi...9/#post2914160
 
Old 07-18-2015, 04:19 PM   #3
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (15 current), Slack15, Ubuntu studio, MX Linux, FreeBSD 13.1, WIn10
Posts: 10,342

Original Poster
Rep: Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242
Quote:
Originally Posted by Habitual View Post
Microsoft Windows assumes I am a dumb-ass. Linux demands that I prove it.

LMAO I like that one !!! lol
thanks for the info
 
Old 07-19-2015, 07:25 AM   #4
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
Quote:
Originally Posted by BW-userx View Post
thanks for the info
You are welcome. Did it resolve the situation?
 
Old 07-19-2015, 11:54 AM   #5
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (15 current), Slack15, Ubuntu studio, MX Linux, FreeBSD 13.1, WIn10
Posts: 10,342

Original Poster
Rep: Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242
Quote:
Originally Posted by Habitual View Post
You are welcome. Did it resolve the situation?
no --
I'm still pot shoting it. trying to do more than on thing at a time as well, getting dwm and the wifi applet and term and what ever else comes long that I noties needs taking care of and the documetaion on this Version of Linux is little to none.
VOID Linux - it is like a bare bones install - which has its good points in not a lot of stuff install that one may never used with its dependinces tied to it and other items installed.

the situation is in root account or user then going into su I lose all of that nice stuff that one can do in term using the arrow keys. everything. I'm not up on that jargon to explane it but when Ctlr + arrow to tab through more then one word, back and forth, or arrow up and down to go through the history of what was written in ROOT acount all of gone.

now that i have a little time to day it is on my list of things to try and get done with this Linux

edit

I've already added a .inputrc to Root home dir.
Code:
rw-r--r--  1 root root  200 Jul 18 16:24 bashrc-bk
# cat /root/.inputrc
$include /etc/inputrc


# mappings for Ctrl-left-arrow and Ctrl-right-arrow for word moving
"\e[1;5C": forward-word
"\e[1;5D": backward-word
"\e[1;5C": forward-word
"\e[1;5D": backward-word
"\e\e[C": forward-word
"\e\e[D": backward-word
this is in /etc/inputrc
Code:
# cat /root/.inputrc
$include /etc/inputrc


# mappings for Ctrl-left-arrow and Ctrl-right-arrow for word moving
"\e[1;5C": forward-word
"\e[1;5D": backward-word
"\e[1;5C": forward-word
"\e[1;5D": backward-word
"\e\e[C": forward-word
"\e\e[D": backward-word
# clear

# cat /etc/inputrc
# /etc/inputrc - global inputrc for libreadline
# See readline(3readline) and `info rluserman' for more information.

# Be 8 bit clean.
set input-meta on
set output-meta on

# To allow the use of 8bit-characters like the german umlauts, uncomment
# the line below. However this makes the meta key not work as a meta key,
# which is annoying to those which don't need to type in 8-bit characters.

# set convert-meta off

# try to enable the application keypad when it is called.  Some systems
# need this to enable the arrow keys.
# set enable-keypad on

# see /usr/share/doc/bash/inputrc.arrows for other codes of arrow keys

# do not bell on tab-completion
# set bell-style none
# set bell-style visible

# some defaults / modifications for the emacs mode
$if mode=emacs

# allow the use of the Home/End keys
"\e[1~": beginning-of-line
"\e[4~": end-of-line

# allow the use of the Delete/Insert keys
"\e[3~": delete-char
"\e[2~": quoted-insert

# mappings for "page up" and "page down" to step to the beginning/end
# of the history
"\e[5~": beginning-of-history
"\e[6~": end-of-history

# alternate mappings for "page up" and "page down" to search the history
"\e[5~": history-search-backward
"\e[6~": history-search-forward

# mappings for Ctrl-left-arrow and Ctrl-right-arrow for word moving
"\e[1;5C": forward-word
"\e[1;5D": backward-word
"\e[5C": forward-word
"\e[5D": backward-word
"\e\e[C": forward-word
"\e\e[D": backward-word

$if term=rxvt
"\e[8~": end-of-line
"\eOc": forward-word
"\eOd": backward-word
$endif

# for non RH/Debian xterm, can't hurt for RH/Debian xterm
"\eOH": beginning-of-line
"\eOF": end-of-line

# for freebsd console
"\e[H": beginning-of-line
"\e[F": end-of-line

$endif
#

Last edited by BW-userx; 07-19-2015 at 12:21 PM.
 
Old 07-19-2015, 03:59 PM   #6
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
Quote:
Originally Posted by BW-userx View Post
the documetaion on this Version of Linux is little to none.
VOID Linux - it is like a bare bones install...
and here I thought you were using Slackware.
 
Old 07-19-2015, 04:12 PM   #7
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (15 current), Slack15, Ubuntu studio, MX Linux, FreeBSD 13.1, WIn10
Posts: 10,342

Original Poster
Rep: Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242
Quote:
Originally Posted by Habitual View Post
and here I thought you were using Slackware.

this question is in General Linux not Slackware -- fyi



I am and I am got'a void Linux installed too. so yeah like I am getting fed up with this in Void so I said to myself, "self: I know I'll just boot into SLackware than copy what it is in Root that makes it do what I want over to Void." Looking in RoOt folder and their is no .bashrc no .bash_profile -- the only file about bash in /root is bash_history.

in the / partiton in slackware

Code:
# mount /dev/sda2 /mnt/temp
# cd /mnt/temp

# ls usr/bin/bash*
usr/bin/bash
# 

--
# ls etc/bash*
dbus-bash-completion.sh  grub  libreoffice.sh  mercurial.sh  udisks
#
I do not even know where Slackware keeps the files to tell the sys to show colors when in su -
and not to when in just su
in my user accounts I have the .bashrc and .inputrc files but it is my root account that I am trying to get set up so that I can have all of them commands that use the arrow keys to tab beteewn words and run through the command line history and my promt I cannot even get changed haaa

is is as you can see just a #
that's it

Last edited by BW-userx; 07-19-2015 at 06:15 PM.
 
Old 07-19-2015, 06:17 PM   #8
onebuck
Moderator
 
Registered: Jan 2005
Location: Central Florida 20 minutes from Disney World
Distribution: SlackwareŽ
Posts: 13,925
Blog Entries: 44

Rep: Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159
Member response

Hi,

You will need to create a #~.bashrc & #~.bsh_profile as point out by Habitual linking to an old post of mine. The root home is '/root' so you will create the .bashrc for root within that directory. The .bash_profile as shown is used to source the #~.bashrc.
This is my current .bash_profile & .bashrc;
Code:
I like to provide my users with this;
Code:
sample .bash_profile;   
~$ cat .bash_profile #-----------------cut----------------- # .bash_profile #08-30-06 12:21 # Source .bashrc if [ -f ~/.bashrc ]; then . ~/.bashrc fi #-----------------cut end--------------
Code:
 cat .bashrc
#-----------------cut-------------------

#.bashrc
#08-30-06 12:20 

# Add bin to path
export PATH="$PATH:$HOME/bin"

# Dynamic resizing
shopt -s checkwinsize
#
#save bash history so as to share

shopt -s histappend
PROMPT_COMMAND='history -a'

# Custom prompt 
#PS1='\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ ' 
#08-29-06 11:40 gws 
if [ `id -un` = root ]; then 
 PS1='\[\033[1;31m\]\h:\w\$\[\033[0m\] ' 
else
PS1='\[\033[1;32m\]\h:\w\$\[\033[0m\] ' 
fi 
# 
# Add color 
eval `dircolors -b` 
#Terminus is a very nice Unicode font for the Linux console
#02-02-12 gws
#from dugan's site http://duganchen.ca/writings/slackware/fonts/

#04-30-12 11:41 removed
#
#if [ $TERM = "linux" ]; then
# setfont ter-v16n
#fi

# User defined aliases
alias cls='clear'
alias clls='clear; ls'
alias ll='ls -l'
alias lsa='ls -A'
alias lsg='ls | grep'
alias lsp='ls -1 /var/log/packages/ > package-list'
alias na='nano'
alias web='links -g -download-dir ~/ www.google.com'

#08-29-06 11:50

#To clean up and cover your tracks once you log off
#Depending on your version of BASH, you might have to use
# the other form of this command
 trap "rm -f ~$LOGNAME/.bash_history" 0

#The older KSH-style form
#trap 0 rm -f ~$LOGNAME/.bash_history

#-----------------cut end--------------
I do like to set my alias to a simple form so it can be remembered. Also notice how history is handled. Just copy between the cut lines and paste into the proper file.

Quote:
Just a few links to aid you to gaining some understanding;


Hope this helps.
Have fun & enjoy!
 
Old 07-19-2015, 07:05 PM   #9
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (15 current), Slack15, Ubuntu studio, MX Linux, FreeBSD 13.1, WIn10
Posts: 10,342

Original Poster
Rep: Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242
Quote:
Originally Posted by onebuck View Post
Hi,

You will need to create a #~.bashrc & #~.bsh_profile as point out by Habitual linking to an old post of mine.

Hope this helps.
Have fun & enjoy!
I did that Habitual thing and just did yours in here and it is still not working.. though I just noticed as I use terminator -- not that that should matter but it is saying /bin/sh in the title not bash -- a lesser bash but bash -- so do you think that has something to do with it?
and I am so going to have to post a how to change my shell to bash .. loo loo loo
 
Old 07-19-2015, 10:39 PM   #10
onebuck
Moderator
 
Registered: Jan 2005
Location: Central Florida 20 minutes from Disney World
Distribution: SlackwareŽ
Posts: 13,925
Blog Entries: 44

Rep: Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159
Member response

Hi,

I too thought you were using Slackware Gnu/Linux. Which distribution are you using?

From my Slackware;
Code:
~# bash -version
GNU bash, version 4.3.30(1)-release (x86_64-slackware-linux-gnu)
Copyright (C) 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>

This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
In your OP;
Quote:
Originally Posted by BW-userx View Post
all I can find on the net is how to use commands in the terminal not how to set up command-line history especailly for my root account. where it is not enabled. so when ever I have to go to su to do things I do not have the little arrows to use to put back what i already wrote only getting them useless little marks on the screen instead.

does any one know whatit is I need to type in what file I need to put it in and where to make it golbal ? for root account, as it works in user account. oh yes I am using
Code:
bash -version
GNU bash, version 4.3.39(1)-release (x86_64-unknown-linux-gnu)
Copyright (C) 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>

This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
tanks
The line;
Quote:
GNU bash, version 4.3.39(1)-release (x86_64-unknown-linux-gnu)
does show a different bash and the gnu/Linux is unknown. By that line you are using 'bash'. Unless you changed your shell in the mean time then 'bash' from your version should perform.
 
Old 07-20-2015, 06:52 AM   #11
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (15 current), Slack15, Ubuntu studio, MX Linux, FreeBSD 13.1, WIn10
Posts: 10,342

Original Poster
Rep: Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242
Quote:
Originally Posted by onebuck View Post
Hi,

I too thought you were using Slackware Gnu/Linux. Which distribution are you using?

From my Slackware;
Code:
~# bash -version
GNU bash, version 4.3.30(1)-release (x86_64-slackware-linux-gnu)
Copyright (C) 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>

This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
In your OP;The line; does show a different bash and the gnu/Linux is unknown. By that line you are using 'bash'. Unless you changed your shell in the mean time then 'bash' from your version should perform.
not to make it sound like I'm trying to be rude with the truth, but if I this was about SLackware I'd have posted it in the Slackware Area, I have mentioned Slackware in here, but too I have mentioned Void Linux too to try and clear that up, but perhaps that is what is causing your confusion seeing the word Slackware or my other posts in Slackware Area asking questions too.

Because I do use Slackware but, that is my OTHER Linux I have installed on my laptop, it is the only other GUN/Linux I have that I can use to compare it to this one, when it comes to configuring the BASIC things. Because GNU/Linux should be, and is suppose to be GNU/Linux. But a lot of them other ones have been getting to close to being like a Windows Distro I found this one it is another none derivative of someone elses Idea of what they think GNU/Linux should be, (more like windows so more people will like it for its ease in use without learning how to do anything with it, ( and I too am still learning))

This is VOID Linux an independent distribution of GNU/Linux like Slackware is, that is one reason I decided to give it a try. It has its quirks like all the others, but still I like it. The only really bad thing about it is that it is way poorly documentanted in everything other then using their basic xbps package managament commands.

This is in user account. let me log out and into Root now to get what it says

Code:
[m@void ~]$ bash -version
GNU bash, version 4.3.39(1)-release (x86_64-unknown-linux-gnu)
Copyright (C) 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>

This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
[m@void ~]$
Can't get it when running the same commands sh -version or sh --version I just get an ilegal operation message.
but it is /usr/bin/sh is where it is located and it is in root that it seems the person that build this Void Linux desided to have the root use and Bash for everyone else- Lame as that is.

but I do not see how that would effect the .bashrc but I maybe wrong. the best thing I think for starters would be to get root user to use Bash too then move on to getting that setup right and proper.

edit
more:
when I am in Void Linux~ signed in a user account not root account, but a user account. Where it give me a /bin/bash to work in then go into su mode. I get just a # prompt and no more funcinality of my arrow keys in anything only getting this,

Code:
# su -
# ls
Desktop  bash_profile-bk  bashrc-bk  bashrc.bk
// this is up, down, left, right arrow then
// cltr+left , clrt + right arrows in su - 
// I do get the colored Directores using ls
# ^[[A^[[B^[[D^[[C^[[1;5D^[[1;5C
it repeats the very same output when I am in Just su mode.
if that output tells you anything

Last edited by BW-userx; 07-20-2015 at 07:53 AM.
 
Old 07-20-2015, 07:41 AM   #12
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
Quote:
Originally Posted by BW-userx View Post
but perhaps that is what is causing your confusion seeing the word Slackware
I am not confused. I got the Slackware reference from "Distribution: Slackware 14" shown under your summary on the left of each post. No need to be so defensive.
I'm just sayin'

Good Luck.
 
Old 07-20-2015, 07:58 AM   #13
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (15 current), Slack15, Ubuntu studio, MX Linux, FreeBSD 13.1, WIn10
Posts: 10,342

Original Poster
Rep: Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242
Quote:
Originally Posted by Habitual View Post
I am not confused. I got the Slackware reference from "Distribution: Slackware 14" shown under your summary on the left of each post. No need to be so defensive.
I'm just sayin'

Good Luck.
Not trying to be defensive, it's usally the "other guy" when I'm just trying to get to the truth of things so we can clear up some confusion to get onto better things is all. I do see I was correct in my assumtion you seen slackware somewhere to cause this confustion within your mind to what "version" Linux I was referring to in this problem that I poseted in the General Area and Not Slackware Area that they have in here for Slackware questions.

Neverthesless and just the same it shouldn't matter which "distro" so much with this basic set up of this because it is rudimentary GNU/Linux we are dealing with here, correct?

and thank you for bringing that to my attention I will make the necessary adjustments to alleviate that problem causing do hicky thingy (for a lack of a better way to put it )

Last edited by BW-userx; 07-20-2015 at 08:25 AM.
 
Old 07-20-2015, 08:44 AM   #14
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (15 current), Slack15, Ubuntu studio, MX Linux, FreeBSD 13.1, WIn10
Posts: 10,342

Original Poster
Rep: Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242
using google I change my question to how to change /bin/sh to /bin/bash then I found out how to change my shell from /bin/sh to /bin/bash this gave me what I was looking for on a different sight

Code:
Assuming the unknown shell supports running an absolute command, you could try: /bin/bash

To change the default shell, I would use chsh(1). Sample usage: chsh -s /bin/bash your_user
Sovled
 
Old 07-20-2015, 09:35 AM   #15
onebuck
Moderator
 
Registered: Jan 2005
Location: Central Florida 20 minutes from Disney World
Distribution: SlackwareŽ
Posts: 13,925
Blog Entries: 44

Rep: Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159
Member response

Hi,

Sorry for my confusion with the distribution. I did assume that you were using Slackware Gnu/Linux. Re-reading the entire thread to see where my mix up began. Just because someone calls there OS a Gnu/Linux does not imply a standard in use other than Gnu/Gpl. As you see apparently someone did change the shell which you have successively changed to bash. Apparently the maintainer wished too use the Bourne shell while root.

As to the placement of your thread, I see Slackware queries all the time in <Linux-General> so that is not really a problem for me. If not handled by members here in <Linux-General> then a Mod will elect to move too the appropriate forum.

If you feel the problem is solved then please mark it as Solved via the link at the top of the thread.
Hope this helps.
Have fun & enjoy!
 
  


Reply

Tags
bash, history, terminal



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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to check cpu temp. from command line as root user shailsysadm Linux - Server 2 07-25-2012 11:05 PM
command line history crickett Linux - General 13 12-17-2009 08:22 AM
root permissons to user command line chaitu_iiit Linux - Software 7 11-09-2004 06:54 AM
history with command line compu73rg33k Linux - Software 3 02-16-2004 03:36 AM
changing to root user without command line kaega2 Linux - Software 3 11-28-2003 03:14 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 11:58 PM.

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