Skip to main content

New answers tagged

0 votes

Flash drive won't mount after rsync

Rsync is just reading and writing files into a filesystem. As such, it can't (by itself) mess up hardware or a filesystem. However if there is already a software bug or a hardware failure present, ...
BowlOfRed's user avatar
  • 3,832
2 votes
Accepted

Zsh: Non-reverse history search

That handling of ^S/^Q characters that gets in the way of readline's (as used by bash) forward-search-history widget (bound to Ctrl+s in emacs mode) or zsh's equivalent history-incremental-search-...
Stéphane Chazelas's user avatar
6 votes
Accepted

What do the hexadecimal numbers represent on the ls output of the /dev directory?

If we're to believe the major(), minor(), makedev() macros at https://github.com/apple-oss-distributions/xnu/blob/xnu-10063.141.1/bsd/sys/types.h#L161 in the XNU sources that Apple makes available, ...
Stéphane Chazelas's user avatar
0 votes

ssh connection "client_loop: send disconnect: Broken pipe" or "Connection reset by <IP> port 22"

I ran into this issue when trying to connect to a Windows SSH server from a Linux script (for automations). It turns out that OpenSSH on Windows is really bad at inferring what shell to launch. This ...
garrettmills's user avatar
6 votes

Assign variable a value and copy this value to the clipboard

You could do: {pbcopy}<<<${zsh::==zsh} =cmd is a filename expansion operator, that expands to the path of the first command found in $PATH. Similar to what the which builtin outputs except ...
Stéphane Chazelas's user avatar
4 votes
Accepted

Assign variable a value and copy this value to the clipboard

I somehow thought that you could set the variable using parameter expansion, then output it and pipe it: echo ${zsh::=$(which zsh)} | pbcopy but that’s incorrect, the variable is set in a subshell. ...
Stephen Kitt's user avatar
2 votes
Accepted

To make 'rmdir' and 'find -delete' ignore '.DS_Store' files

Note that -delete implies -depth (process leaves between branches they're on). That's unrelated to FreeBSD's -depth n extension which returns true if the current file being processed is at depth n. ...
Stéphane Chazelas's user avatar
2 votes

To make 'rmdir' and 'find -delete' ignore '.DS_Store' files

.DS_Store files can prevent directories from being deleted as they cause the directories to be non-empty. You can use a combination of shell commands to find and delete these files, and then proceed ...
YassineLbk's user avatar
3 votes
Accepted

Manpage of 'regex(7)', from the shell

The command for displaying the man page for foo in section 7 is man 7 foo. The syntax foo(7) is how references to that man page are usually written. The section numbers and page names are not the same ...
Gilles 'SO- stop being evil''s user avatar
4 votes
Accepted

Paste the value of a shell expression into Vim

Instead of using the clip-board, this use-case is perfect for :r! :r! echo $(which bash) : enters command mode r means we will read something (if we don't include !, then it will read a file). ! ...
Stewart's user avatar
  • 14.4k
1 vote

Paste the value of a shell expression into Vim

If you're on macos as per the question tags, then the default Vim has clipboard support: % /usr/bin/vim --version | grep -wo -e '.clipboard' -e '.*version.*' macOS version - arm64 Normal version ...
muru's user avatar
  • 75k
23 votes
Accepted

Why does editing '/etc/shells' file using 'sudo open' shows an error saying I don't own the file?

The macOS command open command will not actually start the editor on its own. Instead, it asks the macOS Launch Services to do it. Your login session's Launch Services component runs as your regular ...
telcoM's user avatar
  • 103k
6 votes

Why does editing '/etc/shells' file using 'sudo open' shows an error saying I don't own the file?

The sudoedit command (man sudoedit) solves this problem. First, setup sudoedit: In your ~/.bashrc, add: export EDITOR=$(type -p editor_of_choice) export VISUAL=$(type -p editor_of_choice) Then source ...
waltinator's user avatar
  • 5,445
2 votes

Why does editing '/etc/shells' file using 'sudo open' shows an error saying I don't own the file?

I couldn't find anything in the man page explaining this behavior, but I'm guessing that it's resolving who the graphically logged in user is and trying to open the file as that user even when it's ...
Walter C. Murrell's user avatar
0 votes

How to create a bootable USB for Debian on Mac with Apple Silicon?

I know it's an old question, but I faced the same issue recently and found a way to make it work using dd. You can create bootable USB (for Ubuntu server for e.g.) using a Mac following these steps: ...
fourthisle's user avatar

Top 50 recent answers are included