Reputation
3,599
Top tag
Next privilege 5,000 Rep.
Approve tag wiki edits
Badges
12 35
Newest
 Yearling
Impact
~484k people reached

Dec
18
comment How can I create multiple users in Unix?
I added a bit more info for the case of reading usernames from a file
Dec
14
comment awk print to file
$1 == "success" { print > "success.txt" } would be even better
Jan
15
comment UNC Argument in bash scipt
Git Bash allows you to use //my/share/is/here style UNC paths. You can even cd there (something a DOS prompt wouldn't let you). Might work with Cygwin too, but I haven't tried.
Jan
12
comment Strip off word pattern at the end of string using sed
\s* is zero or more white-space characters. You might not need it. It seems Costas was being extra careful.
Jan
12
comment How can I run a specific line as a command in a text file?
No need to put a space between line_num and p, so for example if line_num is 123, then you can sed -n 123p | bash. And if sh is enough, then just use sh instead of bash.
Dec
23
comment renaming all files in all sub directories
@juicebyah my bad, I overlooked an important detail in your question. Fixed it now, see my updated post.
Dec
23
comment Unable to run python script - Permission Denied
Every time you do chmod 777, somewhere in the world a kitten dies
Dec
20
comment How do I make an alias to substitute single word in a piped command?
Yes. You can use $1 if you want only the first argument.
Dec
20
comment tmux ignores the configuration files
What happens if you create a new tmux.conf file with the single line set -g status-bg "#105C8D" and run tmux -f tmux.conf ?
Dec
20
comment How to list filenames within a folder based on a pattern supplied?
You could do that with either ls *a* or ls | grep a
Dec
20
comment bash permission denied but sh works
Run the mount command and find the line of the mount point. I bet it has noexec written on it. If you mount the drive manually, you can specify the exec flag explicitly. But as I explained, I don't recommend to do that.
Mar
10
comment git push in gnome-term crashes my window manager
@user1855481 how about SSH_ASKPASS=/bin/false ?
Mar
10
comment bash scripting - read tarball from stdin
@jayhendren when you got an empty file, you must have used a program somewhere that consumed stdin, that's why.
Mar
10
comment How to use restricted characters in egrep?
Replace egrep -l with pcregrep -Ml
Mar
9
comment Find the maximum length of characters in a field
@suneelbabu.etl did you try the awk solution? That should work, dynamically detecting the max length.
Mar
8
comment Trouble Installing APT on Centos 6 64 bit
@DavidSilvaSmith what is your real goal here? APT is a "means to an end", not really an end itself. Maybe you're asking the wrong question. If the only reason you're installing APT is to install XYZ, then maybe should be asking how to install XYZ.
Mar
1
comment how to execute a python program in a shell script
@rajcoumar it's more portable this way. In some systems python might be in /usr/bin/python, in others it might be /opt/bin/python. With #!/usr/bin/env python it should work in all systems where python is correctly installed, regardless of its exact location.
Feb
28
comment Adding a Column of values in a tab delimited file
@Ron sed is most practical for pattern substitution and saving in-place. For your requirement of saving the file it was a relatively convenient option. If you don't need to write back to the same file you're processing, then awk is usually much easier to work with.
Feb
28
comment How to add text to end of line when pattern is matched?
Thanks @glennjackman, updated my answer
Jan
16
comment Match a single character in a string bash script
@NirmalArri save the script for example in script.sh, and run it with bash script.sh