Score:0

Terminal: command which clears only outputs of historical commands

cn flag

Is their in terminal a command similar as clear or ctrl+l which only clears the output of commands I passed in.

For example my shell looks like this

martin@martin-LINCPLUS-P4:~/Git$ 
martin@martin-LINCPLUS-P4:~/Git$ branch
Command 'branch' not found, but can be installed with:
sudo apt install rheolef
martin@martin-LINCPLUS-P4:~/Git$ git branch
* feature-a
  main
martin@martin-LINCPLUS-P4:~/Git$ 

my aim view after the command should like this

martin@martin-LINCPLUS-P4:~/Git$ 
martin@martin-LINCPLUS-P4:~/Git$ branch
martin@martin-LINCPLUS-P4:~/Git$ git branch
martin@martin-LINCPLUS-P4:~/Git$ 
Score:1
cn flag

No, but a Ctrl+L followed by the command history will show you recent commands without their output.

You will see a number in the front of these previous commands. You can execute any command again by entering !###, where ### is the number you see before the command.

Other ways to re-execute previous commands are 1) arrow up until the command reappears; 2) reverse search: hit CtrlR then type a few letters from the command until it appears.

Once you quit a current terminal session, the commands of the current session are appended to the file ~/.bash_history. You can see these commands with the command cat ~/.bash_history.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.