Moreutils – Unix tools that nobody thought to write (2012)
61–70 of 225 posts
Re: Moreutils – Unix tools that nobody thought to write (2012)
#62Earlier quoted context omitted.
But the top answer has it: > find . -maxdepth 1 -type f A little clunky, but there's certainly no need to mess about in JavaScript land. If you use it often, create a shell macro.
find doesn't return the same output as ls when run on another directory. Maybe there is a switch to do this? I'm not sure. $ mkdir -p tmp && touch tmp/a tmp/b tmp/c $ find ./tmp -maxdepth 1 -type f ./tmp/a ./tmp/c ./tmp/b $ ls -1 ./tmp a b c
Re: Moreutils – Unix tools that nobody thought to write (2012)
#63What is the difference between `sponge` and redirecting with `>` (or `>>`)? Is it about better compatibility with pipes or something?
Re: Moreutils – Unix tools that nobody thought to write (2012)
#64What is the difference between `sponge` and redirecting with `>` (or `>>`)? Is it about better compatibility with pipes or something?
My guess is sponge buffers all the input and then sends it to output once stdin is closed.
Re: Moreutils – Unix tools that nobody thought to write (2012)
#65What is the difference between `sponge` and redirecting with `>` (or `>>`)? Is it about better compatibility with pipes or something?
Re: Moreutils – Unix tools that nobody thought to write (2012)
#66What is the difference between `sponge` and redirecting with `>` (or `>>`)? Is it about better compatibility with pipes or something?
> Unlike a shell redirect, sponge soaks up all its input before opening the output file. This allows constricting pipelines that read from and write to the same file.
Re: Moreutils – Unix tools that nobody thought to write (2012)
#67Earlier quoted context omitted.
Rust is designed for a fairly small number of relatively modern systems; there are many close-to-POSIX systems that can’t (and I would guess likely will never) be able to run Rust code in any formal capacity. To the hopeful: even C++ has been unable to win here, despite having many more years of a head start and much more accommodation for stranger platforms. It’s just not going to happen.
What kind of platforms are you thinking of? People have got Rust running on the Raspberry Pi. https://old.reddit.com/r/rust/comments/cdcads/
Re: Moreutils – Unix tools that nobody thought to write (2012)
#68Where is Msdos utility "ncd"? It was like "cd" but guessed from few character hint where you wanted to go. If the choice was not immediately obvious if offered a menu or a tree. I shortened it to "n". -- There was some linux utility but setting it up was annoyingly tedious, with lots of useless and cryptic options.
I think that's the default behaviour in Zsh or Fish if you press tab.
Like I have subdir "/media/tnoko/sdc1/capture/Roinaa/".
"ncd Roi" should be totally sufficient and unique command to go there.
Re: Moreutils – Unix tools that nobody thought to write (2012)
#69Earlier quoted context omitted.
But the top answer has it: > find . -maxdepth 1 -type f A little clunky, but there's certainly no need to mess about in JavaScript land. If you use it often, create a shell macro.
find doesn't return the same output as ls when run on another directory. Maybe there is a switch to do this? I'm not sure. $ mkdir -p tmp && touch tmp/a tmp/b tmp/c $ find ./tmp -maxdepth 1 -type f ./tmp/a ./tmp/c ./tmp/b $ ls -1 ./tmp a b c
$ find ./tmp -maxdepth 1 -type f -printf '%f\n'Re: Moreutils – Unix tools that nobody thought to write (2012)
#70Nice collection of quite useful tools. Some of these can be easily replicated by using a more modern shell (bash, zsh) like mispipe, others are just shortcuts (e.g. ifne, chronic). But what immediately stood out to me is `vidir`. I really like the idea of editing file names with an editor. Using loops and regex in a shell for mass renaming can be a mess. It should be way easier with `vim`. This tool made me install m…
On most POSIX systems you can use fc(1) to edit a command in your $EDITOR. In vi(1) and friends you can then use "%!ls" to replace the contents of the buffer with directory listing and edit the commands you want. https://pubs.opengroup.org/onlinepubs/9699919799/utilities/f... https://pubs.opengroup.org/onlinepubs/9699919799/utilities/v...
I often used :r !ls for that, thanks for the tip + it's shorter