Skip to main content
added 162 characters in body
Source Link
Faheem Mitha
  • 36.1k
  • 33
  • 129
  • 189

Much of the time, and probably in this case, just plain less will do the right thing. This uses the so-called less preprocessor. So, do

less file.sql.gz

This won't actually write the file in plain text to the filesytem; it is for your viewing pleasure only, but much of the time that is enough. I personally find the less preprocesor quite useful. It saves me from remembering a bunch of commands. On Debian, at least, the less preprocessor is /usr/bin/lesspipe. This is aa shell script. This location of this can possibly be found by checking the value of the enviroment variable LESSOPEN. e.g.

echo $LESSOPEN
|/usr/bin/lesspipe %s

The relevant part of this script for just a gzipped text file is:

                 # Note that this is out of alpha order so that we don't catch
                    # the gzipped tar files.
                    *.gz|*.z|*.dz)
                            gzip -dc "$1" ;;

This is with less version 444-4 on Debian wheezy.

Much of the time, and probably in this case, just plain less will do the right thing. This uses the so-called less preprocessor. So, do

less file.sql.gz

This won't actually write the file in plain text to the filesytem; it is for your viewing pleasure only, but much of the time that is enough. I personally find the less preprocesor quite useful. It saves me from remembering a bunch of commands. On Debian, at least, the less preprocessor is /bin/lesspipe. This is a shell script.

The relevant part of this script for just a gzipped text file is:

                 # Note that this is out of alpha order so that we don't catch
                    # the gzipped tar files.
                    *.gz|*.z|*.dz)
                            gzip -dc "$1" ;;

This is with less version 444-4 on Debian wheezy.

Much of the time, and probably in this case, just plain less will do the right thing. This uses the so-called less preprocessor. So, do

less file.sql.gz

This won't actually write the file in plain text to the filesytem; it is for your viewing pleasure only, but much of the time that is enough. I personally find the less preprocesor quite useful. It saves me from remembering a bunch of commands. On Debian, at least, the less preprocessor is /usr/bin/lesspipe. This is a shell script. This location of this can possibly be found by checking the value of the enviroment variable LESSOPEN. e.g.

echo $LESSOPEN
|/usr/bin/lesspipe %s

The relevant part of this script for just a gzipped text file is:

                 # Note that this is out of alpha order so that we don't catch
                    # the gzipped tar files.
                    *.gz|*.z|*.dz)
                            gzip -dc "$1" ;;

This is with less version 444-4 on Debian wheezy.

added 386 characters in body
Source Link
Faheem Mitha
  • 36.1k
  • 33
  • 129
  • 189

Much of the time, and probably in this case, just plain less will do the right thing. This uses the so-called less preprocessor. So, do

less file.sql.gz

This won't actually write the file in plain text to the filesytem; it is for your viewing pleasure only, but much of the time that is enough. I personally find the less preprocesor quite useful. It saves me from remembering a bunch of commands. On Debian, at least, the less preprocessor is /bin/lesspipe. This is a shell script.

The relevant part of this script for just a gzipped text file is:

                 # Note that this is out of alpha order so that we don't catch
                    # the gzipped tar files.
                    *.gz|*.z|*.dz)
                            gzip -dc "$1" ;;

This is with less version 444-4 on Debian wheezy.

Much of the time, and probably in this case, just plain less will do the right thing. This uses the so-called less preprocessor. So, do

less file.sql.gz

This won't actually write the file in plain text to the filesytem; it is for your viewing pleasure only, but much of the time that is enough. I personally find the less preprocesor quite useful. It saves me from remembering a bunch of commands.

Much of the time, and probably in this case, just plain less will do the right thing. This uses the so-called less preprocessor. So, do

less file.sql.gz

This won't actually write the file in plain text to the filesytem; it is for your viewing pleasure only, but much of the time that is enough. I personally find the less preprocesor quite useful. It saves me from remembering a bunch of commands. On Debian, at least, the less preprocessor is /bin/lesspipe. This is a shell script.

The relevant part of this script for just a gzipped text file is:

                 # Note that this is out of alpha order so that we don't catch
                    # the gzipped tar files.
                    *.gz|*.z|*.dz)
                            gzip -dc "$1" ;;

This is with less version 444-4 on Debian wheezy.

Source Link
Faheem Mitha
  • 36.1k
  • 33
  • 129
  • 189

Much of the time, and probably in this case, just plain less will do the right thing. This uses the so-called less preprocessor. So, do

less file.sql.gz

This won't actually write the file in plain text to the filesytem; it is for your viewing pleasure only, but much of the time that is enough. I personally find the less preprocesor quite useful. It saves me from remembering a bunch of commands.