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 14:31:44 2019 76eeeea5d...
Written by Sean Behan on 05/04/2019
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 14:31:44 2019 76eeeea5d...
Written by Sean Behan on 05/04/2019
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)
Written by Sean Behan on 12/11/2017
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 you the size for each file or directory.
...
Written by Sean Behan on 03/07/2017
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 and try again: http://rubygems.rubyforge.org
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
./script/console production
# =>
Loading production environment (Rails 2.3.5)
Rails requires RubyGems >=...
Written by Sean Behan on 06/17/2012
How Many Gigs of RAM Are On My Server?
How much memory is on my linux server? Run the free command
free -g
total used free shared buffers cached
Mem: 2 1 0 0 0 1
-/+ buffers/cache: 0 1
Swap: ...
Written by Sean Behan on 06/17/2012
Setting Up Users, Permissions and Groups for SSH Access to a Shared Git Repository
If you are having permission problems using git, such as
error: insufficient permission for adding an object to repository database ./objects
There are a couple thing you can do to remedy the situation, before moving to a full on git server like gitosis....
Written by Sean Behan on 06/17/2012
Add Users to a Group on Ubuntu
To create a new user on Ubuntu (Heron8)
adduser johndoe
To create a new group
groupadd barleyfarmers
Add johndoe to the barleyfarmers group
adduser johndoe barleyfarmers
The adduser command, when you're first adding the new user accou...
Written by Sean Behan on 03/02/2017
Setting up a new ubuntu server with apache2, php, ruby on rails, rubygems, mysql, and git
Here are a list of commands to get up and running with Apache2 with Phussion Passenger for Rails, PHP5, MySQL5, Ruby on Rails with Gems, and the source control software Git. I think that this is a pretty ideal environment for a development box and even pr...
Written by Sean Behan on 06/17/2012