News for hackers. Stuff that matters.
Re:What's Your Go to Command When You Open a Terminal? by oriori on Tuesday November 09, 2021 @01:36AM (#29158452)
I use zsh and like keeping my terminal clear, so I found a zsh script called almostontop which clears on pressing enter.

link: https://github.com/Valiev/almostontop/blob/master/README.md

Re:What's Your Go to Command When You Open a Terminal? by jaredsohn on Tuesday November 09, 2021 @04:08AM (#29159326)
For people who want this without downloading a script, pressing cmd-k on a Mac (or equiv on other operating systems) will do this quickly on demand.

I guess that's my goto.

Re:What's Your Go to Command When You Open a Terminal? by cutthegrass2 on Tuesday November 09, 2021 @05:07AM (#29159703)
Ahh, useful thanks. I've been using Ctrl-l for years. cmd-k is an easier 'chord' for me on the kinesis so I'll switch.
Re:What's Your Go to Command When You Open a Terminal? by gls2ro on Tuesday November 09, 2021 @05:49AM (#29160010)
If you are logging in in multiple *nix systems I suggest you keep the Ctrl+l.

I started to notice that the more I adopt in terminal specific commands to MacOS the hard is to be productive while I login to various systems.

I want also to force myself (but did not do it yet) to use a simpler Vim configuration. Maybe just line numbers so that when I login into a new system I should not need any plugin or any other shortcuts. Still I like my .vimrc file but I plan to do this in near future.

Re:What's Your Go to Command When You Open a Terminal? by jaredsohn on Tuesday November 09, 2021 @06:43AM (#29160367)
I assume you're talking about physically logging into different machines since cmd-k is a shortcut key for the terminal and will work regardless of which machine you ssh into.

cmd-k works well for me since I don't think I've personally logged in directly to a non-Mac *nix-like system in 15+ years.

vim is different since it requires configuration on the same system.

This superuser explains some subtle differences between the two commands: https://superuser.com/questions/819593/what-is-the-differenc...

Re:What's Your Go to Command When You Open a Terminal? by ozzythecat on Tuesday November 09, 2021 @02:06AM (#29158651)
Can you run ‘git status’ or allow it to show history from certain commands?
Re:What's Your Go to Command When You Open a Terminal? by oriori on Tuesday November 09, 2021 @02:12AM (#29158685)
Of course it only clears when you run a new command, or press enter. Basically think of it like typing clear after running a command. You can also scroll up and find the last output.
Re:What's Your Go to Command When You Open a Terminal? by johng on Tuesday November 09, 2021 @01:09AM (#29158298)
I started using 'w' as a habit on BBS's back in the day... then kept that up when I had an account on super computers in high school...(https://newfutures.aps.edu/supercomputing) it's still muscle memory for me. I have no idea why as most of the machines I'm on now, I'm the only one with an account.

Old habits die hard. It's just muscle memory at this point.

Re:What's Your Go to Command When You Open a Terminal? by giuliomagnifico on Tuesday November 09, 2021 @12:09AM (#29157959)
I have some some shortcuts to open some of my most used "Go to" SSH locations, I'm too lazy to manually write ssh root@192... so cmd+opt+r ssh into my router, cmd+opt+p ssh into RPi etc...
Re:What's Your Go to Command When You Open a Terminal? by jmkr on Tuesday November 09, 2021 @01:03AM (#29158263)
`~/.ssh/config` is pretty awesome
Re:What's Your Go to Command When You Open a Terminal? by giuliomagnifico on Tuesday November 09, 2021 @05:39AM (#29159926)
Yes, obviously my keys are already stored, I've already said that im lazy? =)
Re:What's Your Go to Command When You Open a Terminal? by brezelgoring on Tuesday November 09, 2021 @12:42PM (#29164747)
I always go to the same place, my programming directory, so for years I've done the sequence:

{cd Pr<tab><enter>cd c<tab><enter>}

Takes me to my current project folder, and there I can use gcc or vim or whatever I need to do. I thought about shortening it or setting my terminal to start in that directory but the ritual is important to me, it sets me in the right mood, for whatever reason.

Re:What's Your Go to Command When You Open a Terminal? by nicbou on Tuesday November 09, 2021 @07:49PM (#29169685)
I created a command that cd to the right project, and optionally start docker, dev tools and other things related to that project.
Re:What's Your Go to Command When You Open a Terminal? by no_time on Tuesday November 09, 2021 @01:55AM (#29158564)
.bashrc runs tmux for me automatically but only if I ssh in. It removed just enough friction from using tmux that I finally put in the time to learn it. Would recommend/10

https://stackoverflow.com/questions/27613209/how-to-automati...

Re:What's Your Go to Command When You Open a Terminal? by jstx1 on Tuesday November 09, 2021 @04:35AM (#29159494)
Is there a point to using tmux for someone who mostly works on their local machine?
Re:What's Your Go to Command When You Open a Terminal? by mijndert on Tuesday November 09, 2021 @05:58AM (#29160073)
I would say having the exact same keyboard shortcuts for interacting with windows, panes, etc for both your desktop as well as any other machine you work with is worthwile having.
Re:What's Your Go to Command When You Open a Terminal? by rzzzwilson on Tuesday November 09, 2021 @01:19AM (#29158344)
cd to get to the directory of interest. After that, probably workon.
Re:What's Your Go to Command When You Open a Terminal? by zzo38computer on Tuesday November 09, 2021 @12:10PM (#29164330)
It depends what I am trying to do; often the first command will be cd (to access whatever directory I will intend to work on), but not always.
Re:What's Your Go to Command When You Open a Terminal? by f0e4c2f7 on Tuesday November 09, 2021 @10:57PM (#29170907)
Sometimes ls.

Other times I'll hit enter a few times and then Ctrl+L to clear the screen.

Sort of feels like tapping my fingers on the desk.

Re:What's Your Go to Command When You Open a Terminal? by thorin on Tuesday November 09, 2021 @05:02AM (#29159678)
Probably "pwd", from the days when it wasn't the prompt / my profile / the shell I was using
Re:What's Your Go to Command When You Open a Terminal? by johncoltrane on Tuesday November 09, 2021 @12:34AM (#29158097)
The command I opened that terminal for.
Re:What's Your Go to Command When You Open a Terminal? by potta_coffee on Tuesday November 09, 2021 @10:20AM (#29162851)
history | grep <thing>

I use a number of tools and I've often forgotten an individual command, or when I'm using tools like curl or docker that have a long single line command that I know I can't remember.

Re:What's Your Go to Command When You Open a Terminal? by nop_slide on Tuesday November 09, 2021 @12:51PM (#29164892)
Oh man, I'm about to blow your mind.

ctrl+r (reverse history search) + https://github.com/junegunn/fzf

is a game changer

Re:What's Your Go to Command When You Open a Terminal? by potta_coffee on Tuesday November 09, 2021 @01:36PM (#29165516)
Neat, I'll check it out.
Re:What's Your Go to Command When You Open a Terminal? by lowcoderev on Tuesday November 09, 2021 @12:08AM (#29157955)
Lol, same here. ls and then clear. Now I'm ready to do whatever I want
Re:What's Your Go to Command When You Open a Terminal? by warrenm on Tuesday November 09, 2021 @12:18PM (#29164420)
99% of the time, I'm ssh'ing to a remote host

So it's `ssh <host>`

Re:What's Your Go to Command When You Open a Terminal? by isubasinghe on Tuesday November 09, 2021 @12:23AM (#29158033)
no matter what I do `ls` as well
Re:What's Your Go to Command When You Open a Terminal? by p0d on Tuesday November 09, 2021 @07:14PM (#29169389)
cat .ssh/config

ssh nameIforgot:/to/fix

Re:What's Your Go to Command When You Open a Terminal? by Ftuuky on Tuesday November 09, 2021 @04:53AM (#29159608)
ls -l as a force of habit I guess
Re:What's Your Go to Command When You Open a Terminal? by tytrdev on Wednesday November 10, 2021 @02:17AM (#29171991)
You probably know this but:

ll and la are shorthand for ls -l and ls -la

Re:What's Your Go to Command When You Open a Terminal? by tytrdev on Tuesday November 09, 2021 @03:58PM (#29167391)
ls
Re:What's Your Go to Command When You Open a Terminal? by mijndert on Tuesday November 09, 2021 @05:59AM (#29160079)
tmux
Re:What's Your Go to Command When You Open a Terminal? by oriori on Tuesday November 09, 2021 @07:38AM (#29160913)
I'm sure you can automate this.
Re:What's Your Go to Command When You Open a Terminal? by mijndert on Wednesday November 10, 2021 @02:01AM (#29171914)
Not everything has to be "automated" and "optimized" all the time.
Re:What's Your Go to Command When You Open a Terminal? by flamesofphx on Tuesday November 09, 2021 @01:06AM (#29158275)
clear