You might want to convert a really long string in a single line into multiple lines with specified width. For example, if you have string like 12345678912345678912345678912345678912345678910 and want to split the long text to multi-line text, where each line is of length w, like w=9 123456789 123456789 123456789 123456789 123456789 10 In the above […]
11 Ways to Use find Command in Linux to Search Files/Directory
The find command is Linux is one of the most useful commands for searching files and directories. At first the find command syntax might look a bit daunting, but once we get a hang of it, the find command is a great asset. How to print all files and directories in current directory? find . […]
Bash tip: Search through history using the up and down arrows
Ctrl-R is one of the most useful commands on the terminal and it allows to browse through command history and re-use it again. On bash shell there is a much simpler way to search through your command history on terminal. Basically you can start typing the initial letter and then use up and down arrow […]
“with” statement in Python to Open a file
A common way to work with files in Python is to create file handler with “open” statement and work with the file. After finishing the work with the file, we need to close the file handler with close statement. For example, if we want to read all lines of a file using Python , we use […]
25 Tips to Move Around in Vim
h Move left j Move down k Move up l Move right w Move to next word W Move to next blank delimited word b Move to the beginning of the word B Move to the beginning of blank delimited word e Move to the end of the word E Move to the end of blank delimited […]