cd
every single day.
Sudo !!
It reruns the last command as sudo.
Pretty useful since I'm always forgetting.
Seems like an appropriate place to share https://github.com/agarrharr/awesome-cli-apps
I'm a fan of ripgrep and lsd in particular.
sl
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.
Not a command but bang expansions. For example !?
is the args of last command useful for stuff like mkdir foo ; cd !?
https://www.redhat.com/sysadmin/bash-bang-commands learn these. you suck at using your computer if you don't know them.
Is there something similar in fish shell?
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
Related: Alt + .
, to cycle through arguments used in previous commands
sudo !!
to rerun last command as sudo.
history
can be paired with !5
to run the fifth command listed in history.
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.
ls
jq
Not a specific command, but I learned recently you can just dump any executable script into ~/bin and run it from the terminal.
I suffer greatly from analysis paralysis, I have a very hard time making decisions especially if there's many options. So I wrote a script that reads a text file full of tasks and just picks one. It took me like ten minutes to write and now I spend far more time doing stuff instead of doing nothing and feeling badly that I can't decide what to do.
I think the standard is ~/.local/bin, for the people that like standards.
This is because $HOME/bin
is in your $PATH
environment variable. You can add more paths that you'd like to execute scripts from, like a personal git repo that contains your scripts.
Since nobody has said yet, I use screen pretty heavily. Want to run a long running task, starting it from your phone? Run screen to create a detachable session then the long running command. You can then safely close out of your terminal or detach with ctrl a, d and continue in your terminal doing something else. screen -r to get back to it.
Don’t use screen
, but I do use tmux
pretty heavily.
I recently switched to tmux and boy, it's way better. I basically use only tmux now anymore. Creating panes to have two processes in one glance, multiple windows, awesome. Plus all the benefits of screen.
Try zellij. Not as popular as tmux, but very intuitive to use.
Maybe someone reading wants to now about prefix+s
. This doubles your excitement.
How does screen / tmux work when detached from a session, how does it keep the session alive (both when running locally, and while ssh:ing to a server)? Is there a daemon involved?
In a similar vein, nohup
lets you send tasks to the background and seems to be everywhere.
sudo pacman -Syu
clear
. Constantly, and for no reason.
Ctrl-L
Oh. I know. But you don't understand - I'm compelled to type it out. I must.
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 }
sudo udevadm monitor
Figuring out which usb device went on holiday.
Asklemmy
A loosely moderated place to ask open-ended questions
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
- [email protected]: a community for finding communities
~Icon~ ~by~ ~@Double_[email protected]~