Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

LIst of dirs without trailing slash "/"

Tags:

linux

bash

sed

awk

I'd like a list (one item per line) of a dir. But the last character is a "/"

 ls /var/lib/mysql/ | grep -v "\."

This shows:

 wachuwar_funkfow/
 wachuwar_prueba/
 webdeard_arde/

And I'd like

 wachuwar_funkfow
 wachuwar_prueba
 webdeard_arde

I'd appreciate help

like image 579
abkrim Avatar asked Jan 28 '12 10:01

abkrim


1 Answers

Probably, your ls is aliased or defined as a function in your .bashrc or /etc/profile or elsewhere.

Try the full path to ls like

/bin/ls /var/lib/mysql/ 
like image 70
Basile Starynkevitch Avatar answered Oct 29 '22 18:10

Basile Starynkevitch