Explain awk command
See https://stackoverflow.com/a/17914105/1745001 for the answer that was duplicated here.
See https://stackoverflow.com/a/17914105/1745001 for the answer that was duplicated here.
I don’t know if it’s possible to do ranges in awk. You could do a for loop, but you would have to add handling to filter out the columns you don’t want. It’s probably easier to do this: awk -F, ‘{OFS=”,”;print $1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$20,$21,$22,$23,$24,$25,$30,$33}’ infile.csv > outfile.csv something else to consider – and this faster and more … Read more
Addressing the proposed solution from dmckee: While some versions of Bash may allow hyphens in function names, others (MacOS X) do not. I don’t see a need to use return immediately before the end of the function. I don’t see the need for all the semi-colons. I don’t see why you have path-element-by-pattern export a … Read more
Assuming you have GNU date, like so: date –date=”1 days ago” ‘+%a’ And similar phrases.
Try grep -Fwf file2 file1 > out The -F option specifies plain string matching, so should be faster without having to engage the regex engine.
You want the -w option to specify that it’s the end of a word. find . | xargs grep -sw ‘s:text’
I had a similar error after php update. PHP fixed a security bug where o had rw permission to the socket file. Open /etc/php5/fpm/pool.d/www.conf or /etc/php/7.0/fpm/pool.d/www.conf, depending on your version. Uncomment all permission lines, like: listen.owner = www-data listen.group = www-data listen.mode = 0660 Restart fpm – sudo service php5-fpm restart or sudo service php7.0-fpm … Read more
Easiest solution is to use “mmv” You can write: mmv “long_name*.txt” “short_#1.txt” Where the “#1” is replaced by whatever is matched by the first wildcard. Similarly #2 is replaced by the second, etc. So you do something like mmv “index*_type*.txt” “t#2_i#1.txt” To rename index1_type9.txt to t9_i1.txt mmv is not standard in many Linux distributions but … Read more
If you want the pure plain text(my requirement) then all you need is unzip -p some.docx word/document.xml | sed -e ‘s/<[^>]\{1,\}>//g; s/[^[:print:]]\{1,\}//g’ Which I found at command line fu It unzips the docx file and gets the actual document then strips all the xml tags. Obviously all formatting is lost.
As grawity said, ~/.bashrc is what you want, since it is sourced by non-interactive non-login shells. I expect the problem you’re having has to do with the default Ubuntu ~/.bashrc file. It usually starts with something like this: # If not running interactively, don’t do anything [ -z “$PS1” ] && return You want to … Read more