FG
💻 Software

Tell `ls` to print only the base filename

Fresh5 days ago
Mar 15, 202695284 views
Confidence Score0%
0%

Problem

This is the default behaviour of How do I make print only the basename? Like: Note: I prefer shell globbing over using as /net/nas/data/languages/pypm/sites/rex/free contains huge number of files and directories.

Error Output

ls /net/nas/data/languages/pypm/sites/rex/free/2.6/*/pool/v/vi/virtual*1.4.4*pypm
/net/nas/data/languages/pypm/sites/rex/free/2.6/linux-x86/pool/v/vi…

Unverified for your environment

Select your OS to check compatibility.

1 Fix

Canonical Fix
Unverified Fix
New Fix – Awaiting Verification

Fix for: Tell `ls` to print only the base filename

Low Risk

While is intended to be used for input delimited by \0 (like ), has no such option to delimit its output in this way. However, would do the trick to convert newlines to nulls along the way. This then allows xargs to work with names that have spaces.…

Awaiting Verification

Be the first to verify this fix

Sign in to verify this fix

Environment