In Linux or Unix, MacOS or WSL(Windows-Subsystem-for-Linux), terminal commands could be "fun" to use.
As an inexperienced developer, I would like to adapt more and panic less,
for example when login to a container console realizing I was trapped in Vim but only wish to edit a text file X(
I try to keep notes short and sweet.
(some usage might depend on OS)
Two files, concatenation with cat (and '>')
touch sample1
touch sample2
echo "123" > sample1
echo "abc" > sample2
cat sample1 sample2 > sample1_2
cat sample1_2 sample2 > sample1_2_2
cat sample1 sample2 sample1 > sample1_2_1diff arg: -y compare side-by-side
diff sample1_2_1 sample2_2_1 -yPrint OS info
uname arg: a for all
man uname
uname -aps cmd list processes
arg: -A (capital)all users, -v verbose, -m sort by memory usage
ps -Avmprint matching lines with line number
cat sample1_2_1 | grep 5 -nIf I were an imaginary hacker and picky about not leaving trace...
appending a space to hide cmds outside history
history | tail
pwd
history | tailtouch cmd changes modification time
ls -l
touch sample1_2_1
ls -lshred cmd overwrites specified file(s) for harder discovery
arg: x for exactly same size
ls -l
shred sample1_2_2 -v -x
cat sample1_2_2Smart design of navigational control :P
(Use ESC to quit insert mode)
k:up, j:down, H:top, M:middle,
w:start-of-next-word, e:end-of-next-word, b:start-of-previous-word,
59gg:line-59,
fx:next-x, Fx:previous-x, ;:repeat-jump, ,:reverse-repeat-jump
:w write
:q quite