Linux: What are some time-saving tips that every Linux user should know? - Quora
bash-fu
tar -zcvf - some_directory | ssh some_user@some_host 'cat > some_destination_file_path.tgz'
Tars, compresses, and copies a directory across servers in one step.
There are a number of variations on this command set, I use this one to illustrate the power of SSH since I think it's reasonably straightforward for less-experienced users to understand and adapt to their needs.
Rsync can do it even better, but this forms an encrypted tunnel.
Tip 01 Incrementally searchable bash history
create (or edit) your ~/.inputrc
edit ~/.bashrc and bump up your command history retention.Code:"\e[A": history-search-backward
"\e[B": history-search-forward
"\e[C": forward-char
"\e[D": backward-char
Upon reloading the console session, you can start typing, hit the up arrow key and incrementally search your command history.Code:export HISTSIZE=1000000
export HISTFILESIZE=1000000000
Tip 02 Need to give someone quick access to a file on a local network?
will serve the current directory tree at http://HOSTNAME:8000Code:python -m SimpleHTTPServer
Tip 03 Human readable top-level space usage
alias du -h --max-depth=1 to "duh"
Tip 04 Logging what you did to make 'X' work
Logs all commands typed to whatidid.log. Use Ctrl +D to endCode:script whatidid.log
Tip 05 (For herding larg-ish amounts of servers)
Use something like Puppet (Puppet Labs: The Leading Open Source Data Center Automation Solution) and SVN (or rcs of choice) to make it easy to provision servers and maintain configs.
Edit: Look here too http://www.commandlinefu.com/commands/browse BUT be aware there's some daft things posted occasionally so work out what a command does before you use it in production.
If you administer any Linux systems I really recommend Unix and Linux System Administration Handbook: Amazon.co.uk: Evi Nemeth, Garth Snyder, Trent R. Hein, Ben Whaley: Books
Quote:
This book approaches system administration in a practical way and is an invaluable reference for both new administrators and experienced professionals. It details best practices for every facet of system administration, including storage management, network design and administration, email, web hosting, scripting, software configuration management, performance analysis, Windows interoperability, virtualization, DNS, security, management of IT service organizations, and much more. UNIX® and Linux® System Administration Handbook, Fourth Edition, reflects the current versions of these operating systems:
Ubuntu® Linux
openSUSE® Linux
Red Hat® Enterprise Linux®
Oracle America® Solaris™ (formerly Sun Solaris)
HP HP-UX®
IBM AIX®