To get a list of all the installed crontab jobs on a server use the following (taken from https://stackoverflow.com/a/134944)
for user in $(cut -f1 -d: /etc/passwd); do echo $user; crontab -u $user -l; done
To get a list of all the installed crontab jobs on a server use the following (taken from https://stackoverflow.com/a/134944)
for user in $(cut -f1 -d: /etc/passwd); do echo $user; crontab -u $user -l; done
You would like to find out the exact model from your Thinkpad X1 laptop, by using your linux command line.
Use the following command:
kosmas:$ sudo dmidecode | grep -A3 '^System Information'
[sudo] password for kosmas:
System Information
Manufacturer: LENOVO
Product Name: 20HRCTO1WW
Version: ThinkPad X1 Carbon 5th
To correctly stop an autossh running process use the following (taken from https://superuser.com/a/1008029):
sudo pkill -3 autossh
You want to run a command in a hosted server but you don’t have su permissions. There are directories that have different owners/permissions, so you would like to see them.
Use the tree command and save the output in a file if you have many directories:
tree -pufid /home/directory_to_check > /home/user/permissions.txt
taken from the answer here: https://unix.stackexchange.com/a/82374
Trying to access or set up the mysql-workbench tool in linux you get the error about forgot_password.
Install the gnome-keyring
sudo apt install gnome-keyring
You want to reset the root password for MySQL in your linux Ubuntu installation.
Follow the steps described https://linuxconfig.org/how-to-reset-root-mysql-password-on-ubuntu-18-04-bionic-beaver-linux
Problem
You would like to access a host set up with nginx after adding your own vhost configuration file in /etc/nginx/conf.d/myfile.smth, but you get Connection refused.
Solution
Make sure that your nginx configuration file has the .conf extension as /etc/nginx/conf.d/myfile.conf.
Problem
You have a folder with many gzipped files that you want to unzip at the same time.
Solutionls -al | grep gz | awk ‘{ print $9}’ | xargs gunzip
Problem
You are trying to run the ps command in a docker container (ie ps ax), but you get:
bash: ps: command not found
Solutionapt install procps
Taken from the answer here
Problem
You would like to copy the contents of a source directory to a destination directory without overwriting existing files on the destination.
Solution
You can use
rsync -a -v --ignore-existing source_dir/ dest_dir/
and you can also use the –dry-run option to test before running it.