Skip to main content

All Questions

Tagged with
46 votes
7 answers
138k views

How to automatically run commands on SSH login?

Whenever I login to my Linux server I'd like to have several commands run automatically (set some variables, change location, etc.) This needs to be done on user login, not on system start. How can ...
Alasdair's user avatar
  • 867
21 votes
5 answers
25k views

Execute a command if Linux is idle for 5 minutes

I would like to execute a command such as notify-send 'a' if my Linux machine has been idle for 5 minutes. By idle, I mean the same thing a screen saver that gets activated would use to define "...
user avatar
3 votes
2 answers
9k views

Redirect stdout to a file when process is run in background

How can I redirect the stdout of a program to a file when it's run in the background? I have a program that generates output every second. When I run it normally and redirect to a file, the output ...
Rauffle's user avatar
  • 664
1 vote
3 answers
26k views

Allowing another user to execute program?

I want to allow a particular user to execute a compiled program in my directory. I got his username from cat /etc/passwd. The executable does not write any file but reads a few and gives output on the ...
aatish's user avatar
  • 113
0 votes
1 answer
133 views

Dos2unix different behavior on macos and centos?

I have a file which I need to convert to unix format, so I am doing dos2unix filename.txt. But the format of the file after conversion is different on CentOS when compared to the macOS format. I have ...
Dookoto_Sea's user avatar