I quite like this list, there are a number of utilities here that I already use on a daily basis. There are also a few utilities that I like that weren't on this list, or some alternatives to what was shown. Some off the top of my head: - nnn[0] (C) - A terminal file manager, similar to ranger. It allows you to navigate directories, manipulate files, analyze disk usage, and fuzzy open files. - ncdu[1] (C) - ncurses d…
An Illustrated Guide to Useful Command Line Tools
61–70 of 108 posts
Re: An Illustrated Guide to Useful Command Line Tools
#62Earlier quoted context omitted.
I’ve actually found myself using these to get me much more proficient in the Shell overall. fd in particular is so much easier to use I find myself doing things like: fd .log$ -x mv {} {.}.bak (Rename *.log to *.bak) Can I do that with xargs, awk, and find? Yes, but every time I have to look up the man page to at least one of them and it’s enough friction that I might just open it in finder if it’s a handful of files…
bash/zsh: for f in *.log; do mv "$f" "${f/%log/bak}"; done a bit more generic, `for` loops and parameter expansion are good to know for proficiency, and also I dislike typing curly braces.
Re: An Illustrated Guide to Useful Command Line Tools
#63Lots of cool stuff in here. I’m going to have a long look at Restic and Syncthing. I’d like to know why Skim instead of FZF. They are pretty similar but I’ve been using the latter for years and would like to know of any possible advantages to it.
Re: An Illustrated Guide to Useful Command Line Tools
#64I’m gonna sound like an old person here. As much as these tools are gorgeous and ergonomic, remember that the others are standard, which means they’re available (almost) everywhere. Still though, these alternatives seem great for productivity locally, even if they’re not usable in a script.
I’ve actually found myself using these to get me much more proficient in the Shell overall. fd in particular is so much easier to use I find myself doing things like: fd .log$ -x mv {} {.}.bak (Rename *.log to *.bak) Can I do that with xargs, awk, and find? Yes, but every time I have to look up the man page to at least one of them and it’s enough friction that I might just open it in finder if it’s a handful of files…
Re: An Illustrated Guide to Useful Command Line Tools
#65Re: An Illustrated Guide to Useful Command Line Tools
#66Earlier quoted context omitted.
bash/zsh: for f in *.log; do mv "$f" "${f/%log/bak}"; done a bit more generic, `for` loops and parameter expansion are good to know for proficiency, and also I dislike typing curly braces.
This doesn't move files in subdirectories? Or am I missing something?
Re: An Illustrated Guide to Useful Command Line Tools
#67Earlier quoted context omitted.
I’ve actually found myself using these to get me much more proficient in the Shell overall. fd in particular is so much easier to use I find myself doing things like: fd .log$ -x mv {} {.}.bak (Rename *.log to *.bak) Can I do that with xargs, awk, and find? Yes, but every time I have to look up the man page to at least one of them and it’s enough friction that I might just open it in finder if it’s a handful of files…
You might like zsh if you haven't tried it. Has a builtin `zmv` that does this. Check out oh-my-zsh
But what if I want to count the number of total files within each directory? Create tarballs out of each directory? Rename files that contain the word "FOOBAR" in them?
I can do this with fd and similar tools with slight modifications. With zmv I can rename files.
Re: An Illustrated Guide to Useful Command Line Tools
#68No mention of things that have gained a lot of traction, like `ag` and `fzf` ag: - silver searcher, fast parallelized recursive grep that can abide by things like `.gitignore` fzf: - fuzzy finder powerline-shell - $PS1 on steroids
Re: An Illustrated Guide to Useful Command Line Tools
#69Earlier quoted context omitted.
This doesn't move files in subdirectories? Or am I missing something?
You are right, it does not. But the find command is not too complicated, or different from the one above.
Let's use an example I just dug up of using find:
To list and remove all regular files named core starting in the directory /prog that are larger than 500KB, enter:
find /prog -type f -size +1000 -print -name core -exec rm {} \;
OK first, how in the hell is 1000 == 500kb? Is that a bug in my example[0]? What does `-print` do exactly? And that backslash at the end? I have no clue what that signifies. I'm never going to remember this madness. I'd probably have resorted to writing a bash script in a file by now. But with fd it becomes manageable and memorable for future tasks:To list and remove all regular files named core starting in the directory /prog that are larger than 500KB, enter:
fd --type=file --size=+500k ^core$ ./prog -x rm {}
Now that's something that makes immediate sense even if you've never touched the tool before. Not to mention, it doesn't end up in my .git and other ignored directories.Re: An Illustrated Guide to Useful Command Line Tools
#70Earlier quoted context omitted.
You might like zsh if you haven't tried it. Has a builtin `zmv` that does this. Check out oh-my-zsh
This suggestion is exactly why fd is so helpful. With zmv I can rename files in a directory. Great. But what if I want to count the number of total files within each directory? Create tarballs out of each directory? Rename files that contain the word "FOOBAR" in them? I can do this with fd and similar tools with slight modifications. With zmv I can rename files.