Skip to content

www.leonenkov.ru

Comprehensive notes of a lifelong learner

  • Home
  • Author

unix

GoTo – a simple cross-platform command line SSH manager

08.05.202430.05.2024 ~ Roman

GoTo is a wrapper around SSH client. The difference with Putty is that GoTo is a command line application that does not depend on any OS-specific graphic libraries and thus is very portable across platforms, however it lacks any connection logic therefore SSH client needs to be available in your binary $PATH.

 …

Grep cheatsheet for SysAdmins

15.03.202420.05.2024 ~ Roman
Unix grep utility parameters reminder.  …

Find all files which contain specific text and print these file names to the console

20.12.202322.05.2024 ~ Roman
If a file contains either word “some” or word “text” then print its name
1
2
3
# q = quiet; that means that grep will exit with status "0" (success)
# if a file contains either word "some" or word "text"
find . -type f -exec bash -c "grep -q -e some -e text {} && echo {}" \;

Restore UNIX acess permissions for all subfolders and files of the specified directory

27.01.202122.05.2024 ~ Roman
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 {} \;

How to compare two folders in UNIX using diff

24.01.202122.05.2024 ~ Roman
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

24.01.202127.01.2021 ~ Roman

All files in current folder were created on 24 of January 2021, …

NetworkManager – set route metric

15.01.201920.05.2024 ~ Roman
Get current metric:
1
$ ip route
Get list of your connections with their UUIDs …

How to ssh to your linux boxes without a password

05.12.201722.05.2024 ~ Roman

1. Generate your ssh key pair if you haven’t one. Use default values, don’t set password …

How to synchronize data using rsync tool

31.01.201720.05.2024 ~ Roman

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.

 …