SSH Reference Sheet – basic Secure-shell commands for every day use!
The more I work with SSH, the more I love it! Unfortunately, half the time I forget the commands. This is the first of a series of “Reference Sheets” to help myself and others learn/remember SSH commands.
Note: Anything surrounded by *asterisks* is where your input is required.
List the contents of a directory
List the contents of a directory, with permissions and file size
Remove Directory and all files inside (recursive forced)
Tar – compress a folder
tar -czv -f *location_of_compressed_file*.tgz *files_to_compress*
Tar – compress a folder, with exclusions
tar -czv -f *file_or_directory* --exclude="file.html"
Tar – compress a folder, with Grouped exclusions
tar -czv -f *file_or_directory* --exclude="file*.html"
– will remove file1.html, file-long-name.html, etc.
Tar – decompress a tarball
tar -xzvf *compressed.zip* *./location/to/decompress*
SCP – Pull a file from another server (Remote-to-Remote or Remote-to-Local)
Note: ./ means current directory.
Show details about a file
Edit a file