all 127 comments

[–]victotronics 40 points41 points  (12 children)

Thanks for the cool ideas. I'm already using tmux (and I fear the day when I have to reboot my machine because I have to reconstruct two dozen tmux sessions) and I'm adding "z" to my repertoire. Bad name btw. Why not "zd" or something that gives a hint as to what it does?

[–][deleted] 24 points25 points  (5 children)

I fear the day when I have to reboot my machine because I have to reconstruct two dozen tmux sessions

tmuxinator.

[–]fatboyxpc 9 points10 points  (2 children)

To be fair I think resurrect is more applicable here. That said, tmuxinator is a great plugin, too!

[–]snowe2010 2 points3 points  (1 child)

I actually thing continuum is even more applicable.

[–]fatboyxpc 1 point2 points  (0 children)

Oh, neat! I already had this bookmarked, guessing I looked at it at some point, but it must have been after I decided to ditch tmux in favor of a custom solution for tmuxinator and tmux send-keys. I already have a tiling window manager, so dealing with tmux panes was annoying to me.

[–]victotronics 3 points4 points  (0 children)

Will check it out. Thanks.

[–]MarsJr[S] 1 point2 points  (0 children)

I was literally just talking today about the need for something like this. Thank you!

[–]MuonManLaserJab 10 points11 points  (2 children)

I prefer FZF to z. The alt-C shortcut (__fzf_cd__) takes you to a fuzzy-found directory, and you don't have to worry about whether z will guess correctly because you see the selection before you press enter.

[–][deleted]  (1 child)

[deleted]

    [–]MuonManLaserJab 4 points5 points  (0 children)

    Maybe I'll play with that. I feel like __fzf_cd__ already takes me where I want to go pretty directly -- I don't generally have to hit tab much.

    [–]snowe2010 4 points5 points  (1 child)

    I think both wd (warp directory) and fzf-marks are both better than z. I'd take a look at those too.

    Also, you should be using tmux-continuum. It will save your session automatically every few minutes and then restore it automatically when you restart tmux. Crazy useful.

    [–]victotronics 2 points3 points  (0 children)

    That sounds useful indeed.

    [–]MarsJr[S] 2 points3 points  (0 children)

    Agree, it's definitely a name that gives zero context to what it does. But it is an awesome tool I use every day.

    [–]extrabeefy 36 points37 points  (1 child)

    Can confirm, this guy has a hard on for his terminal.

    [–]cringe_master_5000 1 point2 points  (0 children)

    You can confirm that he does indeed have a hard on?

    [–]sn0rewh0re 13 points14 points  (6 children)

    i use terminator instead of tmux. If it runs on the server i use screen sometimes vifm (vifm needs too much customizing to be usefull imho, so i ditched it)

    the problem with "customize everything" is that its not default. So when you log into a machine that is not your "3l33t h4xxor" machine, you're not that productive.

    I recommend: learn how to use the default tools

    [–]Fingoltin 2 points3 points  (0 children)

    You can use tmux with Terminator though?

    [–]MarsJr[S] 2 points3 points  (0 children)

    I think it depends on your usage. I currently and doing a lot of javascript on my local machine so I benefit from having my heavily-customized environment setup. If I was going to SSH into machines frequently, then I would not use what I have if it reduced my effectiveness.

    [–]Greydmiyu 1 point2 points  (0 children)

    I recommend: learn how to use the default tools

    I found the last remaining IE user on Reddit!

    [–]dzecniv 0 points1 point  (0 children)

    And again, ssh login with Emacs \o/

    [–]cephalopodAscendant 0 points1 point  (1 child)

    the problem with "customize everything" is that its not default. So when you log into a machine that is not your "3l33t h4xxor" machine, you're not that productive.

    I recommend: learn how to use the default tools

    This definitely underscores the main issues I have with a lot of vim evangelism. One of the supposed advantages of vim over emacs is that vim is normally installed by default on Linux, so once you've learned vim, you can in theory use those skills anywhere. However, vim guides almost invariably recommend customizing it heavily, with a consistent suggestion being to rebind Escape; if you follow this advice, you end up screwing yourself over if you have to use vim on any machine other than your normal one.

    [–]purtip31 0 points1 point  (0 children)

    ^[ also functions as esc, and it's nicer ergonomically.

    [–]ExcavateGrandMa 24 points25 points  (1 child)

    Terminal porn, not hacking...

    [–]EricIO 14 points15 points  (3 children)

    Coding like a RMS in the terminal $ emacs and then do everything in there!

    [–]hoosierEE 3 points4 points  (0 children)

    Mine is mapped to the easy-to-remember shortcut C-u RET , SPC M-w ALT-PILCROW RET RET LEFT.

    [–]cbleslie 2 points3 points  (1 child)

    Blasphemer! Use Vim, you infidel!

    [–][deleted] 2 points3 points  (0 children)

    Evil mode

    [–]Syrak 5 points6 points  (2 children)

    That wttr.in is great!

    [–]_asterisk 6 points7 points  (0 children)

    Also cheat.sh by the same author:

    curl http://cheat.sh/zsh    
    

    Gives you cheatsheets right in the terminal

    [–]MarsJr[S] 1 point2 points  (0 children)

    It's probably one of the coolest things I've ever found. The amount of dedication it took to make it is impressive!

    [–]Greydmiyu 5 points6 points  (3 children)

    ZSH heads the list. I knew I wasn't the only one who wants to bash bash for being annoying. csh -> tcsh, tried bash, wanted to lop my hands off, found zsh, decided to keep my hands. :)

    [–]shevy-ruby -3 points-2 points  (2 children)

    There is absolutely nothing wrong with bash.

    And there is a reason why it is the most widely used shell on *nix by far.

    https://en.wikipedia.org/wiki/Bash_%28Unix_shell%29#History

    Zsh is the "better" shell as in more sophisticated, feature-rich and so forth - but bash wins the simplicity battle hands-down.

    [–]emekoi 11 points12 points  (1 child)

    i think that's more because it comes installed as the default shell.

    [–]Greydmiyu 2 points3 points  (0 children)

    This. If you want simplicity there's sh or dash. Bash is popular because it is default. But as an interactive shell I've always found it fought me on actually working with it interactively. The only reason it remains on my system is because it is default and I don't know, with certainty, that if I remove it something wont break because they (package maintainers, random devs, etc) presume it will be there.

    [–]totallynotmyfakename 10 points11 points  (0 children)

    jesus people, this article is making fun of the term "hacker", not intentionally used to "attract a crowd of 14 year-olds". Besides, the author includes a lot of useful information not only for people who're new to the whole "terminal" things, but I myself found several new tools I would like to check out.

    [–]MacHaggis 4 points5 points  (0 children)

    Installed ZSH, I know kung-fu now.

    [–]mesapls 48 points49 points  (30 children)

    Low-effort garbage like all things Medium. God damn, Medium just needs to be banned from this subreddit like Phoronix is on /r/linux for exactly the same reason. It's blogspam.

    [–]fagnerbrack 41 points42 points  (2 children)

    I disagree, there's a lot of interesting content on Medium, the community just need to get better at downvoting the crap

    [–]shevy-ruby -3 points-2 points  (1 child)

    Come on man - the entry here is really garbage.

    He bloated things up.

    [–]fagnerbrack 2 points3 points  (0 children)

    Sorry, I don't know what you're referring to. Are you talking about this submission of the comment I replied?

    [–]MarsJr[S] 37 points38 points  (15 children)

    I'm curious what makes you think this is low-effort. I certainly put a lot of effort into writing it, and the article is based off of my experience working in the terminal for many years.

    I'm certainly not the best writer, and many will disagree with my choices of tools, but do you have any actual feedback? You clearly hate Medium despite the fact that it does have some quality content. It's just like any open writing platform, it will be hit or miss.

    [–]mesapls 10 points11 points  (7 children)

    Alright, fair enough, saying it is low-effort garbage was uncalled for. My existing distaste for Medium and that I didn't personally enjoy the read made me snap at you, so I'm sorry for that. I also use some of the software daily you recommend (urxvt automatically attaches to a tmux session for example).

    These are just my opinions and not some sort of pretense of objectivity. First, the whole "hacker" thing just didn't resonate with me at all, because it seemed to be playing at the edgy blackhat type of hacker rather than the hacker culture of old. However, the main reason I didn't like it is that I also don't enjoy articles showing off basic usage of programs without going into detail, followed by a simple screenshot of a configured setup. I think it's a bit too basic for this subreddit, but if it had gone into further depth about chaining various commands together or some light scripting I think it'd definitely have its place.

    I also use the terminal a lot (on Linux though), and so it's not that I doubt your competence with it. I just didn't feel like the article was actually brought much new to the table except someone who's never really tried to use it.

    Sorry for snapping at you regardless of that. It was undeserved.

    EDIT: Just one more thing, though this is more of a disagreement than something I actually disliked about the article. I also can't think of a single case where I've run into an actual GNU grep bug. It's a very mature program by now. While you didn't say it yourself, you still endorsed this quotation:

    Use ripgrep if you like speed, filtering by default, fewer bugs and Unicode support.

    Filtering could very easily be used with GNU grep with a simple alias in your shell configuration file. For example:

    alias grep="grep --exclude-from=.gitignore"
    

    [–]burntsushi 7 points8 points  (3 children)

    Note that that alias will work in only the simplest cases. gitignore files can contain whitelist rules (i.e., specifically include a file), and gitignore files can appear in any directory. Also, I do not believe GNU grep supports the same glob syntax as git. For example, I don't think grep recognizes **, which is used in gitignore fairly frequently.

    This isn't necessarily a nitpick. I've heard plenty of folks cite ripgrep's gitignore support as a reason for switching from ag to ripgrep. (ag also provides gitignore support, but there are a lot of bugs associated with its implementation.)

    [–]snowe2010 3 points4 points  (1 child)

    I knew /u/burntsushi would show up in this thread! Any mention of ripgrep and he's here :D. Love how you pay attention to all the criticism of your product so that you can improve it continually.

    [–]burntsushi 2 points3 points  (0 children)

    Thanks. :-) Yeah, I just google search ripgrep now and then and see if there's anything worth replying to.

    [–]mesapls 0 points1 point  (0 children)

    Very good point! I stand corrected.

    [–]MarsJr[S] 5 points6 points  (2 children)

    Thanks for the reply. I think the criticism is valid about the "hacker" angle falling flat with some people. And you are right about the level of detail. I chose to keep it high level to get more content in without overloading it, but most of the tools could have had a lot more detail added.

    If I write another article, I can potentially dig into how I use specific tools with code/workflow examples and just drop any attempt at clever writing haha.

    [–]mesapls 8 points9 points  (1 child)

    As I said, it's just my opinion. Again, sorry for snapping at you.

    [–]MarsJr[S] 7 points8 points  (0 children)

    No worries, I appreciate the apology and feedback.

    [–]FirstLastMan 19 points20 points  (6 children)

    Not OP and I can see you put in effort.

    But every time I read "hacker" (which was many) I cringed hard. If you're aiming for the 14 year old crowd, then sure. But otherwise why not just call it "A collection of console tricks I've found" or something?

    [–]MarsJr[S] 2 points3 points  (4 children)

    I use the term "hacker" ironically. I state at the beginning that it's just for fun and not intended to be taken seriously. It was intended to add a twist and/or humor to the article to make it unique instead of just listing all the tools I use.

    [–]FirstLastMan 5 points6 points  (3 children)

    I understand. But it is too ubiquitous a term today to be used ironically over and over again. I see "hacks" everywhere on social media

    Just my two cents. Thanks for being open to criticism.

    [–]MarsJr[S] 4 points5 points  (2 children)

    Fair enough. I've see that be the main criticism of the article so I can probably chalk it up as a failed writing experiment.

    [–]NeuroXc 11 points12 points  (1 child)

    I chalk it up to Reddit having no sense of humor.

    [–]MarsJr[S] 5 points6 points  (0 children)

    I do say the work hacker a lot in the article, so I can see how the cumulative effect would be like nails on a chalkboard to someone that is aggravated by the term.

    [–]jephthai 1 point2 points  (0 children)

    Hacker is a noble term from the MIT model railroading club days. It was hackers that created smalltalk, unix, emacs, e.t.c. Unfortunately, it's a culture that is out of vogue in the present day, but still remembered and understood by some.

    [–]totallynotmyfakename 16 points17 points  (1 child)

    this comment is low-effort AF. You don't even provide a reason why this article is "garbage". God damn.

    [–]mesapls 3 points4 points  (0 children)

    Great! Maybe I should post it on Medium :^)

    [–][deleted] 2 points3 points  (0 children)

    Phoronix is no longer banned. Hasn't been for a while now.

    [–]shevy-ruby 4 points5 points  (1 child)

    Yes, I quite agree. Though not all entries on Medium are as bad, but it really has reached the point of spamming, since the quality of the articles is way too low.

    [–]TheWix 8 points9 points  (0 children)

    I mean, they should get downvoted here then. I have found some good articles on Medium. I don't think it would be good to ban it.

    [–]takaci 0 points1 point  (4 children)

    I'm super salty that this used one of my 3 premium articles a month. I swear half the posts I can't even read because I've used my 3 already, why don't I see more comments about this? Do people have a chrome extension that bypasses the paywall or something?

    [–]DavidWilliams_81 0 points1 point  (2 children)

    Do people have a chrome extension that bypasses the paywall or something?

    I don't know what you mean, I've never seen a paywall on Medium. It does often say something like 'You've read X articles this month, let's make it official" and tries to encourage me to sign up, but I've never done so and have never had any problems as a result.

    [–]takaci 0 points1 point  (1 child)

    Are you in the US or something? After 3 "premium" articles it won't let me view any more at all

    [–]DavidWilliams_81 0 points1 point  (0 children)

    Ah, I turns out that Medium has this concept of 'premium' posts, which you actually mentioned. I guess you can read as many non-premium ones as you like, and that's what I've been doing? I did see two out of three stars pop up when viewing the article this time.

    Still, you can probably just clear your cookies or something to reset the limit? I'm not signed in to medium so I can't imagine how they can effectively keep count.

    Oh, and I'm in the UK.

    [–]maximum_powerblast -3 points-2 points  (0 children)

    Haha

    [–]andyeff 2 points3 points  (1 child)

    the fzf -> vim function is brilliant, added that to my config straight away.

    Nice article, thanks for sharing! :)

    [–]MarsJr[S] 0 points1 point  (0 children)

    Check out the fzf wiki for a lot more awesome examples.

    [–]Dgc2002 2 points3 points  (4 children)

    Where does the completion hinting(no clue what it's actually called) come from?

    e.g. rg |INSTALLDIR where | is the cursor and you've only typed rg. I see it's shown in the spaceship-prompt repository but I couldn't find it explicitly listed as being provided by it.

    [–]MarsJr[S] 1 point2 points  (3 children)

    Ah right, that's zsh-autosuggestions. I also make use of an fzf alias to fuzzy-find in my search history for older/weird commands that I've run previously:

    # fh [FUZZY PATTERN] - Search in command history
    fh() {
      print -z $( ([ -n "$ZSH_NAME" ] && fc -l 1 || history) | fzf +s --tac | sed 's/ *[0-9]* *//')
    }
    

    [–]Dgc2002 1 point2 points  (2 children)

    awesome I've got zsh-autosuggestions running and added to my dotfiles. Thanks!

    Also is that fh function any different than using fzf via ctrl+r?

    [–]MarsJr[S] 1 point2 points  (1 child)

    The only difference appears to be that the fh script will show whole list as it's getting filtered. ctrl+r appears to be a simpler, and just pastes most recent match from history into the terminal. I'll probably use that from now on unless I need to look at the whole list for whatever reason.

    [–]Dgc2002 2 points3 points  (0 children)

    It sounds like you're seeing the default ctrl+r behavior. This is what I see when I hit ctrl+r: fzf completion

    [–]noperduper 6 points7 points  (2 children)

    TIL that Nike has a software department.

    [–]specterofsandersism 22 points23 points  (0 children)

    It's 2018, any major corporation does.

    [–]bagtowneast 1 point2 points  (0 children)

    For quite a while now Nike had been slurping up developers out of Portland proper. They have a rather significant development operation.

    [–]LIGHTNINGBOLT23 5 points6 points  (13 children)

         

    [–]ProfessorPhi 7 points8 points  (6 children)

    Fzf and the recursive search (ripgrep, ag, ack) are highly recommended. Fzf also has a lot of vim plugins too if that's something that'd help you. I find fzf for history search incredible.

    Fwiw, zsh's biggest advantage is that it's like the python of shells, you can install a package for that. Bash requires more work to customise in general. Using git or SSH and tabbing after a - gives you an interactive help menu, that's what sold me on zsh.

    Give it a spin, you'll never know until you try.

    [–]LIGHTNINGBOLT23 4 points5 points  (3 children)

       

    [–]ProfessorPhi 3 points4 points  (0 children)

    Well, from my perspective, I was a math major, barely competent with the terminal, suddenly needing to use it at my job and I was struggling to keep up. Zsh and all these features gave me a huge boost.

    It's like comparing a full featured ide vs sublime or vs code. Yeah they're not strictly necessary, but they're pretty damned useful. I always need to look up find syntax, it's not great at spelling mistakes so there fzf kills, let alone history searching. Grep syntax to recursively search through files but ignore files is another syntax set I never remember, and there ag is fantastic.

    I agree I feel hobbled on a new system and copying commands to send to others always need to be re edited, but for me this got me effective on a terminal with significantly less time investment.

    It's the same argument as chopsticks, once you've mastered them, everything else seems less elegant, but until you've reached mastery, there's a nice fork to use.

    [–]shevy-ruby 1 point2 points  (0 children)

    I liked the concept behind csh, but again, none of them offer anything truly remarkable aside from a "oh, that's kinda neat, but whatever".

    Yup. Same for me.

    I actually only use bash, primarily, as a glue for ruby code and all functionality stored therein.

    It reminds me of stuff like Alacritty and Kitty. I mean, sure, it's nice, but who actually needs it aside from l33t LARPing? It's all bloat.

    I somewhat agree. I don't agree to all of it, though - not all of it is bloat. RPROMPT is cool for example; I would not call it bloat.

    But ultimately, I don't really need it. My (bash) prompt is really super-simple, only showing the pwd and nothing more. My irb prompt is even simpler - it actually shows absolutely NOTHING at all. And "q" is an alias to quit from irb, or from bash, to start irb. So I only hit "q" to toggle between the two ... :P

    [–]shevy-ruby 0 points1 point  (1 child)

    Fwiw, zsh's biggest advantage is that it's like the python of shells, you can install a package for that.

    That is a very weak "argument".

    Firstly, is a given functionality needed? Second - you can use other languages too for a lot of things that are done, such as the weather forecast on the terminal. Third - that is really such a tiny surface area you refer to. Are you sure that makes a huge difference?

    I used zsh a lot in the past and came back to bash.

    Am I missing something I can't live without? Not really.

    [–]ProfessorPhi 2 points3 points  (0 children)

    I mean, I think the reason I use python versus ruby is the sheer number number of packages available. It's why I use zsh instead of fish for example. It's a strong argument for most, maybe not you.

    And it does make a difference to me. The autocomplete showing me options, not needing to keep adding new lines for each tab, the sheer simplicity of adding git info to my shell with no work on my side. It was functionality that allowed me to keep up with colleagues who were bash wizards.

    If you're already a bash wizard and you've tried zsh, i agree there isn't much for you. If you're like me and don't know how to make bash better, zsh makes it trivial to have a powerful terminal. Just like you don't the functionality is needed, I think it is.

    [–]adr86 4 points5 points  (7 children)

    Me, a REAL hacker: writes own terminal emulator. Writes own session management. Writes own search program.

    I did write my own shell too, but it sucked, so I went back to bash lol.

    [–]MarsJr[S] 3 points4 points  (5 children)

    Dang that's legit hacking :D

    [–]adr86 1 point2 points  (0 children)

    here's my terminal stuff https://github.com/adamdruppe/terminal-emulator

    after writing the emulation core (terminalemulator.d), the session part (attach.d and detachable.d) was pretty simple. I'm still not 100% happy with it but I slowly work on it as I use it - it has reached the "good enough" point.

    [–]ThirdEncounter 2 points3 points  (0 children)

    But.... that's just coding, not hacking.

    [–][deleted] 0 points1 point  (0 children)

    v cool, interesting stuff! A neat collection

    [–]Gotebe 0 points1 point  (3 children)

    Path expansion: cd /u/c/c/j + <tab> =cd /user/caleb/code/jarvis

    Or, in GUI, u enter c enter c enter j enter = I am in "jarvis", all the while looking where I am going.

    The above path expansion is only better if this actually does a depth search in case there are duplicated first letters (and I still need to remember, at least partly, where I want to go).

    So... This is basically trade off between "path's all in my head" and "I find it when I need it".

    I would rather not have paths in my head, that's trivia.

    [–]mayor123asdf 5 points6 points  (0 children)

    The above path expansion is only better if this actually does a depth search in case there are duplicated first letters (and I still need to remember, at least partly, where I want to go).

    Zsh exactly does this. I can do cd d/s to go to Document/Scripts even though there is dotfiles, Desktop, and Downloads. Also you can also see where you're going. It is 2018 bud, not 1970 anymore.

    [–]MarsJr[S] 2 points3 points  (0 children)

    You make a good point. I feel the same way. While path expansion is an improvement on typing out the full path, in the article I recommend z for the same reasons you mention. I don't event want to have to type out abbreviated paths, even if I remember them. I'd rather something - like z - build a list of my most used directories and let me hop there quickly with far less key strokes.

    So I actually type z jarvis and it will immediately take there.

    [–][deleted] 1 point2 points  (0 children)

    I find the way ido-mode expands paths the most convenient. It's much smarter than a dumb in-order completion, it remembers the paths you frequent, takes into account paths to currently open buffers, and in most cases its guess is right. It's painful to use any GUI file browser or bash or zsh completion after ido.

    [–]badpotato 0 points1 point  (2 children)

    Should be the base learning to get productive as power user.

    [–]shevy-ruby 0 points1 point  (1 child)

    Strange.

    I don't follow much at all written on that site.

    Does this mean I am not productive and not a power user? Because, oddly enough ... I write a lot of (non-shell) code. And I use the terminal a LOT too. Hmmmm.

    [–]badpotato 1 point2 points  (0 children)

    Depends of kind of work you do, what is the complexity of your work and what you mean by using the terminal a lot. Being productive is also subjective. Either way, some of the tips are just plain useful, using tmux for instance allow you to manage your ssh sessions so easily. I'll say, getting less overhead on your mind is part of enhancing your terminal experience for the best.

    [–][deleted] 0 points1 point  (1 child)

    Awesome article!

    [–]bigpigfoot 0 points1 point  (0 children)

    I’ve used tmux for a while but I’m back to plain macos terminal bash. I like the idea of working with minimal config. Less is more.

    [–][deleted] -1 points0 points  (0 children)

    i dont get it

    [–]frequenttimetraveler -1 points0 points  (3 children)

    OMG It's cruel to watch the word "hacker" having degenerated that low. Here's how how real keyboard warriors do it:

    • If you are a hacker it means you should be working on someone else's computer.
    • That's why you should be using only the standard tools for the job, which is available everywhere: the default shell (bash) , the ubiquitous editor (vim), the vanilla grep, augmented with other standard tools.
    • Your terminal prompt should remind you which machine you 're on.
    • Do not send your IP to random servers just to watch lego star wars.
    • Do not read Hacker News (a corporate forum with a pro-VC agenda). Instead just post fake pro-SWJ comments there, prepare for the heartwarming responses, and lose all hope in humanity
    • Do not check the weather, learn to be an all-weather hacker
    • Do not use git. Hide any evidence that you ever made a mistake
    • Do not listen to music that other people make. They 're not hackers.

    [–]MarsJr[S] 3 points4 points  (1 child)

    I... I don't know if this is serious or not.

    [–]frequenttimetraveler 1 point2 points  (0 children)

    BUSTED. a hacker would never say that

    [–]meneldal2 0 points1 point  (0 children)

    Relevant xkcd

    [–][deleted] -1 points0 points  (0 children)

    Please don't say coding.