shred -vzf
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)
qalc
rsync
I use it to backup important work to an external drive.
Neofetch
Get on with the times, install fastfetch ;)
less
,watch
pv (Pipe Viewer) is a command line tool to view verbose information about data streamed/piped through it. The data can be of any source like files, block devices, network streams etc. It shows the amount of data passed through, time running, progress bar, percentage and the estimated completion time.
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 copycurl cheat.sh/ls~find
will show all the examples ofls
that usefind
. If you remove~find
, then it shows all examples ofls
.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 }
As primarily a Windows admin (Yes, we exist on Lemmy ;) ) here are few I use often.
Enter-PSSesion
Get-ADUser
(also group and computer)CLS
(aka the superiorclear
)ii .
(short forInvoke-Item .
which runs the selected object using the default method. For paths (like.
) the default is explorer, soii .
opens the current directory using explorer.)ft
(short forFormat-Table
formats piped input as a table.)fl
(short forformat-like
. Used likeft
but for lists.)Where-Object
Select-Object
Fucking hell Lol 😂
There are dozens of us.
Also, I’ll add:
- Get-Help
- Get-Command
- Get-Member
<Esc>[2J<Esc>[H
Is one of my favorites. Of course, most of you are too young to know what that means.
Is that easier than typing
clear
? Also, not sure why you’d say something like that about people’s age. Anyone using terminals today is often going to run into weird quirks of them being around for decades even if they’re young.In the days before *nx, “terminal” meant a VT terminal and “clear” wasn’t a thing.
g-push
which is alias forgit push origin `git branch --show`
Which I’m writing on my phone without testing or looking
git config --global alias.pusho 'push --set-upstream origin HEAD'
You’re welcome.
So that’s making
git push
always push to the current branch?
git push origin HEAD
is a slightly shorter way of doing the same thing, even though you have an alias anyway lol
In my ~/.bashprofile:
alias resource="source ~/.bashprofile"
In my terminal:
resource
Anything to save a few characters
exec $SHELL -l
omz reload
not going to say zsh is better than bash or fish, but oh-my-zsh does make it more attractive for some use-cases
omz is bloat and slows fown your shell a lot. Just do this: https://www.youtube.com/watch?v=21_WkzBErQk
And I’d recommend starship for a custom prompt, it’s really good: https://starship.rs
Edit: For other ZSH nice-to-haves: https://www.youtube.com/watch?v=eLEo4OQ-cuQ
I’ll have to give starship a try, seems like a cool way to handle customizing the prompt
as to the “omz is bloat and slows down your shell”:
- How slow? Because I’ve never noticed. Are we talking about waiting for 15 seconds when I should only have to wait for 1, or are we talking theory and the difference between 0.5 vs 0.08 seconds in benchmarks?
Because I’ve never been inconvenienced by the speed of my shell nor terminal emulator, despite having tried all kinds of setups. Turns out that “blazing fast” gpu accelerated terminal really didn’t make much of a difference on human timescales. Now I’m at the point where I appreciate the features over the performance.
- In reply to Brody’s point, I’m inclined to say “yes, and…?”
OMZ automates a lot. Sure, I could follow his way of manulaly sourcing dozens of individual shellscripts and making my own aliases and have a zshrc 1200 lines long… Or I could just let omz handle it.
Yes it’s mostly just a plugin manager, and…? Yes it automates a process I could do manually, and… ? Yes, it uses bindings that I didn’t personally write, and… ?
Fuck off with the clickbait “You’re living your life wrong, do this lifehack instead!!!” (and the lifehack is to reinvent the wheel) bullshit
Here’s a fun real lifehack: try things out for yourself, don’t just listen to and parrot other people’s opinions, don’t be afraid to go against the grain. Way more fun and fulfilling that way!
I have
cd && clear
aliased ashome
Lazy aliases unite!
$ z
A great cd alternative
Also $ sudo paru -Syu
I think you can run paru without sudo and it should still do privilege escalation no problem
CTR + u will delete the whole command. I use that a lot so I don’t have to backspace. It’s saved me a ton of time
How about ctrl+c to cancel and clear the command you are typing? It’s much easier because you only need 1 hand, and does not impact your shell’s history.
Related: Alt +
.
, to cycle through arguments used in previous commandsAnd then ctrl+y to paste it back and recover that text.
I just use control C, is there a difference other than whether the line shows up or not?
control+R
in bash, it lets you quickly search for previously executed commands.
its very useful and makes things much quicker, i recommend you give it a try.
I use this constantly
i rely on this in my job. if i really need it, i’ll be using it often enough that it’ll always be in ^R distance :)