How to clear the screen in your terminal in a shell script.
┌──(john㉿DESKTOP-PF01IEE)-[/mnt/c/Users/Intel i5/Music/Youtube] └─$ printf '\33c\e[3J' |
Just execute the printf statement and this will clear the screen. This will also clear the scrollback buffer as well.
This is another way to accomplish this task.
┌──(john㉿DESKTOP-PF01IEE)-[/mnt/c/Users/Intel i5/Music/Youtube] └─$ printf "\ec" |
This will also clear the scrollback buffer and the terminal window.
And yet another way of doing this.
┌──(john㉿DESKTOP-PF01IEE)-[/mnt/c/Users/Intel i5/Music/Youtube] └─$ tput reset |
Press Control-R and a prompt will appear. Type “sudo” for example and the first match in the history will appear.
┌──(john㉿DESKTOP-PF01IEE)-[/mnt/c/Users/Intel i5/Music/Youtube] (reverse-i-search)`': |
Keep pressing Control-R and cycle through each match until you find the command you are looking for.
Very useful Linux shell tips and tricks.
https://securitronlinux.com/debian-testing/very-useful-linux-shell-tips-and-tricks/.
Useful BASH shell tips for Ubuntu and Debian alike.
https://securitronlinux.com/debian-testing/useful-bash-shell-tips-for-ubuntu-and-debian-alike/.