Skip to content

Instantly share code, notes, and snippets.

@acataluddi
Forked from 0x3333/README.md
Created November 5, 2022 16:38
Show Gist options
  • Save acataluddi/230dbab8bda98f88c868ddff9dcb33ea to your computer and use it in GitHub Desktop.
Save acataluddi/230dbab8bda98f88c868ddff9dcb33ea to your computer and use it in GitHub Desktop.
List mounted points in columns

This is an alias to shells to display mount output in formatted columns.

Add this alias to your rc shell(.bashrc, .zshrc, or whatever):

alias mountc='mount | column -t | sort -V'

Example output:

$ mountc
cgroup              on  /sys/fs/cgroup/blkio             type  cgroup      (rw,nosuid,nodev,noexec,relatime,blkio)
cgroup              on  /sys/fs/cgroup/cpuset            type  cgroup      (rw,nosuid,nodev,noexec,relatime,cpuset)
cgroup              on  /sys/fs/cgroup/cpu,cpuacct       type  cgroup      (rw,nosuid,nodev,noexec,relatime,cpu,cpuacct)
cgroup              on  /sys/fs/cgroup/devices           type  cgroup      (rw,nosuid,nodev,noexec,relatime,devices)
cgroup              on  /sys/fs/cgroup/freezer           type  cgroup      (rw,nosuid,nodev,noexec,relatime,freezer)
cgroup              on  /sys/fs/cgroup/net_cls,net_prio  type  cgroup      (rw,nosuid,nodev,noexec,relatime,net_cls,net_prio)
cgroup              on  /sys/fs/cgroup/perf_event        type  cgroup      (rw,nosuid,nodev,noexec,relatime,perf_event)
cgroup              on  /sys/fs/cgroup/systemd           type  cgroup      (rw,nosuid,nodev,noexec,relatime,xattr,release_agent=/lib/systemd/systemd-cgroups-agent,name=systemd)
debugfs             on  /sys/kernel/debug                type  debugfs     (rw,relatime)
devpts              on  /dev/pts                         type  devpts      (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000)
hugetlbfs           on  /dev/hugepages                   type  hugetlbfs   (rw,relatime)
mqueue              on  /dev/mqueue                      type  mqueue      (rw,relatime)
proc                on  /proc                            type  proc        (rw,nosuid,nodev,noexec,relatime)
pstore              on  /sys/fs/pstore                   type  pstore      (rw,nosuid,nodev,noexec,relatime)
securityfs          on  /sys/kernel/security             type  securityfs  (rw,nosuid,nodev,noexec,relatime)
sunrpc              on  /run/rpc_pipefs                  type  rpc_pipefs  (rw,relatime)
sysfs               on  /sys                             type  sysfs       (rw,nosuid,nodev,noexec,relatime)
systemd-1           on  /proc/sys/fs/binfmt_misc         type  autofs      (rw,relatime,fd=25,pgrp=1,timeout=0,minproto=5,maxproto=5,direct)
tmpfs               on  /dev/shm                         type  tmpfs       (rw,nosuid,nodev)
tmpfs               on  /run                             type  tmpfs       (rw,nosuid,noexec,relatime,size=1641892k,mode=755)
tmpfs               on  /run/lock                        type  tmpfs       (rw,nosuid,nodev,noexec,relatime,size=5120k)
tmpfs               on  /run/user/0                      type  tmpfs       (rw,nosuid,nodev,relatime,size=1641888k,mode=700)
tmpfs               on  /sys/fs/cgroup                   type  tmpfs       (ro,nosuid,nodev,noexec,mode=755)
udev                on  /dev                             type  devtmpfs    (rw,nosuid,relatime,size=8166344k,nr_inodes=2041586,mode=755)
/dev/sda1           on  /boot                            type  ext4        (rw,noatime,discard,data=ordered)
/dev/sda3           on  /                                type  ext4        (rw,noatime,discard,errors=remount-ro,data=ordered)
//Server/Share1     on  /mnt/share1                      type  cifs        (ro,relatime,vers=1.0,cache=strict,username=someuser,domain=COMPANY,uid=0,noforceuid,gid=0,noforcegid,addr=Server,file_mode=0755,dir_mode=0755,nounix,serverino,rsize=61440,wsize=65536,actimeo=1)

You can also filter some outputs, like cgroup, /sys/:

alias mountc='mount | column -t | grep -v "type  cgroup" | sort -V'
alias mountc='mount | column -t | grep -v "/sys/" | sort -V'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment