Skip to main content
Share Your Experience: Take the 2024 Developer Survey

All Questions

Tagged with
Filter by
Sorted by
Tagged with
2 votes
2 answers
245 views

Bash frequently fails to redirect stdout to a file (from cat)

I commonly append to text files using cat: cat >> FILE I use an alias to avoid accidentally overwriting the file (with a single >): alias a='cat >>' Enter changes the line and Ctrl + ...
user598527's user avatar
1 vote
1 answer
411 views

How to sync two folders with the same file names but different extensions

Is there a means of using rsync to sync two folders? I would like to shoot photos in JPG and RAW. Since viewing JPGs is much quicker than opening up RAWs, I'd like to do culling in the JPG folder and ...
Sparatan117's user avatar
1 vote
1 answer
235 views

Signal lost for Bash background process

When I spawn a background job in Bash 5.1 and immediately send it a signal, this signals seems to get lost. Short demo: $ cat simple.cc #include <signal.h> #include <unistd.h> #include &...
Bashful Thinking's user avatar
2 votes
2 answers
793 views

Separate bashrc file for ssh sessions to avoid Unison Errors

Recently my Unison started throwing up some strange error whenever I tried to sync between my laptop and my PC. I realized that I had added a line in bashrc that would print my pending tasks whenever ...
shivams's user avatar
  • 4,575
28 votes
2 answers
14k views

How to sync terminal session command history in bash?

I've tried to search in ~/.bash_history for my recent commands while in a terminal session but they just weren't there. I guess this is because I have multiple terminal sessions open. Is there a ...
n611x007's user avatar
  • 1,007
2 votes
2 answers
1k views

How to have a chroot system mount shared with its host?

Say I chrooted into ~/myroot with its /mnt being bind-mounted from the host's /mnt. Now (from within the chroot environment) I want to e.g. mount /dev/something /mnt/something such that not only the ...
Tobias Kienzler's user avatar
23 votes
2 answers
53k views

Move files and delete directories with rsync?

Recently I needed to delete a large number of files (over 1 million) and I read that doing: rsync -av --delete `mktemp -d`/ ~/source && rmdir ~/source Was one of the most optimized ways to ...
Alix Axel's user avatar
  • 2,939
19 votes
4 answers
11k views

sharing or synchronizing history between Zsh and Bash

I often find myself switching between Bash and Zsh, and using the history search functionality to recover a command. However, since Bash and Zsh have different history files, I often find that the ...
Andrei's user avatar
  • 1,753