Tip #766 Migrate MySQL Database to a new Server
Tip 669 gave a command to copy a table between remote MySQL databases, but how about if you want to copy the whole DB to a new host?The following command will copy the database 'old_db' from the local host to 'new_db' on the specified remote host.
Read more »
- TAGS:
- mysql
Tip #744 Close shell keeping all subprocess running
I often use 'screen' to run a command that I want to leave running when I logout but sometimes I forget and kick off a long job without screen. If you want to keep these things running, the following command will close the shell keeping all subprocess runningRead more »
- TAGS:
- bash
Tip #743 Grep for word in directory
I've often seen people using the find command on a directory to get all the files, then using these with grep to find files containing a particular word. This can however, be done better just using grep:Read more »
- TAGS:
- grep
Tip #742 Sort the lines of a file by length
The command below can be used to sort the lines of a file by ascending order (shortest first). Change 'sort -n' to 'sort -nr' to sort in descending order (longest first).Read more »
Tip #741 Find the longest line in a file
This is how we can find the length of the longest line in a file.Read more »
- TAGS:
- awk
Tip #740 Incremental backup with tar
The tar command can be used to make a quick incremental backup as follows:Read more »
- TAGS:
- tar
Tip #739 Display file permissions in octal
Tip 205 is an interesting way to show file permissions in octal using sed, but this can be done much easier using the Linux stat command.From man page of Linux stat(1) command:
%A Access rights in human readable form
%a Access rights in octal
%n File name
Read more »
- TAGS:
- stat
Tip #701 Stream YouTube videos directly to your media player
YouTube is great, but the embedded flash player doesn't offer a lot in the way of customizing your viewing experience. There are quite a few options for downloading flv video files from YouTube, but adding the following function to your bashrc will let you stream them directly to your choice of media player.Read more »
Tip #680 Find and remove core files
Use this to find core files and remove them:Read more »
- TAGS:
- find
Tip #676 The poor man's REPL
This is the general form; it will run 'mycommand' once for each line of text you enter with that line of text supplying the arguments to the command:Read more »
- TAGS:
- xargs
alias aptitude at awk bash bc cal cat cd colrm comm cp csh curl cut date dd df dialog diff dirname dpkg du fc find fuser grep gs gzip history iconv kill ksh last less ln ls lsof lynx m4 md5sum mkdir mkfifo mkisofs mv mysql nc netstat openssl OSX perl ping popd ps pushd python read redirection rm scp screen sed sort ssh stat sudo svn tail tar tee test top tr uniq vim wc wget xargs