Pario TechnoBlob
About
Posts
Tag: sed
Current directory name
pwd | sed s///n/g | tail -n 1 | sed s/\ /_/g
List processes in a hierarchy
ps -e -o pid,args --forest List processes by % cpu usage ps -e -o pcpu,cpu,nice,state,cputime,args --sort pcpu | sed '/^ 0.0 /d' List processes by mem usage ps -e -orss=,args=...
Text manipulation using sed
Replace string1 with string2 sed 's/string1/string2/g' Modify anystring1 to anystring2 sed 's/(.*)1/\12/g' Remove comments and blank lines sed '/ *#/d; /^
$/d' Concatenate...
Replace word in files
Example: replace Strict with Transitional in your PHP-files sed -i -e 's/Strict/Transitional/' *.php Warning! Edit files in place
««
«
1
2
3
4
…
9
»
»»