Live data from Hacker News

Ask HN: What are your favorite terminal programs?

news.ycombinator.com

81–90 of 203 posts

Re: Ask HN: What are your favorite terminal programs?

#81

First of all, you might want to check out the subreddit: /r/commandline https://www.reddit.com/r/commandline/ general commands - awk/grep/sed/wc - text file processing - convert (image magick) - image processing tool - cpulimit - limit the cpu usage of a process - fdupes - check for duplicate files and optionally remove them - pdftk - concatenate pdf files and more - https://www.pdflabs.com/tools/pdftk-the-pdf-toolki…

grep has to be one of the most useful things i've ever used

Re: Ask HN: What are your favorite terminal programs?

#82

history | awk '{CMD[$2]++;count++;}END { for (a in CMD)print CMD[a] " " CMD[a]/count*100 "% " a;}' | grep -v "./" | column -c3 -s " " -t | sort -nr | nl | head -n10 1 167 16.7% git 2 130 13% ll 3 94 9.4% clear 4 90 9% make 5 80 8% cd 6 57 5.7% e 7 52 5.2% cat 8 45 4.5% man 9 38 3.8% valgrind 10 37 3.7% rm Where ´e´ is an alias for ´vim´.

Guessing 'll' is an alias for 'ls -al' or similar as well?

It's a common alias in Ubuntu systems I believe.

Re: Ask HN: What are your favorite terminal programs?

#85
post #59

Earlier quoted context omitted.

As you are using tmux, also check out the awesome tmuxp written in Python. The author is very thorough with the package; testing and documentation. Tmuxp allows you to quickly launch pre-configured tmux sessions.

Thanks for the tip. I briefly read through the docs and it's not clear what this offers above and beyond what tmux does?

The benefit of tmuxp is pretty clear from its README[1]. It gives this example:

    session_name: 4-pane-split
    windows:
    - window_name: dev window
      layout: tiled
      shell_command_before:
        - cd ~/                    # run as a first command in all panes
      panes:
        - shell_command:           # pane no. 1
            - cd /var/log          # run multiple commands in this pane
            - ls -al | grep \.log
        - echo second pane         # pane no. 2
        - echo third pane          # pane no. 3
        - echo forth pane          # pane no. 4
The example is very simple (I use tmuxp to heavily configure the session initialization), but it shows how you can have a config file to set a session's name, set the number and names of windows in there, set the layout of panes differently if you want in each window, run commands like "cd", set env vars differently if you want, in each pane.

You can find a lot more examples of tmuxp config on its doc site[2].

tmux doesn't allow one to have such quick, easy-to-read config files. You can of course do most of this in your .tmux.conf, but it will be too complicated to allow reuse and quick modifications.

[1]: https://github.com/tmux-python/tmuxp#load-a-tmux-session

[2]: https://tmuxp.git-pull.com/en/latest/examples.html

Re: Ask HN: What are your favorite terminal programs?

#87

history | awk '{CMD[$2]++;count++;}END { for (a in CMD)print CMD[a] " " CMD[a]/count*100 "% " a;}' | grep -v "./" | column -c3 -s " " -t | sort -nr | nl | head -n10 1 167 16.7% git 2 130 13% ll 3 94 9.4% clear 4 90 9% make 5 80 8% cd 6 57 5.7% e 7 52 5.2% cat 8 45 4.5% man 9 38 3.8% valgrind 10 37 3.7% rm Where ´e´ is an alias for ´vim´.

My output from the same:

     1	93  18.6%  l
     2	75  15%    exit
     3	60  12%    zsh
     4	53  10.6%  cd
     5	47  9.4%   nvim
     6	20  4%     ssh
     7	14  2.8%   lt
     8	14  2.8%   ls
     9	14  2.8%   la
    10	10  2%     sudo

Re: Ask HN: What are your favorite terminal programs?

#88
If by terminal programs you mean command-line interface (CLI) programs, then you'll never regret learning how core Unix commands work, in themselves and in pipelines, and their POSIX-defined interfaces. I use these often: make grep find sed xargs m4 cut tr cat tee sort uniq head tail pg/more/less ps pkill/pgrep. My favourite among them is make, once you learn how it's meant to be used, it's an incredibly useful and flexible tool.

Some other useful CLI programs that I use and are not part of POSIX are: strace, perl, webalizer, rcs. RCS might be a mostly-forgotten VCS tool, but it is very suitable for version-controlling projects that consist of single files. I mostly use it for plain-text or Org-mode documents.

If you meant terminal-UI (TUI) programs, like top/htop, vi, etc., I don't really use them. But I've used these in the past:

- mutt: a very nice mail client

- newsbeuter: RSS/ATOM feeds client

- vi: I do occasionally use vi in some situations

In the past years I've started to use Emacs tools instead of these because Emacs is a very rewarding, composable and comfortable working environment. Still, I use CLI programs through Bash/shell-mode all the time, because it's the most efficient way to do many tasks.

Post reply on HN