DEV Community

Adrian Mejia
Adrian Mejia

Posted on

What are your top ten command lines?

Run the following command list to find out!

history | cut -c8- | sort | uniq -c | sort -rn | head -n 10
Enter fullscreen mode Exit fullscreen mode

Mine is the following:

image

Since I used a lot of aliases, here is the expanded version:

  1. git status (alias gst)
  2. git push (alias ggpush='git push origin "$(git_current_branch)"')
  3. git commit (alias gca='git commit -v -a')
  4. ls (list files current directory)
  5. code . (opening visual studio in the current folder)
  6. git pull (alias ggpull='git pull origin "$(git_current_branch)"')
  7. .. (go back previous directoy)
  8. grunt serve (alias eos='cd "$LOCKHART"/eos && git pull origin "$(git_current_branch)"; grunt serve')
  9. git checkout master (alias gco='git checkout')
  10. grunt karma:... (run unit tests)

Top comments (35)

Collapse
 
leightondarkins profile image
Leighton Darkins
  1. git status
  2. clear - I love me an empty terminal window
  3. ls
  4. git add .
  5. git push
  6. git pull
  7. git checkout .
  8. project - alias to get me straight into my project directory
  9. git commit --amend --no-edit - I hate doing this (special thanks to the client that demands all changes exist in a single commit on a branch
  10. ../
Collapse
 
leejarvis profile image
Lee Jarvis

Mine are all very similar to this! Although I don't use clear -- CMD/CTRL+L does the trick

Collapse
 
hammotime profile image
Adam Hammond

Oh my god, I never knew the CTRL+L tip, you've LITERALLY changed my life.

Collapse
 
amejiarosario profile image
Adrian Mejia

I use git commit --amend --no-edit too. Mostly for small changes (e.g., missed semicolon) that worth a commit.

Collapse
 
ifenna__ profile image
Ifenna

I honestly didn't know about --no-edit until now. Thanks for saving me the keystrokes 😂.

Thread Thread
 
amejiarosario profile image
Adrian Mejia

There's another one I used when for whatever reason I need to retrigger CI/jenkins without making any change

git commit --allow-empty -m 'trigger'
Collapse
 
leejarvis profile image
Lee Jarvis

I'm using zsh and this command didn't work well. I found this post which includes something nice! Here's mine:

~% history 1 | cat | 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  300  25.5537%    ag
     2  95   8.09199%    g
     3  61   5.19591%    gl
     4  49   4.17376%    gb
     5  45   3.83305%    ls
     6  43   3.66269%    cm
     7  42   3.57751%    cd
     8  39   3.32198%    cat
     9  28   2.38501%    brew
    10  26   2.21465%    rm

ag is the command for the_silver_searcher -- I guess I search a lot!

Collapse
 
jappe999 profile image
jappe999

If you use zsh you can use the command zsh_stats.

Collapse
 
amejiarosario profile image
Adrian Mejia • Edited

Nice! I didn't know about zsh_stats. It would have saved me some time tinkering with cut and uniq :P

$ zsh_stats                                                                      
     1  828  7.84165%     git
     2  691  6.54418%     gst
     3  533  5.04783%     gco
     4  469  4.44171%     cd
     5  439  4.15759%     ggpush
     6  367  3.47571%     gca
     7  363  3.43783%     grunt
     8  357  3.381%       ls
     9  299  2.83171%     npm
    10  291  2.75594%     make
    11  288  2.72753%     code
    12  248  2.34871%     open
    13  188  1.78047%     node
    14  188  1.78047%     hexo
    15  171  1.61947%     z
    16  156  1.47741%     brew
    17  145  1.37324%     ggpull
    18  141  1.33535%     ..
    19  138  1.30694%     cat
    20  136  1.288%       eos
Collapse
 
amejiarosario profile image
Adrian Mejia

Oh, that's weird it didn't work for you. I'm also using zsh. I'm just curious, what was not working with the original command?

Collapse
 
leejarvis profile image
Lee Jarvis

It just shows a bunch of commands with a count of 1 :-) The zsh_stats thing is very cool!

Collapse
 
ifenna__ profile image
Ifenna • Edited
zsh_stats
     1  564  27.6878%    git
     2  178  8.73834%    cd
     3  145  7.11831%    vim
     4  106  5.20373%    sudo
     5  71   3.48552%    ls
     6  68   3.33824%    yay
     7  60   2.94551%    go
     8  56   2.74914%    exit
     9  39   1.91458%    ftm
    10  38   1.86549%    l

yay is my package manager, l is an alias for ls -al and I seem to use vim a lot.

Collapse
 
bradtaniguchi profile image
Brad
167 git status - spam this one
58 ls
53 git add -A
52 git commit
50 git branch
28 clear
25 git log
21 npm start
17 glxgears - sanity checking if gpu acceleration is on, for my chromebook :D
16 git fetch

I guess I hit a lot of git commands haha!

Collapse
 
amejiarosario profile image
Adrian Mejia

Interesting, I didn't know about the glxgears

Collapse
 
rizzu26 profile image
Rizwan

Its clear that I'm slowly turning into JS developer from iOS developer

 714 l
 382 pod install
 331 clear
 328 cd ..
 319 ls
 273 yarn start
 198 bundle exec pod install
 157 code .
 143 yarn test
 107 yarn run jest -u
Collapse
 
brettimus profile image
Boots

This is fun!

Also lol they're all git and yarn for me:

 168 gits
  38 yarn dev
  31 yarn
  19 gita
  18 yarn repl
  17 git diff
  12 git pull
  11 git log
  10 gpo
  10 git checkout devel
  • gits is my alias for git status
  • gita is my alias for git add all
  • gpo is my alias for pushing to origin
Collapse
 
amejiarosario profile image
Adrian Mejia

Nice!

Collapse
 
jckuhl profile image
Jonathan Kuhl • Edited

Huh

 165 node challenge.js
  16 cargo run
  13 python3 quadratic2.py
  12 make linkedlist
  11 ls
  11 ./linkedlist
   9 rustc hello.rs
   9 python3 multiply.py
   8 python3 multiply.py 4 -3
   6 python3 numberofcalls.py rumford augusta

Not typical at all. The first one is a set of 50 javascript challenges, so that makes sense.

The second, I was learning Rust for a bit.

The linkedlist was me trying to implement a Linked List in C++, and realizing I don't know C++ well enough to do so.

Last week or so I was playng with Rust and a bit of Python, while working through a JavaScript challenge, so I guess it makes sense, but it's not typical.

It should be the five basic git commands (init, status, add, commit, push), shortcuts I've aliased for my most used directories and clear

Collapse
 
jessedavid profile image
Jesse David
 423 cd ..
 362 bin/build
 318 npm run start
 225 bin/start
 169 ls
 164 yarn install
 159 bin/test
  99 npm install
  87 yarn run gulp
  87 git push heroku master

I'm a js developer that traverses his file structure often.

Collapse
 
david_ojeda profile image
David Ojeda

I don't use aliases :P

Commands

Collapse
 
david_ojeda profile image
David Ojeda

IDE takes care of commands for running/testing app and stuff

Collapse
 
amejiarosario profile image
Adrian Mejia

nice, what IDE are you using that runs git commands for you?

Collapse
 
hammotime profile image
Adam Hammond
  49 ls
  39 terraform apply
  24 docker logs test-container
  22 terraform plan
  20 git status
  16 git push
  12 ./index.sh 
   9 aws-creds status
   8 aws-creds login
   7 cd ..
Collapse
 
amejiarosario profile image
Adrian Mejia

I guess you are in devOps, or at least that's what your commands looks like

Collapse
 
mccurcio profile image
Matt Curcio • Edited

The only that stand out from list are htop and R. haha

gits - git status
htop - see ditty below

Oh lord won't you buy me 32 gigs of ram,
My friends all have 16 I must make amends,
Worked hard all my life time, no help from my friends...
Sung to the tune of Janis Joplin's - Mercedes Benz

cd
ls
gitp - git pull
gita - git add all
xed
git remote
git push
R - Can you tell I do Stats alot?? ;))

Collapse
 
oscarbastardo profile image
Oscar Bastardo


312 git status
148 ls
112 git log
90 docker-compose up
79 docker ps
72 yarn test
67 yarn start
58 git diff
54 cd ..
43 yarn dev

I just came to realise I'm a JS developer :')

Collapse
 
amejiarosario profile image
Adrian Mejia

nice!

Collapse
 
vitorbari profile image
Vitor Bari Buccianti
1. gst
2. gapa
3. ggpush
4. ls
5. exit
6. git diff
7. kubectl get pods
8. clear
9. ggpull
10. ktx
Collapse
 
amejiarosario profile image
Adrian Mejia

Is ktx and alias?

Collapse
 
vitorbari profile image
Vitor Bari Buccianti

"manage kubernetes cluster configs"
github.com/heptiolabs/ktx

Collapse
 
steelwolf180 profile image
Max Ong Zong Bao
  • git status
  • git commit -a
  • git push
  • git add .
  • git branch
  • git pull
  • ls
  • mv
  • cd
  • pwd
Collapse
 
jyotishman profile image
Jyotishman Saikia

72 gs
50 clear
34 git add .
22 git push origin develop
20 cd
18 cordova run android
14 git pull origin develop
13 code .
11 git push origin master
8 npm start