New answers tagged

2 votes

What is an efficient way to listen on all ports?

I'd open a single port, and use iptables in DNAT mode to redirect all other ports to it. iptables \ -t nat \ -I PREROUTING \ -p tcp \ -d 1.2.3.4 \ \! --dport 12345 \ -j DNAT \ ...
Simon Richter's user avatar
2 votes

Install a specific Evince branch from source

Here is my recipe for compiling evince (comments welcome, I'm a beginner in debian packaging). It worked to install my customized evince on ubuntu 22. save the following script as build_deb.sh #!/bin/...
n0tis's user avatar
  • 217
0 votes

How to fix broken libc6 dependencies

My solution was to add i386 arch to jammy-updates in /etc/apt/sources.list deb [arch=amd64,i386] http://tn.archive.ubuntu.com/ubuntu/ jammy-updates main restricted Then run sudo apt --fix-broken ...
Mohamed Ali's user avatar
0 votes

Find and change Default Start Firefox Ubuntu 22.04

As currently written your question requires some editing to make sense to me. However, there is one part of your question that is very clear: You want to know if you can add the preference browser....
End Anti-Semitic Hate's user avatar
0 votes

How to edit terminal word boundary characters?

For me (22.04LTS) this setting (word-char-exceptions) works the opposite - the chars it contains are considered the word chars. So try adding anything you would like to be selected by double-click, ...
Alexander Shcheblikin's user avatar
0 votes

Is it possible to change the value of environment variable from a bash script so that it persists?

For years, I've been grappling with this limitation in Bash: not being able to execute a script and update my parent shell's environment variables directly. This issue has been a constant annoyance. ...
logicmoo's user avatar
3 votes

What's wrong with my use of the netcat command?

ncat doesn't support listening (or connecting) to multiple ports. Where did you read that? Never trust Copilot. Use man ncat. I don't exclude one / some of the many Netcat implementations would allow ...
kos's user avatar
  • 36.2k
0 votes

Tilix shortcuts problem

Update-alternatives didn't work for me. Ubuntu 23.10 Mint forums showed I was way overthinking it anyway https://forums.linuxmint.com/viewtopic.php?t=255895 Just make new custom keyboard shortcut in ...
VonRansak's user avatar
0 votes
Accepted

Fixing title of xterm even during editing a file inside it

You can pass the allowTitleOps: false X11 resource string allowTitleOps (class AllowTitleOps) Specifies whether control sequences that modify the window title or icon name ...
steeldriver's user avatar
0 votes

Is It Possible To Change the Date of Creation of a File (Docx, Pdf, jpg) from the Command Line?

Another option you may sometimes want is to set the timestamps to match those of another file. Say you have fileA and want to set its timestamps to match those of fileB, you can use: touch --reference=...
thomasrutter's user avatar
  • 36.8k
0 votes

Is It Possible To Change the Date of Creation of a File (Docx, Pdf, jpg) from the Command Line?

Touch as previously described will handle most of it. If it is necessary to change the creation date/time, move the file aside then copy the set-aside file to the original name and finally delete ...
user628388's user avatar
0 votes

terminal will not load, cant run any commands just blinks can't type

Se que ha pasado tiempo, y tambien se que el que inició el hilo ya habrá solucionado su problema de alguna manera... Sin embargo compartiré mi experiencia con este error porque considero que al ser ...
Santiago Castro's user avatar
3 votes

What is the signal sent when the charger is unplugged/plugged

which signal is sent to the kernel when I unplug my laptop. Not exactly "sent to kernel" as you can't intercept that from within user-space AFAIK ... However, related events from the kernel ...
Raffa's user avatar
  • 32.4k
1 vote

Using Sed to remove part of FASTA file header

This is exactly the kind of problem that sed is not suitable for. It is better to use the right tools for the right jobs. Commands like awk or cut can do a much better job in this case: With cut ...
user9101329's user avatar
0 votes

Show only selected data in text file without removing any data from it

You could have been a bit more generous by providing a few lines of input. I made up an arbitrary input file for testing the following code: $ sort -rnk5 ask1165945 | cut -d' ' -f1,2,3 1980 1 14 1980 ...
user9101329's user avatar
1 vote

input delay on Terminal Ubuntu 22.04.4

For any users looking for a quick fix to this issue, I have found that Konsole is not GTK/mutter-based and is not suffering from this issue. Konsole can be installed on Gnome through the software ...
db 1070's user avatar
  • 53
2 votes

What is the signal sent when the charger is unplugged/plugged

Easier method: Create a loop that constantly checks the status of /sys/class/power_supply/ADP1/online. 0 = wired; 1 = wireless. ADP1 can be something else so using /sys/class/power_supply/*/online is ...
Rinzwind's user avatar
  • 300k
0 votes

How do I create partitions on Ubuntu Server?

if your partition is already mounted you need to unmount it if its not mounted you can try sudo fdisk /dev/sda you can use gparted in a usb or instead you can boot in any live linux distro to ...
neoMidori's user avatar
2 votes

Installing Java

try using this command in the terminal: sudo apt install default-jre then you can try using: java -version to check version
neoMidori's user avatar
0 votes

Installing Java

Do not download binaries straight from the Internet. That is not how to install software on Linux. It is how Windows users do it, but it is wrong on Linux. Install it from the package manager. Google ...
Liam Proven's user avatar
1 vote

How to change keyboard layout( e.g. QWERTY , DVORAK) in KDE 5 from command-line?

To change keyboard layout configuration without using the system settings module, you can use kwriteconfig6 followed by dbus-send to reload the configuration. E.g., to programmatically switch ...
Bojidar Marinov's user avatar
0 votes

WSL2 - VSCode's shell command `code` no longer working in Linux terminal

In a PowerShell: wsl --update wsl --shutdown This solved the problem for me.
SePeF's user avatar
  • 101
0 votes

Get first QR code from STDOUT and terminate process

As mentioned in the comments by @user986805, there is a --oneshot option in zbar v0.23.1 released 2021-02-13 (issue, pull request). 0.23.1: ... Add one shot scanning mode zbarcam --raw --oneshot ...
Joel Purra's user avatar
0 votes

My terminal prompt is "PC%" - How can I fix this?

Read man $(basename $SHELL), the "PROMPTING" section, and adjust your PS1 environment variable (in your ~/.bashrc or equivalent).
waltinator's user avatar
  • 36.5k
4 votes
Accepted

How do I find files of a certain extension(s) except in paths that contain certain strings and then print the result to a file?

The errors you show don't really make sense since it seems like grep is trying to read a file but your command wouldn't cause that. In any case, those errors are about problematic files/sectors of ...
terdon's user avatar
  • 101k
0 votes

How to change the background color on a Ubuntu terminal in WSL?

Open Terminal app on Windows 10/11 Click the '⌄' Symbol on top > Settings Profiles > Ubuntu > Additional settings > Appearance Customize Ubuntu's terminal however you want now :)
K.G Deluxes's user avatar
5 votes

Mail command line

The receiving SMTP at sunet.se tells you exactly why it rejects the message: 550 5.7.1 Sender domain does not exists. Forgiving it its grammar mistake, it still has a point. Assuming that your sender ...
zwets's user avatar
  • 12.4k
0 votes

chsh always asking a password , and get `PAM: Authentication failure`

I used /bin/fish after entering in root user with sudo su After reading @Mithril that mentions /etc/pam.d/chsh file with the following comment: # This will not allow a user to change their shell ...
Thiago Lages de Alencar's user avatar
0 votes

How do I run .sh scripts?

Finally got it figured out. On Ubuntu 22, April 2024 So, besides checking Allow executing file as program In the Permissions tab of Properties you have to rightclick your shell(sh) file and press Run ...
CodeToLife's user avatar
2 votes

Bash terminal has become extremely slow. 22.04

Recently I enabled the dconf setting org/gnome/wayland/xwayland-allow-grabs. This fixed an issue where whenever I tried to use ctrl+alt+t (or any shortcut that used an alphanumeric) to open the ...
J.Tho's user avatar
  • 191
0 votes

Make Ctrl-Alt-T to open a terminal tab if any terminal was open

Here is a simple way that worked for me on Ubuntu 22: Install the dependency wm-ctrl with sudo apt install wmctrl Write a script .custom-terminal-key.sh and place it in under your home directory ~: #...
Polydynamical's user avatar
1 vote

Where is the documentation that describes and explains the output of the ip link command?

The documentation is already on your computer. Read man ip-link. Or, you could see which package provides it with dpkg -S $(type -p ip), use apt source to download the source, and read, read, read.
waltinator's user avatar
  • 36.5k
4 votes

What Makes pgrep Utility Unique Despite ps | grep Availability?

There are many. From man pgrep: -g, --pgroup pgrp,... Only match processes in the process group IDs listed. Process group 0 is translated into pgrep's, pkill's, or pidwait's own ...
muru's user avatar
  • 198k
0 votes

show git branch in `ls -l`

I expanded the script form Byte Commander. My version shows how many commits your branch is ahead or behind remote. It also first fetches the changes. lg() { ls -alF "$@"|awk '{ match($...
DeTommie's user avatar
3 votes

How to replace a file path with whitespace using sed?

Your shell will split unquoted strings (resulting from parameter/variable expansion in your case) to words around value(s) in IFS ... See Word Splitting ... That is one thing. Your shell may pass ...
Raffa's user avatar
  • 32.4k
0 votes

How to write a bash script from two commands (Find and replace a text string in all files recursively in current directory)

I have used Raffa's answer, and added the in-place editing option from the Perl command, so the script will actually make modifications to files contents. Note, this version is dangerous as it ...
DanRan's user avatar
  • 95
7 votes
Accepted

How to replace a file path with whitespace using sed?

Your expression 's|'$otherOne'|'$fileWithPath'|g' yields the unquoted string s|auth-user-pass mullvad_userpass.txt|~/Downloads/files_config_linux/auth-user-pass files_userpass.txt|g which is then ...
Tilman's user avatar
  • 3,614
0 votes

Is there any user friendly alternative to screen?

Zellij I was also looking for a real user-friendly alternative, tmux and byobu didn't really fit the bill, screenie is just a wrapper around screen, but Zellij actually tries to improve on usability ...
Janne Enberg's user avatar
0 votes

looking for docker-compose in the wrong directory

Check if the installed directory is in the PATH as explained by @Omegamormegil. After that exit all the terminals and then open the terminal again. Hopefully it should fix the problem.
Sardar Faisal's user avatar
40 votes
Accepted

input delay on Terminal Ubuntu 22.04.4

There is now a PPA with an early fix for this issue. Caution: This PPA is meant for testing. There are no guarantees. It may fix this issue and cause other issues. Use at your own risk. For me, it ...
mikabytes's user avatar
  • 638
0 votes

Can't type "|" (vertical pipe)

I found the pipe on my arabian keyboard: AltGr+~.
Ruslan Mavlyanov's user avatar
5 votes

input delay on Terminal Ubuntu 22.04.4

Based on mikabytes's answer, I've found another solution that not will not leave apt in a broken state. For Ubuntu 22.04.4: # Download the packages. wget -nc https://launchpad.net/ubuntu/+source/...
Cristiano Fraga G. Nunes's user avatar
0 votes

How to solve the response of my terminal that works very slow and badly?

Solution for the issue: Useful tip from: Perhaps something in this recent Q&A will be helpful: input delay on Terminal Ubuntu 22.04.4 – steeldriver Tipp: But after this fix - The system is in a ...
Cl4udi4's user avatar
  • 31
0 votes

How to easily resize images via command-line?

The script to resize all .png files in a folder to 30%. The original file can either be removed (if delete_original is true), or stays, in that case the resized file would get a name postfix ...
parsecer's user avatar
  • 190
1 vote

How do I mass install apt packages conditionally from a file?

Recently I just wrote a tool, sysdep, just for this exact purpose. It is a simple tool (standalone binary) that reads from a toml file instead of a plain text file. Without the need to handle the ...
Benjamin Tan's user avatar
8 votes

input delay on Terminal Ubuntu 22.04.4

EDIT: There is now a better solution, please see my other answer. I'll leave the answer below as is, including the comments, but I won't spend any more time on it. Based on egmont's answer, these are ...
mikabytes's user avatar
  • 638
21 votes

input delay on Terminal Ubuntu 22.04.4

Unfortunately mutter and its related packages received a faulty update in Ubuntu. Developers are aware of the issue and are working on it. Upstream Mutter issue: https://gitlab.gnome.org/GNOME/mutter/-...
egmont's user avatar
  • 8,335
2 votes

How do I list connected displays using the command line?

All other answers only work in specific situations. @ams's answer requires the $DISPLAY environment variable being set and thus does not work via SSH. @Lekensteyn's answer obviously only works with ...
adamency's user avatar
  • 123
0 votes

How do you play a sound from the terminal?

paplay was a better answer for me as it had the most comprehensible and stable (doesn't change on reboot) method for choosing a sound device. And it is installed by default. To see devices for it, do ...
joseph_morris's user avatar
0 votes

Changing behavior of bash prompt when functioning as root

as others said previously in this topic "su -" and "sudo -i" or "sudo -s" using the .bashrc from /root directory so you should add to the end of /root/.bashrc file. I ...
test970117 testman's user avatar

Top 50 recent answers are included