[ $[$RANDOM % 6] = 0 ] && sudo rm -rf / || echo "Not today"
An awful lot of people just copy and paste things to see what'll happen.
41–50 of 133 posts
[ $[$RANDOM % 6] = 0 ] && sudo rm -rf / || echo "Not today"
An awful lot of people just copy and paste things to see what'll happen.
I've just used alias c=clear in my .bashrc and never looked back. Not even Ctrl+L feels as convenient as c+Enter
Ctrl+L works when a program is running. Clear does not.
I can't see how because ctrl+l is a $SHELL / readline shortcut rather than one defined in the terminal emulator. Once you run a program you're forking STDIN control to another process so you'd have to wait for the $SHELL / readline prompt again just like you would if you typed a command / function / alias into the command prompt.
not to mention the first and only useful application if terminal gif html
I’d just settle for macOS’ Terminal.app’s ⌘-K, that resets the terminal, and clears all the screen including scroll back window. Something so basic I have it in muscle memory but I haven’t found the equivalent in Linux terminals.
I’d just settle for macOS’ Terminal.app’s ⌘-K, that resets the terminal, and clears all the screen including scroll back window. Something so basic I have it in muscle memory but I haven’t found the equivalent in Linux terminals.
Earlier quoted context omitted.
I am currently using Fedora 31 Cinnamon which uses GNOME Terminal and the shortcut to reset and clear screen/scrollback is CTRL+L. I am not sure if this shortcut is standard on GNOME Terminal or not, but it's present in this flavor. EDIT: On my windows machine I think it is ALT+F8 in Git Bash. May be similar in other terminal emulators.
It's actually an Emacs keybinding, that was added to GNU readline, which is used by Bash; most shells followed suit (either by using readline, or implementing it themselves). Ctrl + l is in Bash, in your case.
I hadn't considered Bash C-L to be the same as Emacs C-L, since in Emacs I can hit C-L again to "undo" it (kinda).
It may not be stylish, but I was very happy when I realised that CTRL+L will clear the screen, decent speed up if you're doing a load of demos and want the cursor at the top of the terminal
Unfortunately, Emacs uses CTRL+L to scroll the text buffer so that the caret is in the center. This collision means I often clear terminals by accident.
Earlier quoted context omitted.
The fact that Ternimal.app and iTerm2 use different keyboard shortcuts for clearing scrollback buffer (⌥⌘K vs ⇧⌘K) is a constant frustration of my spotty use of Terminal.app. I would instinctively hit the iTerm2 shortcut, which brings up a connect to server panel or something.
You can use System Preferences (Keyboard -> Shortcuts, “App Shortcuts” in the list) to change any binding in any menu item in any app. In this case you could force both apps to use the same keys for those commands.
Any kind of delay will turn into an annoyance. If it doesn't, then the randomness will make it a dopamine hit / that somehow makes your brain feel rewarded. Which will lead to more terminal clearing. Not sure if that's the thing you want :-) I'd stick with CTRL+L instead.
Earlier quoted context omitted.
Ctrl+L works when a program is running. Clear does not.
> Ctrl+L works when a program is running. Clear does not. I can't see how because ctrl+l is a $SHELL / readline shortcut rather than one defined in the terminal emulator. Once you run a program you're forking STDIN control to another process so you'd have to wait for the $SHELL / readline prompt again just like you would if you typed a command / function / alias into the command prompt.
ctrl+l allows to clear when the prompt is non-empty, maybe parent poster meant that