Quickly publish and refresh NFS exports from the shell for networked file access. 11.03.2026 | reading time: 2 min The `exportfs` command lets the administrator tell the kernel which directories to share over NFS without rebooting the server; it reads the exports file, updates the kernel export table and can show current exports, so the shell becomes the control panel for NFS. Hands-on example Create a share, add it to the exports file, and refresh the server in one flow: ```sudo mkdir -p /srv/nfs/share; echo '/srv/nfs/share 192.0.2.0/24(rw,sync,no_subtree_check)' | sudo tee -a /etc/exports; sudo exportfs -ra; sudo exportfs -v; sudo showmount -e``` Example observed output might look like: ```/srv/nfs/share 192.0.2.0/24(sync,wdelay,no_subtree_check,root_squash,anonuid=65534,anongid=65534) ; Exports list on server: /srv/nfs/share 192.0.2.0/24``` When to refresh exports Use `exportfs -a` to export all entries from `/etc/exports` and `exportfs -r` to re-export after edits without touching the NFS server process; `exportfs -u` unexports specified exports and `-v` enables verbose reporting, so small changes don’t require restarting services. Security and access control Define client access and behavior directly in `/etc/exports` with options like `root_squash`, `no_root_squash`, `rw` or `ro`, and anon UID/GID settings; remember to align firewall rules and rpcbind state, because exportfs only manages the kernel export table, not network ports or authentication. Related commands to know Inspect and troubleshoot exports with `showmount -e` from clients or server, control the NFS daemon with `systemctl` or the distribution service tool, and mount shares on clients with `mount -t nfs`, since exportfs is a narrow but critical piece in the NFS stack. Next steps Try editing `/etc/exports` and using `exportfs -ra` in a lab to see immediate effects, then practice client mounts and permission tweaks to understand root squashing and anon mapping; pursue deeper study and certifications like CompTIA Linux+ or LPIC-1 and consider intensive exam preparation at bitsandbytes.academy to turn hands-on skills into credentials. Join Bits & Bytes Academy First class LINUX exam preparation. filesystem network utilities infrastructure security storage