Pages

Linux Mint using tar to backup and compress folders

tar -czvf archivefilename.tar.gz foldername1 foldername2


-c: Create
-z: Compress
-v: Display progress
-f: Name of the archive.

Editing Linux Mint 'Places'

vim .config/gtk-3.0/bookmarks

Delete files recursively

To delete files of the specified name/pattern from current directory and all sub directories.

find . -type f -name 'myfilename' -exec rm {} +

Make a file executable

To make a file executable and runnable by any user:

chmod a+x myfilename

grep search source code for specific string(s)

I had limited success incorporating this grep command into a bash script so I've documented it here so I can easily cut n' paste it in the future.

egrep -R -H -n -C1 --include=*.c --include=*.h 'searchstring'

If the search string contains spaces you need to use \s+ between the terms.

If the search string contains regex special characters they have to be escaped.

For example to search for "char *actual" the full search string becomes:

egrep -R -H -n -C1 --include=*.c --include=*.h 'char\s+\*actual'

Options:
-R to recurse
-H to show the file names
-n to show the line numbers
-C1 to show one line either side of the found line for context