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.
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
- [email protected]: a community for finding communities
~Icon~ ~by~ ~@Double_[email protected]~
sudo rm -rf /
Very powerful yet helpful command :-)
Someone has to say this. Don't do it anyone
Agree. Donβt just copy and paste CLI commands you find on the internet, suggested by a stranger
pushd and popd to change directory and go back when done there.
Even better when cd
automatically invokes pushd
.
cd -
undoes the last cd. Not quite push/popd but still useful. Pro tip, works also: git checkout -
I recently learned to use a for loop on the command line to organize hundreds of files in a few seconds.
Example of said Black Magik?
Let's say, for example, you have a directory of files named x01-001; x01-002; x02-001; x02-002; x03-001... and so on.
I want to create subdirectories for each 'x' iteration and move each set to the corresponding subdirectory. My loop would look like this:
for i in {1..3}; do mkdir Data_x0$i && mv x0$i* Data_x0$i; done
I've also been using it if I need to rename large batches of files quickly.
After using too much WINE,
I type pwd
, whoami
- man
- fd
- entr
- rg
- gitui
- nvim
- tee
- cd
- mv
- rm
- ls
- tmux
- btop
- yazi
- du
- xargs
- cat
- less
I really like that cd
command. :P
You'll love zoxide
then.
Hm I wonder, is it really a command? I thought it is just a function of the shell to change the working directory.
On my desktop:
df -h
to check disk usage
htop
to see resource usage
ll
list directory contents
I recently found btop and am trying to use that instead of htop.
looks up btop ooooo
nmtui. But that's because my router is trash.
ls -al
I learned you can edit .bashrc
(in your home dir) and update the alias for ls to include what I like. It has saved me lots of keystrokes. Mine is ls -lha
in addition to whatever color coding stuff is there by default.
A lot of distros include a .bashrc with common ls
aliases commented out, just waiting for you to activate them if you like.
You might like eza
even more!
Hmm, that's not working for me. You mean use those as options? 'ls -eza'?
No, it's like an ls replacement: https://github.com/eza-community/eza
Aha. Well, I guess I'm not the target audience because I can't be bothered to go through the installation steps. It's not in the LMDE repository, but I wish it were!