$ git log
Check out the version into the current dir:
git checkout 45a5b1aa137c07b15f820f49762feb7ec068b3f8 .
http://stackoverflow.com/questions/373812/rollback-file-to-much-earlier-version
A place for John to record his techy notes, both to refer back to when needed, and as a help for others...
$ git log
git checkout 45a5b1aa137c07b15f820f49762feb7ec068b3f8 .
.vimrc
set vb t_vb= " Turn off visual bell
.inputrc
set bell-style none
~/.bash_profile (or /etc/profile or .bashrc or somewhere)
setterm -blength 0
$ xset b off
$ xset b on
~/.bash_profile:
export LESS="-q"
head and tail do not have to be negative...tail -X FILENAMEtail +Y FILENAME
$ tail +20 FILENAME
tail: Warning: "+number" syntax is deprecated, please use "-n +number"
$ head +20 FILENAME
head: cannot open `+20' for reading: No such file or directory
$ tail -n +$SKIP FILENAME
$ seq 1 5 > FILENAME
$ cat FILENAME
1
2
3
4
5
$ head +2 FILENAME
head: cannot open `+2' for reading: No such file or directory
==> FILENAME <==
1
2
3
4
5
$ head -2 FILENAME
1
2
$ head -n 2 FILENAME
1
2
$ head -n +2 FILENAME
1
2
$ head -n -2 FILENAME
1
2
3
$ tail +2 FILENAME
tail: Warning: "+number" syntax is deprecated, please use "-n +number"
2
3
4
5
$ tail -2 FILENAME
4
5
$ tail -n 2 FILENAME
4
5
$ tail -n -2 FILENAME
4
5
$ tail -n +2 FILENAME
2
3
4
5
:%g/^sometext,/ d
john@hostname:~/.ssh$ ssh user@hostname
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ WARNING: POSSIBLE DNS SPOOFING DETECTED! @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
The RSA host key for hostname has changed,
and the key for the according IP address 123.45.67.89
is unknown. This could either mean that
DNS SPOOFING is happening or the IP address for the host
and its host key have changed at the same time.
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
Someone could be eavesdropping on you right now (man-in-the-middle attack)!
It is also possible that the RSA host key has just been changed.
The fingerprint for the RSA key sent by the remote host is
01:23:45:67:89:ab:cd:ef:fe:dc:ba:98:76:54:32:10.
Please contact your system administrator.
Add correct host key in /home/john/.ssh/known_hosts to get rid of this message.
Offending key in /home/john/.ssh/known_hosts:9
RSA host key for hostname has changed and you have requested strict checking.
Host key verification failed.
Offending key in /home/john/.ssh/known_hosts:9
$ ssh-keygen -R hostname
$ ssh-keygent -F hostname
for FILE in $(find * -type f -exec grep -l "$STRING" {} \;)
do
echo -n "$FILE"
grep -n "$STRING" $FILE
done
$ find * -type f -exec grep -n $STRING {} /dev/null \;
path/to/the/FILE:12:I found $STRING on line 12!
grep -n $STRING {} /
grep -n $STRING {} .
grep -n $STRING {} *
$ find * -type f -exec grep STRING {} no_such_file \;
grep: no_such_file: No such file or directory
grep: no_such_file: No such file or directory
grep: no_such_file: No such file or directory
grep: no_such_file: No such file or directory
grep: no_such_file: No such file or directory
[ AA.jpg ][ AB.jpg ][ AC.jpg ]
convert +append AA.jpg AB.jpg AC.jpg row_A.png
+append becomes -append like so:
[ row_A.png ]
[ row_B.png ]
[ row_C.png ]
convert -append row_A.png row_B.png row_C.png all_rows.png