Maintenance

  • Home
  • Log in
  • « Building exist 2.1 from git
  • Tomcat upgrade on peach - problems »

File listing in octal

Posted by gregster on 27 Jun 2013 in R & D

After a conversation with Martin about why there's no flag for 'ls' that retrieves permissions in octal form, I added an alias to do this for me.

To create the alias, do this:
alias oct="stat -c '%A[%a] %U:%G %s %.19z %n' $1"

Then, run it like this:
oct /usr/bin/*

and get back something like this:
-rwxr-xr-x[755] root:root 17792 2014-06-03 15:24:04 /usr/bin/xkbvleds
-rwxr-xr-x[755] root:root 16096 2014-06-03 15:24:04 /usr/bin/xkbwatch
-rwxr-xr-x[755] root:root 14659 2014-06-03 15:24:04 /usr/bin/xkeystone
-rwxr-xr-x[755] root:root 14640 2014-06-03 15:24:04 /usr/bin/xkill
-rwxr-xr-x[755] root:root 16016 2014-06-03 15:24:04 /usr/bin/xload

This entry was posted by Greg and filed under R & D.

Maintenance

This blog is the location for all work involving software and hardware maintenance, updates, installs, etc., both routine and urgent.
  • Home
  • Recently
  • Archives
  • Categories

Search

Categories

  • All
  • Announcements
  • Hit by a bus
  • Labs
    • Activity log
    • Documentation
  • Notes
  • R & D
    • Activity log
    • Documentation
  • Servers
    • Activity log
    • Documentation
  • Tasks

All blogs

  • Academic
  • AdaptiveDB
  • Admin
  • Announcements
  • CanMys
  • Cascade
  • CGWP
  • ColDesp
  • Depts
  • DVPP
  • Endings
  • HCMC Blogs
  • Landscapes
  • LEMDO
  • Linguistics
  • Maint
  • LondonMap
  • Mariage
  • MoM
  • Moses
  • Pro-D
  • Projects
  • ScanCan
  • HumsSites
  • Wendat

This collection ©2026 by admin • Help • Social CMS