Unix & Linux questions and answers

Unix & Linux

Transmit bitrate shown in `iw` is unexpectedly low

> iw dev wlp5s0 link Connected to 00:35:1a:41:2d:cf (on wlp5s0) SSID: eduroam freq: 5240 RX: 59188796 bytes (179767 packets) TX: 351043602 bytes (273799 packets) signal: -59 dBm tx bitrate: 6.0 MBit/s bss flags: short-slot-time dtim period: 1 beacon int: 102 > iw dev wlp5s0 station dump Station 00:35:1a:41:2d:cf (on wlp5s0) ....

Sophie Sophie: 02 February 2022

Unix & Linux

Eclipse quick switch windows does not have focus, does not work without mouse move

Using Eclipse Neon on Linux Mint with Xfce and "focus follows mouse" enabled, I try to use "quick switch windows" or "next editor" (CTRL+E or CTRL+F6) in the default bindings. In both cases, weird things happen to the keyboard focus. With "quick switch windows" the popup dialog appears at the ....

Camila Camila: 02 February 2022

Unix & Linux

How can I bind Ctrl-Alt-[0-9] in Tmux?

I am able to bind Ctrl-Alt- using M-C-a, M-C-b etc. However, when I attempt to bind Ctrl-Alt and a number key I get: .tmux.conf: 45: unknown key: M-C-0 Any idea why? I'm running tmux ver 1.7 Related: How to bind "Ctrl-Alt-b" as the prefix of tmux? (https://unix.stackexchange.com/questions/48264/how-to-bind-ctrl-alt-b-to-the-prefix-of-tmux) ....

Serenity Serenity: 02 February 2022

Unix & Linux

How to add hostname as first line of a file

I have a file which has a few lines. one two three four five I need to add hostname of the server I'm working on as the first line of the file. For example if abcd555.india.com is the server, the output file should be like : abcd555.india.com one two three ....

Ruby Ruby: 02 February 2022

Unix & Linux

Using an if statement for a list of words

So I have a program (say, programA), that will give me an output, for example: yes, no, maybe, probably, possibly, impossible, banana. I want to make a script that will do something, whatever it is, based on that output. Let's say I only need to account for yes, maybe and ....

Ryder Ryder: 02 February 2022

Unix & Linux

zsh: Is it possible to trace all functions and commands called and aliases expanded during a command’s execution?

I want something like this: # source: a() b mp3 m4a "$@" b() eval "${1}-to-${2} $@:q" alias mp3-to-m4a='ffmpeg ...' # $ traceall a a.mp3 a.m4a # should return: Functions: a b Aliases: mp3-to-m4a commands: ffmpeg ....

Athena Athena: 02 February 2022

Unix & Linux

Search and replace next n words in vi

Possible Duplicate: Vim :s replace first N < g occurrences on a line (https://unix.stackexchange.com/questions/27178/vim-s-replace-first-n-g-occurrences-on-a-line) In vi, how do I search and replace a word's first n occurrences with a word, say "hello", and the next m occurrences with bonjour, and all the rest with namaste? ....

Claire Claire: 02 February 2022

Unix & Linux

Showing color in log output using tail command when using Cygwin?

I have a debian install that runs an application server. I ssh into this debian install from a Windows computer using cygwin and with the application server running I use tail -f to monitor the log files. Errors from the application are printed in red, warning in yellow, and all ....

Madison Madison: 02 February 2022

Unix & Linux

Unable to use -o allow_other with sshfs (option enabled in fuse.conf)

I have the following on my /etc/fuse.conf file: # Set the maximum number of FUSE mounts allowed to non-root users. # The default is 1000. # #mount_max = 1000 # Allow non-root users to specify the 'allow_other' or 'allow_root' # mount options. # user_allow_other But when I try to mount ....

Muhammad Muhammad: 02 February 2022

Unix & Linux

Does bash while loop read variable "line" update itself if we modify the text file?

Say for example I have a text file called hello.txt that contains "Hello". If I have a while loop for reading it: while IFS= read -r line do echo $line > hello.txt # whatever that inserts/ edits something in the text file done < hello.txt Will the while loop read ....

Alexander Alexander: 02 February 2022