Most Popular

1500 questions
215
votes
15 answers

In my /etc/hosts/ file on Linux/OSX, how do I do a wildcard subdomain?

I need to test sub-domains on my localhost. How can I effectively have this result of adding *.localhost.com to my /etc/hosts/ file? If it's not possible, how do I work around this problem? I need to test wildcard sub-domains on my localserver. …
MikeN
  • 8,252
  • 5
  • 22
  • 18
214
votes
2 answers

How do I do 'mount --bind' in /etc/fstab?

I'm trying to add mount --bind /proc/ /chroot/mysql/proc to /etc/fstab. How can I do this?
Some Linux Nerd
  • 3,157
  • 3
  • 18
  • 20
214
votes
10 answers

How to check if a library is installed?

In Linux, how do I check if a library is installed or not? (from the command line of course). In my specific case now, I want to check whether libjpeg is installed.
hasen
  • 2,424
  • 2
  • 18
  • 12
208
votes
16 answers

How do diff over ssh?

How do I diff files/folders across machines provided that the only connectivity available is ssh?
Alexey Timanovsky
  • 3,391
  • 3
  • 18
  • 8
208
votes
8 answers

Setting the hostname: FQDN or short name?

I've noticed that the "preferred" method of setting the system hostname is fundamentally different between Red Hat/CentOS and Debian/Ubuntu systems. CentOS documentation and the RHEL deployment guide say the hostname should be the…
Cakemox
  • 24,141
  • 6
  • 41
  • 67
208
votes
13 answers

Shell command to monitor changes in a file

I know there was a command on Unix that I could use to monitor a file and see changes that are getting written to it. This was quite useful especially for checking log files. Do you know what it is called?
Sebastian Hoitz
  • 3,019
  • 3
  • 23
  • 19
207
votes
3 answers

How can I override CMD when running a docker image?

I want to inspect a docker image created by someone else with both an entrypoint and cmd specified, for example: ENTRYPOINT ["/usr/sbin/apache2ctl"] CMD ["-D", "FOREGROUND"] I currently do: docker run --interactive --tty --entrypoint=/bin/bash…
warp
  • 2,289
  • 2
  • 14
  • 6
207
votes
8 answers

When does /tmp get cleared?

I'm taking to putting various files in /tmp, and I wondered about the rules on deleting them? I'm imagining it's different for different distributions, and I'm particularly interested in Ubuntu and Fedora desktop versions. But a nice general way of…
John Lawrence Aspden
  • 2,346
  • 4
  • 16
  • 12
207
votes
18 answers

How to use rsync over FTP

Any unix: I have the following cmd line which works fine. rsync -avr -e ssh /home/dir user@example.com:/home/ But I need to set it up now to rsync to a remote server that only has an FTP server on it. How do I go about that? I looked at the rsync…
bumperbox
  • 2,273
  • 3
  • 16
  • 13
207
votes
3 answers

What is the difference between Unix sockets and TCP/IP sockets?

It's from this answer: https://stackoverflow.com/questions/2482411/is-this-pdo-bug-fixed-now/2482424#2482424 When the host is "localhost", MySQL Unix clients use a Unix socket, AKA Unix Domain Socket, rather than a TCP/IP socket for the connection,…
apache
  • 3,027
  • 6
  • 25
  • 25
205
votes
13 answers

How do I load a sql.gz file to my database? (importing)

I'm trying to import a gzipped SQL file into mysql directly. Is this the right way? mysql -uroot -ppassword mydb > myfile.sql.gz
Alex
  • 8,111
  • 24
  • 71
  • 99
203
votes
9 answers

Heartbleed: What is it and what are options to mitigate it?

This is a Canonical Question about understanding and remediating the Heartbleed security issue. What exactly is CVE-2014-0160 AKA "Heartbleed"? What is the cause, what OSs and versions of OpenSSL are vulnerable, what are the symptoms, are there…
Jacob
  • 9,114
  • 4
  • 44
  • 56
203
votes
11 answers

How to read backward from the end of file in less or more?

I've found one way so far: less +G filename, but it scrolls up line-by-line only with ↑. What's a more powerful less usage which provides scrolling by page, backward pattern search, and so on?
yetanothercoder
  • 2,135
  • 2
  • 13
  • 6
202
votes
13 answers

hosts file ignored, how to troubleshoot?

The hosts file on Windows computers is used to bind certain name strings to specific IP addresses to override other name resolution methods. Often, one decides to change the hosts file, and discovers that the changes refuse to take effect, or that…
Superbest
  • 5,045
  • 3
  • 14
  • 11
201
votes
10 answers

How to refresh hosts file without rebooting

On Windows, how do you refresh the hosts file without rebooting?
kakridge