The Apache web server’s log format lends itself to processing with Unix command line tools, making it easy to generate traffic reports in real-time.

Dec 252010
 
Keep only the newest files in a directory

Managing back-ups or log files often involves deleting older versions of your archives, so that at any given time you are only storing a particular number of copies. Many scripts rely on the creation date of the files, deleting those files that are older than some set time–a day, a week, a month–but this is Read more…

 

There’s a thread on Reddit about remembering the correct order for the ln -s command. I’m heartened to learn that I’m not the only one who makes this mistake constantly. Several good mnemonics are discussed. You can remember it by comparing it to the copy command cp existing new ln -s existing new Or with Read more…

 

On a Linux machine, you can use the free command to display how much free memory you have. The -m option displays all values in megabytes $ free -m total       used       free     shared    buffers     cached Mem:       2010      1418        591         0        61       1093 -/+ buffers/cache: 263       1746 Swap:      2047          0       2047 The Mem: line above reports Read more…

Nov 202010
 

Secure shell supports a public key authentication mechanism that allows you to log in to a remote machine without providing a password, but it requires configuration. You generate a key pair, storing the private key on your workstation while copying the public key to a remote machine. The private key on your workstation uniquely identifies Read more…

.bash_profile vs .bashrc

 Posted by at 10:58 pm  No Responses »
Nov 092010
 

There are two start-up scripts residing in your home directory that can be run by the bash shell at start-up: .bash_profile and .bashrc. What’s the difference? The .bash_profile script is only executed by login shells. A login shell is the initial shell created for a user when they login through the console or ssh. The Read more…

Creating an SSH alias

 Posted by at 7:38 pm  No Responses »
Oct 202010
 

Are you tied of typing the entire hostname each time you SSH into a machine? $ ssh -l user01 machine1.example.com You can add an alias to your ~/.ssh/config file, setting both the username and hostname. Host mymachine HostName machine1.example.com User user01 Now, all you have to type is: $ ssh mymachine Related articles:

© 2010 Geektastical Suffusion theme by Sayontan Sinha