#linux
15 posts tagged linux. Clear filter
-
How to Use the Ls Command on Linux or Mac OS X to Sort Files based on Second in the Timestamp
Here is the one liner. ls -lhtTr It will output something like total 24152 -rw-rw-r-- 1 sean staff 1.0M May 4 14:31:42 2019 4c2caf52cb084ea39a6a65a0e68ee382 -rw-rw-r-- 1 sean staff 1.0M May 4...
-
How to Time Piped *nix Commands
If you want to time how long a piped bash command take, use the time command followed by your commands in parens like so.. time (ls -lha | wc -l)
-
Linux Disk Usage Command Recursive
It's short and sweet! du -hs If you run this command it will tell you the sizes of all the files and folder in the current directory. The -h flag is for human readable format and the -s will give...
-
Backup and Rotate MySQL Databases Simple Bash Script
Make a directory ( it can anywhere ) called baks/mysql mkdir -p /baks/mysql Create a file (it can be anywhere) called /root/mysqlbackups.sh and put this script in it !/bin/bash modify the following...
-
How to Copy and Paste to/from the Global Register with Tmux on Mac OS X
Using the system clipboard with tmux on OS X is broken. I really like tmux but having copy and paste is kind of important for me. Here is my attempt to get it back with a simple bash script until I...
-
Ruby Enterprise Edition and Passenger ./script/console production fails and instead returns Loading production environment (Rails 2.3.5) Rails requires RubyGems >= 1.3.2. Please install RubyGems...
After installing Ruby Enterprise Edition, REE, and Passenger on Ubuntu you may see this error message when you run script/console for the first time You then scratch your head and run to find that...
-
How Many Gigs of RAM Are On My Server?
How much memory is on my linux server? Run the free command Which will tell you memory in Gigs. You can pass other flags, such as, -m or -k, which will give you the number in megs and kilobytes...
-
Have Git Email Committers After Pushes
You need a Mail Transfer Agent MTA on the server. The easiest way is to install Sendmail, which Git uses by default. Remember that /etc/hosts file needs the ip address to map to the domain name...
-
Setting Up Users, Permissions and Groups for SSH Access to a Shared Git Repository
If you are having permission problems using git, such as There are a couple thing you can do to remedy the situation, before moving to a full on git server like gitosis. Create your users and add...
-
Uploading Files with Curl
Courtesy of http://ariejan.net/2010/06/07/uploading-files-with-curl/
-
Recursively Zip Up a Directory while Excluding Certain Files Based on File Extension Type
In the example below, I'm going to zip up a directory that includes images in both PNG and PSD file formats. However, I want to exclude the PSDs because they are huge!
-
Uncompress A Bz2 File Using Tar Command
Uncompress a bz2 file using tar command @source http://www.kde.gr.jp/help/doc/kdebase/doc/khelpcenter/faq/HTML/bzip2.html
-
Adding Public/Private Key Pairs on Mac OS X and Ubuntu for Passwordless Remote SSH Sessions
On your local machine cd into the .ssh directory in your home "/" directory. If it doesn't exist you can create it with "mkdir /.ssh". Next generate your public/private keys and copy the public key...
-
Updating Your Twitter Status with cURL and a Bash Function
I'm usually at the command line so I wrote a little a bash function so that i can type and it will update my twitter status! some characters trip it up but in general it's useful for most of my...
-
Change default ssh port number on Ubuntu
Login as the root user or as a user that can execute sudo commands. Find the line that reads Change this to an different and an available port number... Next reload ssh You won't be kicked out of...