Linux Commands Cheat Sheet
Secure Copy
Syntax Structure
scp [-346ABCpqrTv] [-c cipher] [-F ssh_config] [-i identity_file] [-J destination] [-l limit] [-o ssh_option] [-P port] [-S program] source ... target
Copy file from a remote host to local host SCP example:
scp username@from_host:file.txt /local/directory/
Copy file from local host to a remote host SCP example:
scp file.txt username@to_host:/remote/directory/
Copy directory from a remote host to local host SCP example:
scp -r username@from_host:/remote/directory/ /local/directory/
Copy directory from local host to a remote host SCP example:
scp -r /local/directory/ username@to_host:/remote/directory/
Copy file from remote host to remote host SCP example:
scp username@from_host:/remote/directory/file.txt username@to_host:/remote/directory/
Find
- Using find as sudo yields different results
Syntax Structure
find [-H] [-L] [-P] [-D debugopts] [-Olevel] [starting-point...] [expression]
Find file name host.conf, starting in root folder.
sudo find / -name host.conf
Find file name host.conf,starting in root folder, not case sensitive.
sudo find / -iname host.conf
Find file name host.conf, starting in root,not case sensitive using wildcard at the end
sudo find / -iname "host*"