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 ...
1 vote
2 answers
1k views

RPM none-zero exit code if a package is already installed

I created a new script to install a few local packages on CentOS 7 without internet. I want script exits upon any error set -e rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 rpm --import ./RPM-GPG-...
0 votes
1 answer
486 views

How do I prevent systemd from running my timer after reboot

I have the following oneshot service+timer : $ systemctl cat stop_syncro.service stop_syncro.timer # /usr/local/lib/systemd/system/stop_syncro.service [Unit] Description=Service d_arret de la Synchro ...
0 votes
0 answers
114 views

cannot run command on Centos7

I've got a vps using Centos, the release version is 7.9. I've install the unhide in my vps.it does not work. I've check the permission, and the file type. but i still cant run this command . it's ...
0 votes
1 answer
129 views

Getting a Particular Binary Package from A Source Package?

(Sorry if the title is worded incorrectly - I am a newbie in this domain, so please correct me wherever I am wrong) From https://packages.ubuntu.com/source/bionic/amd64/hdf5, I am trying to get the ...
0 votes
0 answers
223 views

Issue with add Multiple user account and SSH key using Bash script

As per our requirement we provided our devloper group: devs:r-x to /var/log/httpd directory. What is the best way to create a user account (in my case Dev User) in a Group using bash scrip, with the ...
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 ...
0 votes
1 answer
1k views

How can I correctly run a java batch application (a .jar application) in background on a Linux machine?

I am not a system engineer (I am a software edeveloper). I have to run a Java application (a runnable .jar file) on a Linux machine (Centos 7). I am connecting to a shell via SSH. This application is ...
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 "...
0 votes
0 answers
273 views

How to view or record user's active time in Linux server

I'm a server admin for a university, and we have 4 CentOS servers that students can use for their projects in various classes. The CS professors have asked me to come up with a way to track a user's ...
0 votes
2 answers
90 views

How to delete any archives older than W weeks, but still keep up to N archives?

I have a CentOS 7 directory that gets filled with tar.gz archives for different packages, where each package can create multiple archive versions. I'm trying to find a way to delete any archives ...
2 votes
1 answer
6k views

bash: /home/user/.bashrc: Permission denied when try to change user from root to user

I'm on centos, when I login as root and use su x to change user to x, it shows this: bash: /home/x/.bashrc: Permission denied I try to source ~/.bashrc but nothing changes and I also tried following ...
0 votes
1 answer
439 views

How to call .bash_logout on CentOS

I'm trying to call my own .bash_logout on CentOS when a user logs out. However, even when an 'exit' command is sent, .bash_logout is NOT called/executed (it just logs out). On CentOS, when I type '...
0 votes
1 answer
226 views

Jenkins service user to restart mongodb service

Centos 7. Usually when I would like to run a sudo command as a non root user, I open up the visudo, and add this line to the right place: %<userGroup> ALL= NOPASSWD: <command> when I ...
0 votes
2 answers
44 views

How can I empty files at the same time with same paths?

I have a structure like this: Father: ├───Charlie │ └───lang.log ├───Ava │ └───lang.log ├───Sophia │ └───lang.log ... I would like to clean up the scheme. I try: cat /dev/null > Father/*...

15 30 50 per page
1
2 3 4 5