Skip to content

Instantly share code, notes, and snippets.

View fieldse's full-sized avatar

Matt fieldse

View GitHub Profile
@fieldse
fieldse / grepmatch.md
Created September 4, 2017 17:33
Show lines before and after a matching string with grep

Grep to show the surrounding 2 lines before and after your match

grep 'some string to match' -B 2 -A 2 myfile.txt

To list files that will be installed by a debian package (.deb) which is not currently installed on your system

# Ubuntu 15.04+ 
apt download <packagename>

# Earlier versions of Ubuntu
apt-get --download <package name>
@fieldse
fieldse / List files installed by a Debian or Ubuntu .deb package.md
Last active September 3, 2017 13:48
List files installed by a Debian or Ubuntu .deb package
dpkg -L <package name>

Example:

$ dpkg -L apache2
/.
/usr
/usr/share