Most Popular

1500 questions
313
votes
12 answers

Better colors so comments aren't dark blue in Vim?

Mostly I edit Ruby files, although shell script file comments are also # Currently my comments show as dark blue on black which is really hard to read. See screenshot. How can I change their color? I'm willing to consider different schemas for all…
313
votes
17 answers

How to monitor CPU/memory usage of a single process?

I would like to monitor one process's memory / cpu usage in real time. Similar to top but targeted at only one process, preferably with a history graph of some sort.
Josh K
  • 3,946
313
votes
5 answers

What is the difference between `grep`, `egrep`, and `fgrep`?

Can anyone tell me the technical differences between grep, egrep, and fgrep and provide suitable examples? When do I need to use grep over egrep and vice versa?
Vishwanath Dalvi
  • 4,386
  • 5
  • 21
  • 17
308
votes
2 answers

View stdout/stderr of systemd service

I have created a simple systemd service file for a custom application. The application works well when I run it manually, but my CPU gets maxed out when I run it with systemd. I'm trying do track down where my problem is, but I don't know where to…
beatgammit
  • 7,583
307
votes
4 answers

Can't resume screen, says I am already attached?

I am working on a remote Debian Jessie server. I have started a screen session, started running a script, then been disconnected by a network timeout. Now I have logged in again and want to resume the session. This is what I see when I list…
Richard
  • 3,463
306
votes
12 answers

How to check how long a process has been running?

I would like to avoid doing this by launching the process from a monitoring app.
tshepang
  • 65,642
306
votes
8 answers

Moving tmux pane to window

How do I move an existing pane into another window in tmux when I have multiple windows, and vice versa? I'm coming from screen, where I can switch to the pane and then switch windows until I get to the one I want; tmux does not seem to allow this.
mrlanrat
  • 3,163
304
votes
4 answers

What is the meaning of IFS=$'\n' in bash scripting?

At the beginning of a bash shell script is the following line: IFS=$'\n' What is the meaning behind this collection of symbols?
304
votes
2 answers

What's ssh port forwarding and what's the difference between ssh local and remote port forwarding

I feel confused about ssh port forwarding and the difference between ssh local and remote port forwarding. Could you please explain them in detail and with examples? Thanks!
user2886717
  • 3,419
301
votes
11 answers

Keep processes running after SSH session disconnects

I sometimes have long-running processes that I want to kick off before going home, so I create a SSH session to the server to start the process, but then I want to close my laptop and go home. Later, after dinner, I want to check on the process that…
300
votes
6 answers

How to avoid being asked passphrase each time I push to Bitbucket

I set up my ssh stuff with the help of this guide, and it used to work well (I could run hg push without being asked for a passphrase). What could have happened between then and now, considering that I'm still using the same home directory. $ cat…
tshepang
  • 65,642
299
votes
9 answers

How to display meminfo in megabytes in top?

Sometimes it is not comfortable to see meminfo in kilobytes when you have several gigs of RAM. In Linux, it looks like: And here is how it looks in Mac OS X: Is there a way to display meminfo in Linux top in terabytes, gigabytes and megabytes?
Anthony Ananich
  • 7,334
  • 5
  • 33
  • 45
298
votes
6 answers

How to create a new window on the current directory in tmux?

Is is possible to open a new-window with its working directory set to the one I am currently in. I am using zsh, if it matters.
sharat87
  • 4,259
297
votes
5 answers

What are the differences between most, more and less?

I'm now using Arch Linux, and find a command most works like more and less. To understand the differences between them is a confusing problem. The question Isn't less just more? mentions the differences between less and more. Do you know the…
Hgtcl
  • 3,081
297
votes
7 answers

What do options `ServerAliveInterval` and `ClientAliveInterval` in sshd_config do exactly?

I found this question, but I'm sorry I don't quite understand the settings on the two variables ServerAliveInterval and ClientAliveInterval mentioned in the accepted response. If my local server is timing out, should I set this value to zero? Will…
M. Tibbits
  • 3,257