linux bash command

Bash Shell Reference

command description example
ls list files in a directory ls
cd changes the shell’s working directory to the given directory cd ..
mkdir creates a new directory with the given name mkdir test
cp copies a file/directory cp -r test1 test2
mv moves (or renames) a file/directoy mv test1 test2
rm deletes file/directory rm -rf test
touch update the last-modified time of a file (or create an empty file) touch test.py
cat output the contents of a file cat test.py
du report disk space used by a file/directory du -ah ./
diff output differences between two files diff test1.py test2.py
chmod change the permissions on a file or group of files chmod u+x test.py
chown change the owner of a file chown -R usr:build test
find search for files by name within a given directory find /home -size +128k/test.py
zip, unzip create a .zip archive or extract its contents zip -q -r test.zip test
tar unix archiving/de-archiving program tar -cvf/-czf test.tar (.gz) test tar -xvf/-xzvf test.tar (.gz)
date outputs the current date/time date +”%Y-%m-%d”
uname print information about the system uname -a
time measure how long a program takes to run time -p date
kill terminate a process kill -9 pid
wget download from a URL and save it to a file on the local hard drive wget URL
curl download from a URL and output its contents to the console curl -O URL
vim, emacs a complicated text editer (recommended) vim test.py
echo like println for the shell echo “Hello”
awk a full-featured text processing language awk ‘{print $0}’ /etc/passwd

frequently used command

command desctiption
ls -l|grep “^-“| wc -l count the number of the file under the local directory
ls -lR|grep “^-“| wc -l count the number of the file containing the subdirectory under the local directory
ls -l|grep “^d”| wc -l count the number of the directory
recent article

InfraView

Image browsing and editingIrfanView is a fast, compact and innovative FREEWARE (for non-commercial use) graphic viewer for Windows XP, Vista, 7, 8 and 10.browsingIrfanView uses mouse wheel to switch the image.Ctrl + Y: crop the given boxCtrl + T: ...…

application InfraView blogread
previous article

Vim for latex

最近 Vim 和 LaTex 用的都比较多,如果你也经常使用 Vim来编辑 LaTex 文档,不妨尝试一下。快捷键 = 自动格式化对齐样式,对于有代码洁癖强迫症的人来说绝对是福音。 gq家族 根据 textwidth 自动换行。gqgq: 换行当前段。gqap: 格式化整个段。{Visual}gq: 格式化选定的部分。对于每行字符数量不能超过 80 的人来说,又一个福音。最后你的文章会非常整齐,就像这样: Vim (an acronym for Vi IMproved) is a...…

computer science vim latex blogread