whoami
$ run curl ifconfig.me
cat <path> | grab <text to search in file>
grep -r 'some string' /path/to/file
Find out the process ID (PID) which is occupying the port number (e.g., 3000)
sudo lsof -i :3000
sudo kill PID
Note: it’s sudo kill -15 PID
.
Then if needed
sudo kill -2 PID
sudo kill -1 PID
sudo kill -9 PID
sudo lsof -PiTCP -sTCP:LISTEN
find / -type d -name 'httpdocs'
find /root -type f -iname "*linux*"
find / -type f -iname "file-anme.ext"
How to duplicate a file's permissions on macOS
chmod `stat -f %A /path/to/source.txt` /path/to/destination.txt
How to duplicate a file's permissions on Linux
chmod --reference=/path/to/source.txt /path/to/destination.txt