Most Popular

1500 questions
90
votes
3 answers

How to configure systemd-resolved and systemd-networkd to use local DNS server for resolving local domains and remote DNS server for remote domains?

I'm connected to local area network with access to the Internet through gateway. There is DNS server in local network which is capable of resolving hostnames of computers from local network. I would like to configure systemd-resolved and…
90
votes
6 answers

List all valid kbd layouts, variants and toggle options (to use with setxkbmap)

Is there a way from command line to retrieve the list of all available keyboard layouts and relative variants? I need to list all the valid layout/variants choices to be used then from setxkbmap. Also about the layout toggle options, is there a way…
giuspen
  • 1,295
90
votes
1 answer

List of Kill Signals

I'm familiar with several process signals and what they do, but I would like to understand them all. There are three things I would like to find out about each signal. What the signal does When a signal like this is typically sent Any command line…
Dave
  • 1,025
90
votes
9 answers

How to disable `apt-daily.service` on Ubuntu cloud VM image?

The Ubuntu 16.04 server VM image apparently starts the "apt-daily.service" every 12 hours or so; this service performs various APT-related tasks like refreshing the list of available packages, performing unattended upgrades if needed, etc. When…
90
votes
5 answers

How to recursively remove execute permissions from files without touching folders?

I made a backup to an NTFS drive, and well, this backup really proved necessary. However, the NTFS drive messed up permissions. I'd like to restore them to normal w/o manually fixing each and every file. One problem is that suddenly all my text…
gaazkam
  • 1,410
90
votes
3 answers

What's the quickest way to find duplicated files?

I found this command used to find duplicated files but it was quite long and made me confused. For example, if I remove -printf "%s\n", nothing came out. Why was that? Besides, why have they used xargs -I{} -n1? Is there any easier way to find…
The One
  • 4,862
90
votes
13 answers

Tab completion errors: bash: cannot create temp file for here-document: No space left on device

When using the tab bar, I keep getting this error: bash: cannot create temp file for here-document: No space left on device" Any ideas? I have been doing some research, and many people talk about the /tmp file, which might be having some overflow.…
lucasrodesg
  • 1,002
90
votes
4 answers

Understanding IFS

The following few threads on this site and StackOverflow were helpful for understanding how IFS works: What is IFS in context of for looping? How to loop over the lines of a file Bash, read line by line from file, with IFS But I still have some…
90
votes
2 answers

Is there a whoami to find the current group I'm logged in as?

I'm trying to find my current logged in group without wanting to use newgrp to switch.
Ian F
  • 2,221
90
votes
5 answers

How to put a newline special character into a file using the echo command and redirection operator?

I would like to create a file by using the echo command and the redirection operator, the file should be made of a few lines. I tried to include a newline by "\n" inside the string: echo "first line\nsecond line\nthirdline\n" > foo but this way no…
90
votes
5 answers

why would curl and wget result in a 403 forbidden?

I try to download a file with wget and curl and it is rejected with a 403 error (forbidden). I can view the file using the web browser on the same machine. I try again with my browser's user agent, obtained by http://www.whatsmyuseragent.com. I do…
starfry
  • 7,442
90
votes
4 answers

What does adduser do that useradd doesn't?

In addition to the more widespread useradd, Debian based systems also contain an additional adduser command which provides a higher level interface for adding users and some related tasks. There are various questions/answers on other SE sites which…
Graeme
  • 34,027
90
votes
4 answers

How do I update GRUB in Arch Linux

In Ubuntu, we use this command to update GRUB: # update-grub But how do I update GRUB version 2.00 in Arch Linux?
89
votes
7 answers

How can I read line by line from a variable in bash?

I have a variable which contains multiline output of a command. What's the most effecient way to read the output line by line from the variable? For example: jobs="$(jobs)" if [ "$jobs" ]; then # read lines from $jobs fi
89
votes
7 answers

How can I page up or down in tmux with Terminal.app?

When I am in tmux only a portion of the text shows up. If I try to scroll up or down the console scrolls up but not the actual text. If I do CTRL+b followed by [, I see in the status bar *tmux, and If I press the up or down arrow I can actually go…
Jim
  • 10,120