4 ms·
Does someone know what's this use of grep as cat he alludes at ?
by vorador 17y ago
Does someone know what's this use of grep as cat he alludes at ?
- fhars 17y agoYou can use grep '.*' > /etc/password instead of cat > /etc/password
- jvdh 17y agosince echo still worked, why would you need grep for that one?
- olefoo 17y agoMatch any non-empty line. /usr/bin/grep ".*" /path/of/file
- nash 17y agoSod any 'non-empty line' /usr/bin/grep '^' > output Or even better, grep can be an editor with line filtering - if you make an mistake, have it throw away the line: /usr/bin/grep -v '%' > output (Any line with a %, throw away, keep the rest - good for multi-line files)
- JoachimSchipper 17y agoThat command actually matches any line. You seem to have confused it with egrep ".+".
- rdtsc 17y agoPerhaps using grep to match anything and thus output the whole file? grep '.*' file