FreeBSD missing tee and tee append – make tee bash functions
The version of FreeBSD 8.0 that I am using is missing tee & tee -a (tee append) You know tee as in write on screen & file: date | tee thedate.txt Which will runRead More…
The version of FreeBSD 8.0 that I am using is missing tee & tee -a (tee append) You know tee as in write on screen & file: date | tee thedate.txt Which will runRead More…
Source: http://stackoverflow.com/questions/1251999/how-can-i-replace-a-newline-n-using-sed Replace with space: Use this solution with GNU sed: someoutput | sed ':a;N;$!ba;s/\n/ /g' Here is cross-platform compatible syntax which works with BSD sed (FreeBSD 8 confirmed): someoutput | sed -eRead More…
Learned it from here http://stackoverflow.com/questions/6168781/how-to-include-nohup-inside-a-bash-script They use it to make current script daemoned but you can also make scripts that you run from within a script daemoned Instead of doing nohup prog & or nohupRead More…
You can either disable all trusted domains or certain/specific trusted domains. Winbind will only allow users to use SMB if they can authenticate into the samba server with a user that isRead More…
If your date command outputs wrong time or date use this command to sync with a known good timeserver: ntpdate -u pool.ntp.org
Since we dont have uniq Here is it, and it doesnt even need a sort Basically it goes line by line and only prints it if it hasnt been seen cat text.txtRead More…
Imagine a list of files (either in a text file, or a command that outputs a list of files). First make sure these files are newline seperated. Why newline? because filenames dontRead More…
Recommend to read this first: http://wiki.bash-hackers.org/syntax/quoting With bash you will see 3 types of quoting & in general typing anything in bash you will be in one of these scenarios (your eitherRead More…
schedule is created to mimic linux’s “at” function which allows you to schedule a command/script/set of commands to run later. schedule is a bash function (that you need to copy paste intoRead More…
I find nl very useful tool when working on *nix systems or just any systems. Throwing in number lines on output gives you an idea of where lines start and end. LinesRead More…