Postgresql – connect to schema

Connect to database:

psql -U postgres

Play with the following commands:

\l - Display database
\c - Connect to database
\dn - List schemas
\dt - List tables inside public schemas
\dt schema1. - List tables inside particular schemas. For eg: 'schema1'.

How to find all files containing specific text on Linux

Do the following:

grep -rnw '/path/to/somewhere/' -e 'pattern'
  • -r or -R is recursive,
  • -n is line number, and
  • -w stands for matching the whole word.
  • -l (lower-case L) can be added to just give the file name of matching files.
  • -e is the pattern used during the search

Along with these, --exclude--include--exclude-dir flags could be used for efficient searching:

grep --include=\*.{c,h} -rnw '/path/to/somewhere/' -e "pattern"
grep --exclude=\*.o -rnw '/path/to/somewhere/' -e "pattern"
grep --exclude-dir={dir1,dir2,*.dst} -rnw '/path/to/search/' -e "pattern"

How to Create an ISO File in Linux

Install the package genisoimage:

sudo apt install genisoimage

Run the command mkisofs:

mkisofs -o destination-filename.iso /home/username/folder-name

Or, using dd, run the following command:

dd if=/dev/cdrom of=/home/username/iso-name.iso