shark_byte@lemmy.zip to Programmer Humor@programming.dev · 13 hours agoLinux Catlemmy.zipexternal-linkmessage-square42fedilinkarrow-up1298file-text
arrow-up1298external-linkLinux Catlemmy.zipshark_byte@lemmy.zip to Programmer Humor@programming.dev · 13 hours agomessage-square42fedilinkfile-text
minus-squarelokalhorst@feddit.orglinkfedilinkarrow-up14·edit-210 hours agoIf I just want to look at the file, is there a better way than cat foo.txt? I guess I can’t just do < foo.txt
minus-squareTwilightKiddy@scribe.disroot.orglinkfedilinkEnglisharrow-up1·48 minutes agoYou can use less. There are also specialized ones for that purpose like bat.
minus-squaredan@upvote.aulinkfedilinkarrow-up9·edit-26 hours agoAdmittedly I still use cat for this. This also works too, but it’s more verbose: echo "$(<foo.txt)" It’s mentioned in the Bash man pages: The command substitution $(cat file) can be replaced by the equivalent but faster $(< file).
minus-squaremote@lemmy.calinkfedilinkarrow-up15·11 hours agoSo close! you have to do cat < foo.txt :-) (/s)
If I just want to look at the file, is there a better way than
cat foo.txt? I guess I can’t just do< foo.txtYou can use
less. There are also specialized ones for that purpose like bat.Admittedly I still use
catfor this.This also works too, but it’s more verbose:
echo "$(<foo.txt)"It’s mentioned in the Bash man pages:
So close! you have to do
cat < foo.txt:-) (/s)