Title: what this command do ? ls /usr/bin | grep ”man” | sed ”s/man/###/”?
Tags: command-line;sed
Question: I have a question
I want to know what this command do
ls /usr/bin | grep ”man” | sed ”s/man/###/”
I have use this command and show me everything with ###, but I dont know whats mean.
I hope someone can explain it.
Comment: just out of curiosity, why do you want to execute that command? it seems utterly useless. and if you don't know what it means, why are you trying to execute it? are you just surfing around the internet and executing random commands that you find? ;)

Here is the accepted answer: ls /usr/bin
list the contents of /usr/bin and only show filenames.
| grep ”man”
scan the output of the 1st part and search for "man". Result:
ls /usr/bin | grep man
catman
dbmmanage
dh_installman
dh_installmanpages
manpath
mysqltestmanager
mysqltestmanagerc
mysqltestmanager-pwgen
pod2man
w3mman
| sed ”s/man/###/”?
match pattern "man" and change it with "###". But this technically does nothing but echo the result. Example:
$ cp /usr/bin/w3mman .
$ ls |grep man
w3mman
$ ls |grep man|sed "s/man/###/"
w3m###
$wdamen@pluto:~$ ls w3*
w3mman
The file is still there and there is no file with "###"


{'source': 'StackExchangeDataset', 'subset': 'askubuntu.com', 'metadata': {'AnswerCount': 1, 'CommentCount': 1, 'ContentLicense': 'CC BY-SA 3.0', 'CreationDate': '2014:00:01/08/14', 'FavoriteCount': None, 'PostTypeId': 1, 'Tags': '<command-line><sed>', 'Title': 'what this command do ? ls /usr/bin | grep ”man” | sed ”s/man/###/”?', 'ViewCount': 5822, 'id': 402290, 'user_AboutMe': None, 'user_AccountId': 3827473.0, 'user_DisplayName': 'user233233', 'user_Reputation': 705.0, 'user_Views': 22.0, 'user_id': 233233.0}}