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...

Sponsored

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)

Sponsored
$ 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

Canonical Releases Ubuntu 25.04 Plucky Puffin

The latest interim release of Ubuntu introduces “devpacks” for popular frameworks like Spring, along with…

2 days ago

Ubuntu 25.04 (Plucky Puffin) Released

Ubuntu 25.04, codenamed “Plucky Puffin”, is here. This release continues Ubuntu’s proud tradition of integrating…

3 days ago

Extended Security Maintenance for Ubuntu 20.04 (Focal Fossa) begins May 29, 2025

Ubuntu released its 20.04 (Focal Fossa) release 5 years ago, on March 23, 2020. As…

3 days ago

Ubuntu 20.04 LTS End Of Life – activate ESM to keep your fleet of devices secure and operational

Focal Fossa will reach the End of Standard Support in May 2025, also known as…

4 days ago

Ubuntu MATE 25.04 Release Notes

Ubuntu MATE 25.04 is ready to soar! 🪽 Celebrating our 10th anniversary as an official…

4 days ago

Ubuntu Weekly Newsletter Issue 887

Welcome to the Ubuntu Weekly Newsletter, Issue 887 for the week of April 6 –…

6 days ago