Linux

Feb 13, 2020

Go to line number in a file using vim

You want to see line 3842 of file called my_super_long_file.py and you can only access that file using vim. You open the file and to your dismay, by default, vim doesn’t display line numbers. Here are your options:

Nov 06, 2019

TIL: How to move a line in Vim

For a text like the following: This is the line I want to move. This line should be the first line. In order to move the first line down, in normal mode* (not edit or insert mode), follow these steps:

Jan 11, 2019

Customize your terminal prompt with colors

NOTE: the steps below assumes you have a Bash shell. If you are using a Unix machine (Mac or Linux) and are not sure what type oh shell you have, it’s probably Bash.

Nov 02, 2018

Send long terminal output to a log file

There are times when a command line output is too long and it’s hard to scroll through all the lines to see the beginning of the stack trace. This usually happens when you get errors and the best way to fix errors is to read the very first few lines to understand what error message you got and where the error is coming from.