Reputation
22,648
Next tag badge:
894/400 score
77/80 answers
Badges
3 51 81
Newest
 Enlightened
Impact
~980k people reached

15h
comment Find -exec + vs find | xargs. Which one to choose?
I don't see how -0 is more of a pain than --delimiter "\n".
Jun
23
comment adding text to filename before extension
@SargeBorsch What do you need explained? My answer, the snippet in the question, and Doug's answer are only differ by a few characters, and Doug's answer explains even less than mine so I don't know what it is you want. If you just compare the difference in the two outputs in the question it should be trivially easy to figure out what they do. I can explain why my answer is preferable to Doug's. 1. I use printf with a format string instead of the less portable echo. 2. I use parameter expansion which is more efficient than calling an external binary (basename) for such a simple task.
Jun
5
comment What are the steps of this command using ; || and &&
@R0tten && and || are left-associative binary operators with equal precedence. The ; is not an operator at all but merely a simple separator, like a newline, and as such has the lowest "precedence". That should be enough to clear up any confusions you have.
Jun
4
comment Find files whose name is 4 characters long
Judging by the example given in the question, OP is looking at file names not contents.
Jun
4
comment Find files whose name is 4 characters long
@joeLovick In *nix platforms a newline is a single linefeed character.
Jun
4
comment Find files whose name is 4 characters long
@ColeJohnson It's not the best tool for the job. grep matches lines of text, but not all filenames are guaranteed to be single lines of text.
Jun
2
comment Need to Split the output in Row & Column
@user43791 You are right. I discovered the same and deleted my prior erroneous comment but it turns out you saw it anyways. After reviewing the awk grammar, I learned that the print statements do accept parentheses after all so carry on as you were.
Jun
2
comment Need to Split the output in Row & Column
@NitinKapoor I added tabs to the output. Is that what you meant by rows and columns?
Jun
2
comment Need to Split the output in Row & Column
@NitinKapoor Look back at your question - I think you screwed up the formatting.
Jun
2
comment Stopping find command after finding files in one directory
See here for other ideas: unix.stackexchange.com/q/62880/9537
Jun
2
comment Stopping find command after finding files in one directory
See here: unix.stackexchange.com/q/62880/9537
May
30
comment How do I rename many files from whatever to sequential filenames?
You just want to number the files in some random order?
May
30
comment How can I delete a file named “>”?
It's probably worth pointing out that find is not like rm because it is recursive and will delete every file named rm under your current directory tree no matter how deep.
May
29
comment Use alias after issuing sudo su command
.profile is only read for login shells. You should define aliases in .bashrc not .profile.
May
29
comment Specify String Lenth in Awk Pattern Search
It should, but why don't you just try it and see?
May
29
comment Specify String Lenth in Awk Pattern Search
Is your awk implementation provided by mawk? It looks like mawk doesn't support the {m,n} syntax at all. Try using a more full featured implementation like GNU's gawk.
May
27
comment Remote SSH into raspberry pi
The source net of 192.168.2.2 suggests you are only forwarding local connections. You probably want to set it to something more inclusive like 0.0.0.0 to forward incoming connections from all outside sources.
May
19
comment How to escape correctly this word on vim?
To figure out what should or should not be escaped, read the vim documentation on the magic option: :help 'magic'.
May
15
comment How to properly use awk in ksh?
What you have here is a frankenscript with awk and shell parts mashed together. You need awk to run awk scripts. ksh doesn't understand awk scripts and isn't smart enough to run awk unless you tell it to. Also you missed a " after STOP in your script.
May
15
comment Script to read line by line from a file pipe that to another command and output to another file
You have a space between $ and line. If that typo is in your script as well all you are doing is hashing the text $ line over and over.