Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
C0D4669023yFind directories called public, and rename to './p'
or I'm looking at this all wrong and should get another coffee before punching that into a terminal and regretting every moment of it 😂 -
@C0D4 The tr command here replaces every occurence of any of the characters dot, slash and p with a space.
-
(find -type d)
() For subshell.
grep public
search in result for public.
Highly inefficient and fragile, as output of find is parsed directly.
tr replaces chars as @Ibfalvy explained.
All in all, total bleh.
Note:
./public/test becomes ublic test
The subshell is to dump all content before grep and tr takes place.
Hence grep works on the whole output of the find command. -
@lbfalvy
Easier spotting of interesting substrings.
I'd guess it's a way to "highlight" the substring.
Maybe to find out which subfolders exists in an webserver directory to determine where the assets are stored.
I'll do sometimes the same, just in a more eloquent way.
Helps filtering out non interesting stuff. XD
Related Rants
-
gururaju56*Now that's what I call a Hacker* MOTHER OF ALL AUTOMATIONS This seems a long post. but you will definitely ...
-
linuxxx70This guy at my last internship. A windows fanboy to the fucking max! He was saying how he'd never use anythi...
-
creedasaurus62Another dev on my team just got a new machine. Before he came in today I made two separate USB installers and ...
I was passed someone else's homework which included describing what certain Bash commands do. I've a fair bit of experience and I can't imagine why this one would be useful, can you think of any use for it?
(find -type d) | grep public | tr './p' ' '
rant
bash
homework
linux