Find a String in Files Excluding Some Files

— tags: ‘shell, linux, command, development, grep,find’ categories: development — I use the following command to find a string in a Go repo. The vendor directory is not needed, so skip it. $ find . -type f |grep -v vendor|cut -d”:” -f2|xargs grep -n my_search_string The command find all files in current directory. Next, it … More Find a String in Files Excluding Some Files

Fixing Terminal Row & Columns Display on Docker and Linux

Ever faced garbled screen on a terminal, text wrapping over and screen command string messed up! It happens because the terminal is using default row and column value (e.g. columns = 80). The following command fixes it (tested on Docker container’s terminal) docker exec -e COLUMNS=”`tput cols`” -e LINES=”`tput lines`” -ti How it Works? tput … More Fixing Terminal Row & Columns Display on Docker and Linux

Linux Device Driver Development: Block Device Driver

It is my very first interaction with Linux kernel at device driver level. My objective is to develop a block device driver, very simple, that just forward I/O requests to a virtual device. This post explains my observations limited to attacking the problem. Block v/s Character Device Linux support block and character device drivers. Only … More Linux Device Driver Development: Block Device Driver

File system in userspace (FUSE) on Linux : C implementation

BBFS is a good starting point to develop a file system in C Application should keep in mind file offset before issuing a request. A write should be followed with a seek to offset zero, before issuing read. FUSE 2.7 reads 8K data by default, in two 4K chunks Read happens in last 4K and … More File system in userspace (FUSE) on Linux : C implementation