Your top 10 commands - Desktop Customization & Workflow

Users browsing this thread: 1 Guest(s)
seninha
Long time nixers
After reading this post on z3bra's phlog, I got curious to see what are my top 10 commands.

Quote:Now what are YOUR top 10 commands ?
-- z3bra

On OpenBSD ksh, the history builtin only lists the last 10 commands on history, to list all commands, you need to run this:
Code:
history 1
(history arguments are [first [last]]).

So, this is the command I needed to run:
Code:
history 1 | awk '{print $2}' | sort | uniq -c | sort -rn | head -n 10

My $HISTSIZE is 1000, so my sample is not that big as z3bra's (whose $HISTORY is ten times bigger).

Here's my top 10:
  • 1. vim: I expected that.
  • 2. make: I use makefiles to build programs and documents, move my dotfiles to their proper places, etc.
  • 3. cd
  • 4. d: This is a shell function wrapper around tree(1) (actually colortree(1), a colored version of tree). Yes, I use tree(1), and not ls(1), to list the contents of a directory...
  • 5. agenda: That's a shell script that shows a calendar for the current month, the events for the week and the tasks I need to do. Very handy. For events it calls calendar(1), for the tasks it calls todo(1). Both programs are part of my orgutils. This script reads the agenda and todo files in all directories of '~/proj/' (that is, in every project of mine), adds a prefix to each event and task corresponding to the project name, and pipes them to agenda(1) and todo(1).
  • 6. git.
  • 7. man.
  • 8. xopen: That's my opener script. If I want to open a image with sxiv or a document with zathura, I just call xopen on them.
  • 9. ssh.
  • 10. fm: That's actually an alias for lf, the file manager, with some options.
z3bra
Grey Hair Nixers
Holy cow that post was 1 year ago already ! Good retrospective, given that your top command is vim, I'd suggest aliasing it 😉
That's funny to see you use tree rather than ls. isn't it too verbose when you got a lot of subdirectories ? do you pipe it to less then ?
tuxifreund
Members
I’ve read z3bra’s phlog post a couple of weeks ago but thanks for opening this thread!

So, here’s my top 10:
  • 1. git - I didn’t expected to see git before vim, but I really use git often and as my vim is opened longer and I just open a new buffer there.
  • 2. vim - Place 2 is well, too.
  • 3. sudo - mostly used to run pacman as root to install packages
  • 4. l - alias of
    Code:
    ls
    , which itself is an alias of
    Code:
    ls --color=auto
  • 5. mutt - Do I really use mutt that much?
  • 6. tmux - Didn’t thaught seeing this on place 6.
  • 7. python − Most of my programs are written in python, so this is the command I start them.
  • 8. toot - my Mastodon client
  • 9. ssh - I use this to administrate my server and to ssh to it as there is running my WeeChat instance
  • 10. rm - Nothing to say here.
ols
Members
I wrote a follow up log to z3bra, my top ten are:

Code:
$ history | awk '{print $4}' | sort | uniq -c | sort -rn | head -n 10
   10442 vim
   8521 k
   5755 git
   5644 cd
   5091 ls
   4155 ssh
   3560 cat
   2251 curl
   1406 make
   1385 pscli
dionys
Members
Top Ten:
  1. sudo - nearly a third of the history
  2. vim - main editor, also used to view files when I want highlighting or folding
  3. apt-cache - searches for packages, or checking dependencies
  4. ls - alias that adds '--color=auto'
  5. lp - lots of print jobs with custom parameters
  6. cd - lots of these from going up or down one level
  7. git - breakdown: log, status, pull, clone, config, remote, init, describe
  8. echo - testing regex makes this pretty high
  9. cat - viewing file contents
  10. mv - wrangling third-party code in /opt/ that I rebuild when there's an update

sudo breakdown:
* apt-get - installing/updating/cleaning up packages
* vim - editing system files
* mount - mucking around with university cifs shares
* systemctl - stuck with systemd for now, for fear I'd break commercial software
* mkdir - reorganizing installed scripts / libs
* chown - cleaning up permissions
* mv - reorganizing
* chmod - cleaning up permissions
* ufw - opening ports
* virsh - starting/configuring vm's

Here's a hack for the last bit:
Code:
history|grep "^[^ ]*[ ]\bsudo\b"|awk '{print $3}'|sort|uniq -c|sort -rn|head -n 10
seninha
Long time nixers
(15-10-2021, 02:26 AM)z3bra Wrote: That's funny to see you use tree rather than ls. isn't it too verbose when you got a lot of subdirectories ? do you pipe it to less then ?

The function I wrote defaults to depth 1 (no subdirectories), but I can call it with the option -2 to list contents of subdirectories, -3 to list content of subdirectories up to depth 3, etc. Or -0 to recursively list at infinite depth. So there's no need to pipe to less, since the default output is not recursive.

The function also has find(1) functionalities. If I give it an argument, it looks for a file named as the argument in the filesystem up to the depth I specify.

The function also lists in the long format, so I get the size of the files and their permissions.

ls -Rl and find -iname in a single command!
freem
Nixers
Code:
% history 1 | awk '{print $2}' | sort | uniq -c | sort -rn | head -n 10
   1407 git
    662 ls
    530 cd
    340 vim
    279 make
    144 rm
    131 grep
    107 find
     82 man
     72 ps

But that's very likely wrong, because I use lot of terminals, and histories does not merge well. I'm not surprised with the high top though, git being such a pain in the ass to use, you have to use it a lot before commiting something. ls and cd... well, I should alias them to something which does both, or even better, stop using shell directly, because shells are so not convenient to use interactively... that's still the kind of stuff I summon a lot, though. Then goes vim and make, not surprising as coding is one of my major occupations.

I'm surprised to see rm that high, before grep and find, I would have thought I use those more often... and then yes, I read lot of man pages, which includes almost each time I need a `test` or a decent `find`. As for ps, yeah, I'm constantly hunting stuff which wastes my computer's resources. I'm a bit surprised to not see pstree or pree in there, though.