xxxxxxxxxx# Using SCP Transfer- scp -P 2322 file.txt calvchen@10.224.10.10:/home/calvchen/# Folder Accesibility- chmod 755 function.sh --- rwx = 4 + 2 + 1# Count Files under directory- ls | wc -l# Folder Size- du -sh * # or- du -h --max-depth=1# Find files not end with sth- find . -not -name "*.jpg"# Find command- which or whereis
xxxxxxxxxx# atb_mod_01.cpp atb_mod_02.cpp atb_mod_03.cpp atb_mod_04.cpprename mod adb * ## atb_adb_01.cpp atb_adb_02.cpp atb_adb_03.cpp atb_adb_04.cpp
xxxxxxxxxxI -- Edit mode: -- Command # e.g. :wqq -- exitw -- reserveo -- insert a blank line in view modegg -- Move the first lineG -- Move the last lined -- Delete mode # e.g. ggdGy -- Copy mode # e.g. ggyG, copy the selected content to cacheyy -- Copy whole line # 3yy for copy 3 linesp -- Paste/ -- find text, n(next), N(last)/hello\> --- find start with hello/^hello --- find head of the line/world$ --- find end of the lineu -- undoCtrl + r -- Redo (not confirmed)
xxxxxxxxxxw --- next wordb --- last wordCTRL + a --- first wordCTRL + e --- end word)( --- move by sentenseCTRL + w --- delete the left wordCTRL + k --- clean the word to the rightSHIFT + PageUp/ PageDwonfx - jump to the previous occurrence of character xFx - jump to the previous occurrence of character x
xxxxxxxxxx# Find cmd history- CTRL + r# Diff files# -y indicates parallel display, -W for the display width- diff log2014.log log2013.log -b -B -H -y -W 50# Generate SSH- ssh-keygen
xxxxxxxxxx# find files with string inside- grep -r "string" dir# Search by tag- grep MYDEBUG file1 file2 -r | grep -v TAG# find conditions and save to files- grep -E "some thing|some other thing" origin.txt >> target.txt
xxxxxxxxxx# User Env- vim ~/.bashrc --- check env variable# Make Alias- vim ~/.bashrc- alias home="cd /home/calvchen"- source ~/.bashrc
###
xxxxxxxxxx# zip# Handling Zip Bombzip -FF 210211.zip --out 210211-2.zip -fz# tartar --jcv -f filename.tar.bz2 文件 压缩tar -jxv -f file.tar.bz2 -C 解压缩tar -jtv -f 文件 查看