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
When I telnet into our works sun station my backspace key doesn't work. I use a temporary workaround of:
$ stty erase ^H
This works but each time I telnet in I have to retype this. How can I set this to work properly in my .cshrc file?
You can put stty erase ^H in your .cshrc file. This will fix the problem.
When loging into a Solaris system ^H would be the default erase key. I assume your friendly administrator changed it to ^? somewhere in the profile files for your shell (have a look with stty -a). A possible reason would be to make Solaris behave more like other systems at this site. Therefore you may want to consider to change the behaviour of your telnet client (send ^? instead of ^H).
On a side note - telnet sends all information in the clear, including your username and password. SSH encrypts all communications, does everything telnet does and more. It is commonplace now, even on fairly recent versions of Solaris.
actually, I've run into multiple levels of this before. X windows sometimes
maps DEL to Backspace and vice versa. Sometimes logging into one machine through
another machine also does this.
Here's a comprehensive look at how to solve this:
http://www.ibb.net/~anne/keyboard.html
Related
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 1 year ago.
Improve this question
So I've been looking around on the web for some while now but this seems to be a tricky task.
I intended to change my default terminal on a Mint system from gnome to alacrity.
I had alacrity installed before on the same system and it seemed to be work fine.
I have not set up my root user or know the password for it so this makes this extra hard!
To change the default global behavior (e.g. pressing Crtl+Alt+T) modifying the /etc/passwd seemed reasonably to me.
This is what the last line looks now: user:x:1000:1000:User,,,:/home/user:/usr/bin/alacritty
But: If I want to open a shell now almost a thousand instances do appear once the command is triggered and after a short while the whole system crashes.
I don't know how to reset to the default setting since I need a shell and that tool is broken...
Here is what I tried so far
Try to use the shell env available at user log in: Login ends in an infinite loop
Try to open the /etc/passwd in graphical environment: Cannot modify the file (read only)
So here what I wish: Make this undone without reinstalling the operational system.
Thanks for your help and advice!
The field you are trying to change in /etc/passwd is used to set the per user shell (usually /bin/bash on Linux). The terminal emulator you want to use is can either be done with update-alternatives (system wise if you have root) on Debian based systems, or Window Manager specific configuration in general (GNOME, KDE, Xmonad etc).
Login in as root, and change the /etc/passwd file back to using a valid shell for the user in question. Not sure how you don't have a root user. If you don't have the root password then follow the normal password recovery process. Boot from a live or rescue cd. If it doesn't mount the file system for you, mount it manually then edit /mnt/etc/password (where /mnt is where the original file system was mounted). Unmount and reboot your system normally.
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 am relatively new to Linux. I'm running CrounchBang, a Debian distro as my personal workstation. It's not a server.
Here is my problem:
I wanted to change a password for myself (user) by typing: sudo passwd
Then it prompted me for user name and I thought I had to input root so I can get the right to change user password. I was wrong. Anyway, I changed a password for root.
I didn't loose or forget it so I can still do everything I want.. or so I think.. but now I notice "strange" behavior.
For example, I can not Power off sing Super-X -> Power off as I could before. It just says it's shutting down but does nothing. I have to use terminal: poweroff, then it prompts for root password, and only then it shuts down.
Another example is typing "login" into terminal. It responds with: login: Cannot possibly work without effective root
Being new to linux it's hard for me to remember exactly how it behaved before I set the root password but some things are definitely "weird" now.
Can anyone explain this to me or point to a solution? If possible with no workarounds (like adding myself to sudoers), I'd like to get it back to normal (default) behavior.
I'm not aware of any problems that unlocking root may lead you to (in fact, I've done it many times without any unpleasant consequences), but you can always revert the changes by issuing this command: sudo passwd -dl root
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
For example, when I'm entering a long command and I want to delete the second word, I want to be able to type <Esc> b b dw.
You can use set -o vi to use Vim-like shorcuts.
To make this permanent, you'll want to put this in your shell's rc file (e.g. for bash, put set -o vi in ~/.bashrc).
You should then log out and log back in, or just use $ source ~/.bashrc.
The best strategy depends on your experience with the command line.
I learned and got used to the default emacs-like mappings used in bash way before I started to learn Vim. They are too ingrained in my fingers for me to even consider enabling "vi mode". If you have more experience with bash than with Vim, I'd say that "vi mode" won't help you much. If, on the other hand, you have more Vim experience or are starting out with both, you may like the familiarity of "vi mode".
For what it's worth, I actually believe that "vi mode" is very close to useless. When on the command line, you are inserting text and Vi[m] is not better than others on that front. When you want to edit a command, "vi mode", with all its geeky shine, can't be compared with the power of a proper editor.
<C-x><C-e> provides the best editing experience you could ever dream of so why bother with the limited "vi mode"?
Try fc and fc -l for even more goodness.
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 looking for a tool that will tell me what my keyboard is sending to the operating system when i push different keys.
This is to help me answer this question How to get Cmd-left/right working with iTerm2 and Vim (without requiring .vimrc changes)? which has me trying to figure out why Vim treats my iTerm2 mapping of Cmd-left to Escape-[H differently from Home.
I tried unix's read, and it says that Home and Cmd-left both produce "^[[H". I'm hoping that read is misleading me, and that some other tool will show how Home and Cmd-left are different (note: when I say, Cmd-left in this paragraph, it is when iTerm2's mapping is turned on).
Thanks!
You're doing all this in a terminal, right?
I'm afraid you're not going to do much better than read (my preferred approach is to do cat > file, type, press ^D, and then look at the file in a hex editor).
With regard to the underlying question, it's worth hunting for options in your terminal emulator. Right now it's emulating a terminal which doesn't distinguish between HOME and CMD+LEFT. It may be possible to tell it to emulate a different terminal, which does.
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
Is there a way to prevent a command from being added to the bash shell's command history?
I would like to be able to prevent certain "dangerous" commands from being added to the history, such as "rm -rf ~/some/dir", so that it is not accessible to me by pressing the up-arrow to reach previous commands. In this way, it would not be possible to accidentally repeat one of these commands.
The reason I ask is that I use the up arrow a lot to access previous commands in the shell history, and have often caught myself about to hit enter on what I thought was the correct command, only to realise that I was about to do something stupid/annoying/dangerous. I don't like the idea of rms etc floating around in my shell history, waiting for me to step on them!
(Note: I am aware that one can set up patterns in HISTIGNORE, but what would be nice is something one can apply on a per-command basis, which would become good a habit. Unless there is a clever way to achieve this using HISTIGNORE that I have missed?)
On newer Bash Versions you could simply add a space at the beginning of your command. :)
If it doesn't work by default, add [ \t]* to HISTIGNORE. (As mentioned in the comments. thx)
Add ignorespace to your HISTCONTROL environment variable. Then any command line that begins with a space won't be entered into your history.