I'm so sick and tired of typing "cat $some_dir" or "ls $some_file" that I'm thinking of writing bash functions that will switch the two around, as needed. The cat $some_dir is particularly bad as it really screws up my terminal settings by spewing junk across the screen.
less dir/
less file.txt
However, on the FreeBSD machines I use, "less" can't handle directories, so I don't depend on it for that.
Re:You want "less"
chibiryuu on 2007-08-01T14:01:04
less dir/
only works for me when$ENV{LESSOPEN}
is set to an appropriate script, regardless of Linux or BSD.
cat
spews junk? All I get is
$ cat.
cat:.: Is a directory
Btw, blindly typing reset
+ Enter on a screwed terminal will often fix it.
Re:Wha?
Ovid on 2007-08-01T18:03:43
The reset command breaks my backspace key, though. I could probably source my
.bashrc as I think I have something in there to fix it, but I can't recall. Re:Wha?
chibiryuu on 2007-08-01T18:16:38
Linux typically generateserrno=EISDIR
onopen(".", O_WRONLY)
andread(dirfd, …)
. IIRC, the latter varies by filesystem on BSD.