du -sh /too/bar
to get size of files/folders. sudo !!
inserts sudo into previous command when forgotten. yay
for full system update if yay is installed. cat
reads files.
Asklemmy
A loosely moderated place to ask open-ended questions
Search asklemmy ๐
If your post meets the following criteria, it's welcome here!
- Open-ended question
- Not offensive: at this point, we do not have the bandwidth to moderate overtly political discussions. Assume best intent and be excellent to each other.
- Not regarding using or support for Lemmy: context, see the list of support communities and tools for finding communities below
- Not ad nauseam inducing: please make sure it is a question that would be new to most members
- An actual topic of discussion
Looking for support?
Looking for a community?
- Lemmyverse: community search
- sub.rehab: maps old subreddits to fediverse options, marks official as such
- !lemmy411@lemmy.ca: a community for finding communities
~Icon~ ~by~ ~@Double_A@discuss.tchncs.de~
Getting cheatsheets via curl cheat.sh/INSERT_COMMAND_HERE
No install necessary, Also, you can quickly search within the cheatsheets via ~
. For example if you copy curl cheat.sh/ls~find
will show all the examples of ls
that use find
. If you remove ~find
, then it shows all examples of ls
.
I have a function in my bash alias for it (also piped into more
for readability):
function cht() { curl cheat.sh/"$1"?style=igor|more }
GNU Parallel
I use "ping" every time I suspect my internet might be going a bit slow.
I really like how nushell can parse output into it's native structures called tables using the detect
command.
Unlike string outputs, tables allow for easy data manipulation through pipes like select foo
will select foo key and you can filter and even reshape the datasets.
This is great if you need to work with large data pipes like kuberneters so you can do something like:
kubectl get pods --all-namespaces | detect columns | where $it.STATUS !~ "Running|Completed" | par-each { |it| kubectl -n $it.NAMESPACE delete pod $it.NAME }
This looks complex but it parses kubectl table string to table object -> filters rows only where status is not running or completed -> executes pod delete task for each row in parallel.
Nushell take a while to learn but having real data objects in your terminal pipes is incredible! Especially with the detect
command.
There's are few more shells that do that though nu is the most mature one I've seen so far.
Going to shamelessly plug my custom bashrc setup which has a ton of little scripting helpers and a few useful aliases. Remember to clone recursively if you want to try it out. (Still very much a work in progress, but it's getting to be pretty robust)
locate
, from the mlocate
package. So useful. Honorable mention goes out to tldr
.
compgen -back
to see all valid things you can type into a shell.
Zoxide, dust, fd, rg, btm, tokei. So many newer Rust tools that are way better than the old stuff.