Most Popular

1500 questions
104
votes
7 answers

how to glob every hidden file except current and parent directory

I want to glob every hidden file and directory, but not the current (.) and parent directory (..). I am using bash. Observe current behaviour: $ ls -a . .. ...a ...aa ..a ..aa .a .aa .aaa a $ echo * a $ echo .* . .. ...a ...aa ..a ..aa .a…
Lesmana
  • 26,889
  • 20
  • 81
  • 86
103
votes
8 answers

How to install apt-get or YUM on Mac OS X

I want to use either of apt-get or yum. How to install them and make them successful running?
Karan-41317
  • 1,141
  • 2
  • 8
  • 5
103
votes
10 answers

Does cd . have use?

One of the tutorials I've been following briefly stated that cd . has no use. When trying to replicate issue shown by OP in Symbolic link recursion - what makes it “reset”?, I also tried cd ., which showed the same effect OP described (growing $PWD…
Sergiy Kolodyazhnyy
  • 16,187
  • 11
  • 53
  • 104
103
votes
6 answers

A list of available D-Bus services

Is there such a thing as list of available D-Bus services? I've stumbled upon a few, like those provided by NetworkManager, Rhythmbox, Skype, HAL. I wonder if I can find a rather complete list of provided services/interfaces.
madfriend
  • 1,133
  • 2
  • 8
  • 5
103
votes
4 answers

How can swapoff be that slow?

Somehow I happened to swap out 14 GB of memory. After having killed the culprit, I have tons of free memory again, so I thought I could bring in the important data again. So with 5 GB out of 32 GB used and 14 GB of swap space used, I ran swapoff…
maaartinus
  • 4,979
  • 7
  • 30
  • 29
103
votes
7 answers

ssh unable to negotiate - no matching key exchange method found

I am trying to log in to my DSL router, because I'm having trouble with command-line mail. I'm hoping to be able to reconfigure the router. When I give the ssh command, this is what happens: $ ssh [email protected] Unable to negotiate with…
j0h
  • 3,467
  • 8
  • 27
  • 36
103
votes
7 answers

Does rsync verify files copied between two local drives?

I want to make a fresh new copy of a large number of files from one local drive to another. I've read that rsync does a checksum comparison of files when sending them to a remote machine over a network. Will rsync make the comparison when copying…
Frez
  • 1,133
  • 2
  • 8
  • 5
103
votes
5 answers

Systemd Restart=always is not honored

Note: I wrote an article on Medium that explains how to create a service, and how to avoid this particular issue: Creating a Linux service with systemd. Original question: I'm using systemd to keep a worker script working at all…
BenMorel
  • 4,447
  • 8
  • 36
  • 46
103
votes
4 answers

Command to list PostgreSQL user accounts?

There are createuser & dropuser commands: createuser - define a new PostgreSQL user account dropuser - remove a PostgreSQL user account Is there a corresponding way to list the user accounts? These two commands do not require the user to invoke…
CW Holeman II
  • 3,654
  • 5
  • 31
  • 49
103
votes
4 answers

Why is `while IFS= read` used so often, instead of `IFS=; while read..`?

It seems that normal practice would put the setting of IFS outside the while loop in order to not repeat setting it for each iteration... Is this just a habitual "monkey see, monkey do" style, as it has been for this monkey until I read man read, or…
Peter.O
  • 32,426
  • 28
  • 115
  • 163
103
votes
3 answers

What are "session leaders" in `ps`?

What are session leaders, as in ps -d which selects all processes except session leaders?
its_me
  • 13,709
  • 23
  • 54
  • 52
103
votes
3 answers

grep inside less?

I'm currently sifting through a lot of unfamiliar logs looking for some issues. The first file I look at is Events.log, and I get at least three pages in less which appear to display the same event at different times – an event that appears to be…
forquare
  • 3,396
  • 5
  • 21
  • 32
103
votes
4 answers

How to undo `set -x`?

I typed set -x in terminal. Now the terminal keeps printing the last command run on top of my output so the command ~]$echo "this is what I see" returns + echo 'this is what I see' this is what I see There is no man page for set, how do I turn…
lonewarrior556
  • 2,033
  • 4
  • 16
  • 13
103
votes
3 answers

What are pid and lock files for?

I often see that programs specify pid and lock files. And I'm not quite sure what they do. For example, when compiling nginx: --pid-path=/var/run/nginx.pid \ --lock-path=/var/lock/nginx.lock \ Can somebody shed some light on this one?
Stann
  • 2,159
  • 5
  • 23
  • 24
103
votes
6 answers

Using while loop to ssh to multiple servers

I have a file servers.txt, with list of servers: server1.mydomain.com server2.mydomain.com server3.mydomain.com when I read the file line by line with while and echo each line, all works as expected. All lines are printed. $ while read HOST ; do…
Martin Vegter
  • 69
  • 66
  • 195
  • 326