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

Why you should retire your Microsoft Azure Consumption Commitment (MACC) with Ubuntu Pro

When your organization first signed its Microsoft Azure Consumption Commitment (MACC), it was a strategic…

23 hours ago

Java 25 now available on Google Cloud Serverless

[December 11, 2025] Today Canonical, the publisher of Ubuntu, announced the immediate availability of Java…

2 days ago

How to launch a Deep Learning VM on Google Cloud

Setting up a local Deep Learning environment can be a headache. Between managing CUDA drivers,…

2 days ago

Harnessing the potential of 5G with Kubernetes: a cloud-native telco transformation perspective

Telecommunications networks are undergoing a cloud-native revolution. 5G promises ultra-fast connectivity and real-time services, but…

3 days ago

The rhythm of reliability: inside Canonical’s operational cadence

In software engineering, we often talk about the “iron triangle” of constraints: time, resources, and…

4 days ago