Check These Out
Having to escape forwardslashes when using sed can be a pain. However, it's possible to instead of using / as the separator to use : .
I found this by trying to substitute $PWD into my pattern, like so
$ sed "s/~.*/$PWD/" file.txt
Of course, $PWD will expand to a character string that begins with a / , which will make sed spit out an error such as "sed: -e expression #1, char 8: unknown option to `s'".
So simply changing it to
$ sed "s:~.*:$PWD:" file.txt
did the trick.
This command tell you if your hardware is 32 or 64 bits even if you install a 32bits OS on a 64 bits hardware.
If your distro don't support the -q switch, try doing :
$ grep &>/dev/null '\' /proc/cpuinfo && echo 64 bits || echo 32 bits
Self-referential use of wget.
Replace 'csv_file.csv' with your filename.
Requires you to have password free login to remote host ;)
Requires xclip and notify-send (If you want to put into clipboard and be notified when action is completed).
DATE=$(date +%Y-%m-%d_%H-%M-%S)-$(($(date +%N)/10000000));
HOST="ssh host of your choice";
DEST="destination folder without trailing slash";
URL="URL for file if uploaded to web enabled dir ie. http://$HOST/~user/screenshot_$DATE.png";
import -window root png:- | ssh $HOST "cat > $DEST/screenshot_$DATE.png";
echo $URL | xclip; notify-send -u low "Screenshot Taken" "Entire screen.\nCopied to clipboard"
Create a exact mirror of the local folder "/root/files", on remote server 'remote_server' using SSH command (listening on port 22)
(all files & folders on destination server/folder will be deleted)
A null operation with the name 'comment', allowing comments to be written to HISTFILE. Prepending '#' to a command will *not* write the command to the history file, although it will be available for the current session, thus '#' is not useful for keeping track of comments past the current session.
find all email addresses in a file, printing each match. Addresses do not have to be alone on a line etc. For example you can grab them from HTML-formatted emails or CSV files, etc. Use a combination of
$...|sort|uniq$
to filter them.
Start printing the contents of filename to stdout, until a matching line to regex is found, then stop.