How to remove ^C from the path directory terminal [Linux] [closed] - linux

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 6 years ago.
Improve this question
In Linux when I type "CTRL+C" to cancel the current line and move to the next, I get the following symbol "^C" below showing that I have cancelled the previous command as shown below:
sqldba#SQL-linux-001:/etc# ^C
sqldba#SQL-linux-001:/etc#
I would like to remove the "^C" symbol from showing when I cancel from my previous command and show it as below without the "^C" symbol. Basically the same as when you press enter on an empty line, it will show the below. I would like the same as when "CTRL+C" is used
sqldba#SQL-linux-001:/etc#
sqldba#SQL-linux-001:/etc#
I am unsure of the file to edit to make this change, whether it can be done in the .bashrc profile or the .bash_profile
Thanks.

pipe it through a stream editor. Try this:
echo $PATH | sed 's/^C//g'
Not entirely sure this is what you want, so please clarify. What this will do is remove all instances of ^C from your PATH system variable.
If this is not what you want, take a look at https://unix.stackexchange.com/questions/26047/how-to-correctly-add-a-path-to-path as well as man sed

Related

Current path is not showing in terminal for new CentOS user [closed]

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
I have created a new user on a CentOS server. I don't know why, but when I connect with this new user the current path is not showing in the terminal. Instead, I can see '-bash-4.2'. What is the meaning of -bash-4.2 and how can I display the current path (such as /home)?
Your current prompt variable ($PS1) contains something like \s-\v\$ which corresponds to the name of the shell and its version. To have the prompt display the current path (along with the trailing $ you currently have), set PS1 with this:
PS1='$PWD\$ '
Using either of \w or \W will produce similar results, except for your home directory.
To keep this setting going forward, you'll want to set that value in your ~/.bashrc file.
See more options in the bash manual under PROMPTING or online at https://www.gnu.org/savannah-checkouts/gnu/bash/manual/html_node/Controlling-the-Prompt.html#Controlling-the-Prompt

Unable to remove file on Linux [closed]

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 2 years ago.
Improve this question
I'm currently connected to a remote computer running on Linux and I have a random directory that arose after running one of my C programs. The directory name is of this form: 'H$'204'blahblah''u$'[]'$'234', very strange.
When I try to remove it via rm dir_name the terminal spits out Illegal variable name. The same behavior arises even when I use the -f flag. Then I attempted to remove it by clicking on the directory in the explorer (on vscode) and I get an error saying Error: ENOENT: no such file or directory.
I'm running this on csh shell if that helps.
Update: Running: rm ./H<tab> worked. Thanks to Jamie Guinan!
The magic word is ls -b. It will display non printable characters in an escaped way, so that you will be able to enter them back.

how can I set my new new terminal to retain session of previous terminals? [closed]

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 2 years ago.
Improve this question
In linux, (on my mac, i can do this in the settings in iterm2) how can I set up my terminal emulator so that my session is maintained for each new terminal I open?
eg: if I am in ~/code/ folder in my terminal, the I open a new terminal, i should be in the ~/code/ folder in the new terminal too, not ~/
my usecase is that I don't lose context when working with i3
is there a setting or a recommended emulator that can do this, is it possible to complete this implementation programmatically?
I'm not sure why you want to do this, as you can simply reach a "frequently" cded directory by searching in the history of commands.
However, if you really want to do it, one (dirty?) trick would be adding this in your .bashrc:
# this is in ~/.bashrc
exit() {
sed -i '${
/^cd /{c\cd '"$PWD
"'q};a\cd '"$PWD
}" $HOME/.bashrc
command exit
}
What it does is (implicitly) printing all lines up to and including the second to last line, then on the last line ($) it checks if the last line starts with cd followed by space; if it does, it changes it to cd $PWD and quits; if it doesn't, the cd $PWD line is _aappended.

unlimited scrolling up from default linux command line [closed]

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 7 years ago.
Improve this question
I am looking to increase the default size of the scrolling up buffer from linux command line. It is a Debian server without gui.
I don't find related option in bashrc and I don't even know if there is other configuration file for the default prompt alt+f1 alt+f2 ...
You can change the scrollback-buffer size using kernel options as described here: https://wiki.archlinux.org/index.php/Scrollback_buffer .
However, if you are interested in the output of a command but at the same time you want to watch the command's progress interactively I suggest to use tee:
command | tee out.file
or if you want to append to a file use
command | tee -a out.file
tee is nice! use it! :)

what SED -i does [closed]

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 8 years ago.
Improve this question
Can anyone help explain what the command does on Ubuntu/Debian? Note there is no file called default. But there is one call default-ssl.conf.
sed -i '/AllowOverride None/c AllowOverride All' /etc/apache2/sites-available/default
[Added]I searched the help page already but I am too new to understand the texts.
[Added 2]I conclude it is an ill command.
It won't do anything if there is no file called default.
However, the -i flag means edit in-place, so it changes the file sed was run on.
In place means make changes to the file by actually changing the file, rather than leaving it intact and printing a new copy with the changes sed would make to stdout.
For more information on sed in general, I recommend reading the sed info page - info sed

Resources