Categories: TutorialsUbuntu

namei Command in Linux

Introduction

As a Linux administrator, you often have to work with files, folders, symlinks, etc. And sometimes you need to know more information about individual elements in a path for example file type, owner, …

For that matter, the namei command appeared. Now we’re gonna teach you to use the namei command in Linux.

The syntax of the namei command

The syntax:

namei [options] pathname...

For example:

$ namei test/test1.txt

Output:

f: the path name

d: directory

-: the file name

Using the namei command

1. Align to the left margin (using -v option)

$ namei -v test/test1.txt

Output:

2. Show owner and group (using -o option)

$ namei -o test/test1.txt

Output:

This proves that this folder and file are both owned by ubuntu.

3. Show long list (using -l option)

$ namei -l test/test1.txt

Output:

With this option, it will show more privileges of the owner.

If you only want to show the privileges of the owner, let’s use the -m option:

$ namei -m test/test1.txt

Output:

Conclusion

We just taught you to use the namei command in Linux.

Thank you for referring!

Ubuntu Server Admin

Recent Posts

A better way to provision NVIDIA BlueField DPUs at scale with MAAS

MAAS 3.7 has been officially released and it includes a bunch of cool new features.…

15 hours ago

Ruby Floats: When 2.6x Faster Is Actually Slower (and Then Faster Again)

Update: This article originally concluded that Eisel-Lemire wasn't worth it for Ruby. I was wrong.…

18 hours ago

MicroCeph: why it’s the superior MinIO alternative (and how to use it)

Recently, the team at MinIO moved the open source project into maintenance mode and will…

2 days ago

MicroCeph: why it’s the superior MinIO alternative (and how to use it)

Recently, the team at MinIO moved the open source project into maintenance mode and will…

2 days ago

Design and Documentation clinics at FOSDEM Fringe 2026

FOSDEM is one of the biggest and most exciting open source events of the year,…

3 days ago

Extending ROS Noetic Support with ESM-Enabled Content Snaps

Since ROS Noetic reached end of life in May 2025, the Ubuntu Robotics team has…

3 days ago