Hot answers tagged

6 votes
Accepted

Modify 2>&1 so that output goes to a specific file and any errors or other output goes to a log file I can monitor?

Yes, this is possible. The 2>&1 means the following: 2 : stderr > : output redirect & : copy file descriptor 1 : file descriptor 1 So: stderr output redirect to wherever file descriptor ...
user avatar
  • 56k
3 votes

In bash, declare an alias that depends on current variable content

alias is a builtin, not a keyword that could make Bash interpret the rest of the line in a different way than it normally does this. And normally double-quoted (or unquoted) variables are expanded by ...
user avatar
2 votes
Accepted

expect -timeout vs. "set timeout" in expect: Different behavior

The problem is explained fully in the Stack Overflow post Why doesn't this expect handle timeout or eof. In short, the -timeout flag should be used prior to the Expect's pattern, not on the actions. ...
user avatar
  • 411k
2 votes

-P option on wget does not work on windows 11

The wget command in PowerShell is an alias for a PowerShell-native command named Invoke-WebRequest that doesn't have these parameters. Use instead the wget product from the Command Prompt (CMD).
user avatar
  • 411k
1 vote

Run or send a command to a tmux pane in a running tmux session

Add commands to a simple text file queue: This is only a last resort, if you really wanted to run the command after the last one without killing it. Example Write a bash script that takes a [cli ...
user avatar
  • 111
1 vote

Linux Shell: Copy output into clipboard w/o using the Mouse?

you can pipe the output of a command to a file. like pwd > file.txt so if you save a variable to your bash file you can : pwd > $variable cat $variable |pbcopy
user avatar
1 vote
Accepted

How to have Ctrl+[key] modify a full word and Alt+[key] modify a partial word in ZSH?

Zsh unfortunately does not ship with widgets that do exactly that and it’s non-trivial to write your own. However, you can get ready-made versions of these as part of my Zsh Edit plugin.
user avatar
1 vote
Accepted

zsh alias for running the most recent matching history item

History expansion is performed on your command line before alias expansion. So, putting a history expansion into an alias won’t work, because, after the alias gets expanded, no more history expansion ...
user avatar
1 vote

Chain arp and nslookup to get hostname for each ip (Win)

Answer I was looking into the same thing. There's a powershell equivalent called Get-NetNeighbor. Here's something you can paste into powershell that'll do what you want. # Equivalent to ARP Get-...
user avatar

Only top scored, non community-wiki answers of a minimum length are eligible