bashoneliners.com

Welcome to bashoneliners.com, a curated collection of practical and well-explained Bash one-liners, snippets, tips and tricks. We aim to make each published one-liner to be of high quality: useful, easy to read, follows best practices, with clear, detailed, accurate explanation. These one-liners should help you automate tasks, troubleshoot problems, whether it be in system administration, file management, networking or programming.

Recording SSH sessions

ssh -l USER HOST | tee -a /path/to/file

August 15, 2012LeandroToledo

Run a local shell script on a remote server without copying it there

ssh user@server bash < /path/to/local/script.sh

June 21, 2012bashoneliners

Run remote X11 applications with ssh

ssh -X servername

January 5, 2012versorge

Copy a directory with a large number of files to another server

tar cp -C /path/to/dir . | ssh server2 'tar x -C /path/to/target'

November 17, 2011bashoneliners