Format output with delimiter ls /var/ | xargs | sed 's/ /,/g' Add text to end of file if it not exists in the file sed -e '/option=/{s/.*/option=value/;:a;n;:ba;q}' -e 'aoption=value' /dir/filename Count inodes