How to enter token without leaving history in terminal? [closed] - bash

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 trying to call GitHub API in the terminal. It requires to input the username and token. Token are entered with plain text. For security purposes, I don't feel like leaving some token history on this public computer.
How can I enter the token without leaving history?

If $HISTCONTROL is set to ignorespace or ignoreboth (which is the default):
You can type a space before the command to prevent it from being recorded in the history.
See also: https://unix.stackexchange.com/a/115922/198262
If you need to use this command several times, you can first store the token in a variable and prefix the variable assignment with a space and then just use the variable in your commands without having to remember the space. You could also disable the history for the current session entirely using set +o history.

Related

Where does the file ''$'\033\033\033' come from in Linux? [closed]

Closed. This question is not about programming or software development. 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 11 days ago.
Improve this question
In my directory at a Linux server I have discovered a file with such a strange name.
From the command history I can track that it was probably created by this command:
sudo docker logs <container_id> -n 200000 | less
I suspect I have entered some combination of letters in less (probably starting with s to save a file).
Do you know what exactly has happened?
P.S. If you want to remove such a file, see How to escape the escape character in bash?
I have discovered that such a file is created when you type s in a piped less and then you are asked to enter the log file name. If you type triple Escape and then Enter, you will get such a file.
The command s is actually helpful to save the contents of a piped less.

How to show output one screen by another [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 last year.
Improve this question
Hi I use command "cat ansible.cfg". Once the command is entered, all the output goes away on the screen. I want to see it one screen by one. What correct command should i use? Thank you
This isn't really an ansible question, as you are really just using the cat command to view a text tile that happens to be an ansible config.
See this link for information on how to view files in Unix/Linux: https://www.baeldung.com/linux/files-cat-more-less
In short, however, less and more are both utilities for viewing files one page at a time like you requested. Just enter more ansible.cfg and then use the space bar to advance a page at a time.

% sign in terminal command line rather than $ sign [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 am using Terminal on MacOS. My main concern is that I’m commonly seeing command lines starting with the ‘$’ sign.
My command lines begins with a ‘%’ sign. Does this matter? If so, what is the reason?
The reason is that bash is no longer the default shell in macos. The default shell is now zsh which has certain advantages, such as floating-point operators.
You may set the Terminal default shell back to bash if needed. It's path is simply /bin/bash

What does !vi mean? [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 6 years ago.
Improve this question
I'm watching a video course on bash programming and the lecturer is constantly switching back and forth between his instance of the vi text editor and the command line by exiting out of vi and coming back in using this command: !vi. What I'm able to infer from this is that it probably means open vi along with the last file that was in the process of editing before vi was closed, but when I try doing that in my command line, that's not what happens. Vi just opens up with its welcome message.
In Bash, !vi expands to the most recent command starting with "vi". See History Expansion in the Bash manual.

How I save the history of my commands in Windows(7) Command Prompt? [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 9 years ago.
Improve this question
I have realized that when I log out from the computer, the Command Prompt history gets deleted (or at least when I press the arrow keys (or F7) nothing appears. How I can set the command promt to not to delete my command history.
There isn't an option to do so. However, you can use clink which has that feature (although it comes with readline-style line editing and several other bash-isms that might not be wanted or needed).

Resources