Search query: list files containing a certain term

To get a list of files that contain a certain term for the current directory you can use this command to find the search query:

This shell command searches the current directory recursively (-r) and lists (-l) all files containing the search query SEARCHTERM. SEARCHTERM can also be a regular expression. Example result:

If you […]

Count search results on Linux shell

Lets imagine you want to search for a term in a file and you want to know, how often it can be found in the file. With this command combination you can count search results on bash:

This is how this way to count search results works: The input file is opened in less. Afterwards […]

Linux – Get information about installed memory

On Ubuntu you’ll get the all memory (RAM) information with:

Example output:

If you only want to get the amount of installed memory, you can use grep to filter the output:

Example output:

To get the the amount of free memory you can simply use:

Example output:

It also gives you […]