Check These Out
Using -Z with grep and -0 with xargs handles file names with spaces and special characters.
Replace 'csv_file.csv' with your filename.
You can display, save and restore the value of $IFS using conventional Bash commands, but these functions, which you can add to your ~/.bashrc file make it really easy.
To display $IFS use the function ifs shown above. In the sample output, you can see that it displays the characters and their hexadecimal equivalent.
This function saves it in a variable called $saveIFS:
$ sifs () { saveIFS=$IFS; }
Use this function to restore it
$ rifs () { IFS=$saveIFS; }
Add this line in your ~/.bashrc file to save a readonly copy of $IFS:
$ declare -r roIFS=$IFS
Use this function to restore that one to $IFS
$ rrifs () { IFS=$roIFS; }
cd - would return to the previous directory of your cd command. NB: previous dir is always stored in $OLDPWD variable.
This is a more accurate way to watch the progress of a dd process. The $DDPID=$! is needed so that you don't get the PID of the sleep. The sleep 1 is needed because in my testing at least, if you run kill -USR1 against dd too quickly, it will kill it off instead of display the status. So you need to wait a second, probably so that it can configure itself to trap the USR1 signal.
Clears your clipboard if xsel is installed on your machine.
If your xsel is dumb, you can also use
$xsel --clear --clipboard
Print out your age in days in binary.
Today's my binary birthday, I'm 2^14 days old :-)
.
This command does bash arithmatic $(( )) on two dates:
Today: $(date +%s)
Date of birth: $(date +%s -d YYYY-MM-DD)
The dates are expressed as the number of seconds since the Unix epoch (Jan 1970),
so we devide the difference by 86400 (seconds per day).
.
Finally we pipe "obase=2; DAYS-OLD" into bc to convert to binary.
(obase == output base)
Scans local area for visible Bluetooth devices. Use 'hcitool inq' to discover the type of device it is. And use -i hciX option to specify the local Bluetooth device to use.
Lists the local files that are not present in the remote repository (lines beginning with ?)
and add them.