Export data from Postgres as CSV
Exporting data from Postgres as a CSV or tab delimited file can be fairly simple using the COPY command. Examples below. Export an entire table as CSV: psql -c "COPY…
Exporting data from Postgres as a CSV or tab delimited file can be fairly simple using the COPY command. Examples below. Export an entire table as CSV: psql -c "COPY…
Currently AWS CLI doesn’t provide support for UNIX wildcards in a command’s “path” argument. However, it is quite easy to replicate this functionality using the --exclude and --include parameters available…
When working with Docker in Linux, you may find yourself using sudo before every Docker command. This is because the docker daemon binds to a Unix socket (which by default…
By default, the root user is locked in Ubuntu. To unlock it, simply run the command below, and provide the new password for the root user when prompted. sudo passwd…
Counting the distinct/unique elements of text file is a common task. Below is an example of doing this is AWK, using sample_data_1.txt. cat sample_data_1.txt \ | awk 'BEGIN{FS="\t"} NR>1{names[$2]=1} END{print…