1 2 3 4 |
# Reset access rights to 'rwxr-xr-x' for all subfolders of the specified directory find /home/username/public -type d -exec chmod 0755 {} \; # Reset access rights to 'rw-r--r--' for all files of the specified directory find /home/username/public -type f -exec chmod 0644 {} \; |
unix
How to compare two folders in UNIX using diff
1 2 |
# If it's required to compare two folders by their files names $ diff <(cd folder1 && find | sort) <(cd folder2 && find | sort) |
1 2 |
# ... or if you want deep comparison $ diff --brief -rb folder1 folder2 |
Set access and modification time for all files and subfolders in a UNIX directory
All files in current folder were created on 24 of January 2021, …
NetworkManager – set route metric
Get current metric:
Get list of your connections with their UUIDs …
1 |
$ ip route |
How to ssh to your linux boxes without a password
1. Generate your ssh key pair if you haven’t one. Use default values, don’t set password
1 |
$ ssh-keygen |
2. Copy your public key to a remote host (192.168.0.5 for instance)
1 |
$ ssh-copy-id -i ~/.ssh/id_rsa.pub 192.168.0.5 |
How to synchronize data using rsync tool
My favourite tool, which I use to synchronize data between two sources, is ‘rsync‘. Here I’m going to show you how I use it to mirror data from one local folder to another.
…