From 1ce15b00a1e4492e1e9ac7f95730fd3bd5c4b521 Mon Sep 17 00:00:00 2001 From: hugue Date: Fri, 21 Dec 2018 20:04:36 +0800 Subject: [PATCH] add chinese for pages.cn/linux/add-apt-respository.md --- pages.cn/common/7z.md | 31 ++++++++++++++++++++ pages.cn/common/7za.md | 24 ++++++++++++++++ pages.cn/common/7zr.md | 16 +++++++++++ pages.cn/common/ab.md | 19 +++++++++++++ pages.cn/common/abduco.md | 23 +++++++++++++++ pages.cn/common/ack.md | 19 +++++++++++++ pages.cn/common/adb.md | 31 ++++++++++++++++++++ pages.cn/common/ag.md | 31 ++++++++++++++++++++ pages.cn/common/airpaste.md | 23 +++++++++++++++ pages.cn/common/alias.md | 28 ++++++++++++++++++ pages.cn/common/ansible-galaxy.md | 23 +++++++++++++++ pages.cn/common/ansible-playbook.md | 19 +++++++++++++ pages.cn/common/ansible.md | 28 ++++++++++++++++++ pages.cn/common/ansiweather.md | 15 ++++++++++ pages.cn/common/apg.md | 23 +++++++++++++++ pages.cn/common/apm.md | 16 +++++++++++ pages.cn/common/apropos.md | 11 ++++++++ pages.cn/common/ar.md | 23 +++++++++++++++ pages.cn/common/aria2c.md | 28 ++++++++++++++++++ pages.cn/common/arp.md | 19 +++++++++++++ pages.cn/common/asar.md | 19 +++++++++++++ pages.cn/common/asciinema.md | 35 +++++++++++++++++++++++ pages.cn/common/assimp.md | 32 +++++++++++++++++++++ pages.cn/common/astyle.md | 24 ++++++++++++++++ pages.cn/common/at.md | 16 +++++++++++ pages.cn/common/atom.md | 24 ++++++++++++++++ pages.cn/common/atq.md | 15 ++++++++++ pages.cn/common/atrm.md | 12 ++++++++ pages.cn/common/autoflake.md | 19 +++++++++++++ pages.cn/common/autojump.md | 24 ++++++++++++++++ pages.cn/common/autossh.md | 28 ++++++++++++++++++ pages.cn/common/avrdude.md | 19 +++++++++++++ pages.cn/common/awk.md | 27 ++++++++++++++++++ pages.cn/common/aws-s3.md | 27 ++++++++++++++++++ pages.cn/common/aws.md | 23 +++++++++++++++ pages.cn/common/axel.md | 24 ++++++++++++++++ pages.cn/common/az.md | 27 ++++++++++++++++++ pages.cn/common/b2sum.md | 19 +++++++++++++ pages.cn/common/babel.md | 35 +++++++++++++++++++++++ pages.cn/common/badblocks.md | 16 +++++++++++ pages.cn/common/banner.md | 15 ++++++++++ pages.cn/common/base32.md | 19 +++++++++++++ pages.cn/common/base64.md | 19 +++++++++++++ pages.cn/common/basename.md | 11 ++++++++ pages.cn/common/bash.md | 28 ++++++++++++++++++ pages.cn/common/bashmarks.md | 23 +++++++++++++++ pages.cn/common/bat.md | 28 ++++++++++++++++++ pages.cn/common/batch.md | 16 +++++++++++ pages.cn/common/bc.md | 19 +++++++++++++ pages.cn/common/beanstalkd.md | 19 +++++++++++++ pages.cn/common/bedtools.md | 28 ++++++++++++++++++ pages.cn/common/berks.md | 19 +++++++++++++ pages.cn/common/bg.md | 11 ++++++++ pages.cn/common/blender.md | 32 +++++++++++++++++++++ pages.cn/common/bmaptool.md | 19 +++++++++++++ pages.cn/common/boot.md | 27 ++++++++++++++++++ pages.cn/common/borg.md | 32 +++++++++++++++++++++ pages.cn/common/bosh.md | 35 +++++++++++++++++++++++ pages.cn/common/bower.md | 32 +++++++++++++++++++++ pages.cn/common/box.md | 31 ++++++++++++++++++++ pages.cn/common/browser-sync.md | 19 +++++++++++++ pages.cn/common/bundle.md | 19 +++++++++++++ pages.cn/common/bup.md | 23 +++++++++++++++ pages.cn/common/bw.md | 23 +++++++++++++++ pages.cn/common/c99.md | 19 +++++++++++++ pages.cn/common/cabal.md | 28 ++++++++++++++++++ pages.cn/common/calibre-server.md | 17 +++++++++++ pages.cn/common/calibredb.md | 24 ++++++++++++++++ pages.cn/common/cargo.md | 32 +++++++++++++++++++++ pages.cn/common/case.md | 11 ++++++++ pages.cn/common/cat.md | 19 +++++++++++++ pages.cn/common/cd.md | 19 +++++++++++++ pages.cn/common/chgrp.md | 19 +++++++++++++ pages.cn/common/chmod.md | 27 ++++++++++++++++++ pages.cn/common/chown.md | 23 +++++++++++++++ pages.cn/common/chromium.md | 27 ++++++++++++++++++ pages.cn/common/chroot.md | 11 ++++++++ pages.cn/common/chsh.md | 7 +++++ pages.cn/common/cksum.md | 8 ++++++ pages.cn/common/clang.md | 19 +++++++++++++ pages.cn/common/clear.md | 7 +++++ pages.cn/common/cloc.md | 15 ++++++++++ pages.cn/common/cmake.md | 16 +++++++++++ pages.cn/common/cmark.md | 19 +++++++++++++ pages.cn/common/cmp.md | 11 ++++++++ pages.cn/common/code.md | 23 +++++++++++++++ pages.cn/common/coffee.md | 23 +++++++++++++++ pages.cn/common/column.md | 20 +++++++++++++ pages.cn/common/comm.md | 23 +++++++++++++++ pages.cn/common/complete.md | 15 ++++++++++ pages.cn/common/composer.md | 23 +++++++++++++++ pages.cn/common/conda.md | 35 +++++++++++++++++++++++ pages.cn/common/consul-kv.md | 15 ++++++++++ pages.cn/common/consul.md | 15 ++++++++++ pages.cn/common/convert.md | 23 +++++++++++++++ pages.cn/common/convmv.md | 11 ++++++++ pages.cn/common/cordova.md | 27 ++++++++++++++++++ pages.cn/common/couchdb.md | 23 +++++++++++++++ pages.cn/common/cowsay.md | 19 +++++++++++++ pages.cn/common/cp.md | 27 ++++++++++++++++++ pages.cn/common/cpio.md | 16 +++++++++++ pages.cn/common/cppcheck.md | 32 +++++++++++++++++++++ pages.cn/common/cppclean.md | 19 +++++++++++++ pages.cn/common/cradle-deploy.md | 19 +++++++++++++ pages.cn/common/cradle-elastic.md | 27 ++++++++++++++++++ pages.cn/common/cradle-install.md | 23 +++++++++++++++ pages.cn/common/cradle-package.md | 31 ++++++++++++++++++++ pages.cn/common/cradle-sql.md | 27 ++++++++++++++++++ pages.cn/common/cradle.md | 20 +++++++++++++ pages.cn/common/crontab.md | 28 ++++++++++++++++++ pages.cn/common/crystal.md | 23 +++++++++++++++ pages.cn/common/csc.md | 35 +++++++++++++++++++++++ pages.cn/common/csslint.md | 27 ++++++++++++++++++ pages.cn/common/csvclean.md | 12 ++++++++ pages.cn/common/csvcut.md | 20 +++++++++++++ pages.cn/common/csvformat.md | 24 ++++++++++++++++ pages.cn/common/csvgrep.md | 16 +++++++++++ pages.cn/common/csvlook.md | 8 ++++++ pages.cn/common/csvpy.md | 12 ++++++++ pages.cn/common/csvsort.md | 20 +++++++++++++ pages.cn/common/csvstat.md | 24 ++++++++++++++++ pages.cn/common/ctest.md | 15 ++++++++++ pages.cn/common/curl.md | 36 ++++++++++++++++++++++++ pages.cn/common/cut.md | 27 ++++++++++++++++++ pages.cn/common/darkhttpd.md | 15 ++++++++++ pages.cn/common/date.md | 19 +++++++++++++ pages.cn/common/dc.md | 23 +++++++++++++++ pages.cn/common/dd.md | 23 +++++++++++++++ pages.cn/common/decaffeinate.md | 19 +++++++++++++ pages.cn/common/deluser.md | 15 ++++++++++ pages.cn/common/dep.md | 23 +++++++++++++++ pages.cn/common/detox.md | 16 +++++++++++ pages.cn/common/df.md | 15 ++++++++++ pages.cn/common/dhcpwn.md | 11 ++++++++ pages.cn/common/diff.md | 27 ++++++++++++++++++ pages.cn/common/diffstat.md | 11 ++++++++ pages.cn/common/dig.md | 31 ++++++++++++++++++++ pages.cn/common/dircolors.md | 23 +++++++++++++++ pages.cn/common/dirname.md | 15 ++++++++++ pages.cn/common/dirs.md | 20 +++++++++++++ pages.cn/common/dive.md | 11 ++++++++ pages.cn/common/docker-compose.md | 27 ++++++++++++++++++ pages.cn/common/docker-machine.md | 27 ++++++++++++++++++ pages.cn/common/docker.md | 35 +++++++++++++++++++++++ pages.cn/common/dokku.md | 24 ++++++++++++++++ pages.cn/common/dot.md | 11 ++++++++ pages.cn/common/dotnet.md | 19 +++++++++++++ pages.cn/common/doxygen.md | 15 ++++++++++ pages.cn/common/drill.md | 31 ++++++++++++++++++++ pages.cn/common/drush.md | 27 ++++++++++++++++++ pages.cn/common/du.md | 27 ++++++++++++++++++ pages.cn/common/duplicity.md | 28 ++++++++++++++++++ pages.cn/common/ebook-convert.md | 8 ++++++ pages.cn/common/echo.md | 19 +++++++++++++ pages.cn/common/ed.md | 35 +++++++++++++++++++++++ pages.cn/common/electrum.md | 31 ++++++++++++++++++++ pages.cn/common/elinks.md | 15 ++++++++++ pages.cn/common/elm.md | 15 ++++++++++ pages.cn/common/emacs.md | 15 ++++++++++ pages.cn/common/emacsclient.md | 15 ++++++++++ pages.cn/common/ember.md | 36 ++++++++++++++++++++++++ pages.cn/common/enca.md | 19 +++++++++++++ pages.cn/common/enscript.md | 23 +++++++++++++++ pages.cn/common/env.md | 23 +++++++++++++++ pages.cn/common/erl.md | 15 ++++++++++ pages.cn/common/eslint.md | 19 +++++++++++++ pages.cn/common/espeak.md | 19 +++++++++++++ pages.cn/common/exa.md | 27 ++++++++++++++++++ pages.cn/common/exiftool.md | 23 +++++++++++++++ pages.cn/common/expand.md | 23 +++++++++++++++ pages.cn/common/expr.md | 23 +++++++++++++++ pages.cn/common/factor.md | 11 ++++++++ pages.cn/common/false.md | 7 +++++ pages.cn/common/fastboot.md | 27 ++++++++++++++++++ pages.cn/common/fd.md | 23 +++++++++++++++ pages.cn/common/fdupes.md | 19 +++++++++++++ pages.cn/common/ffmpeg.md | 35 +++++++++++++++++++++++ pages.cn/common/ffprobe.md | 23 +++++++++++++++ pages.cn/common/fg.md | 11 ++++++++ pages.cn/common/find.md | 39 ++++++++++++++++++++++++++ pages.cn/common/finger.md | 23 +++++++++++++++ pages.cn/common/fish.md | 24 ++++++++++++++++ pages.cn/common/fisher.md | 32 +++++++++++++++++++++ pages.cn/common/fkill.md | 11 ++++++++ pages.cn/common/flac.md | 19 +++++++++++++ pages.cn/common/flex.md | 16 +++++++++++ pages.cn/common/flutter.md | 23 +++++++++++++++ pages.cn/common/fly.md | 35 +++++++++++++++++++++++ pages.cn/common/fold.md | 15 ++++++++++ pages.cn/common/for.md | 11 ++++++++ pages.cn/common/forever.md | 15 ++++++++++ pages.cn/common/fortune.md | 27 ++++++++++++++++++ pages.cn/common/fping.md | 15 ++++++++++ pages.cn/common/fswatch.md | 19 +++++++++++++ pages.cn/common/fswebcam.md | 19 +++++++++++++ pages.cn/common/ftp.md | 31 ++++++++++++++++++++ pages.cn/common/fuck.md | 11 ++++++++ pages.cn/common/fzf.md | 27 ++++++++++++++++++ pages.cn/common/g++.md | 20 +++++++++++++ pages.cn/common/gatsby.md | 23 +++++++++++++++ pages.cn/common/gcal.md | 23 +++++++++++++++ pages.cn/common/gcc.md | 23 +++++++++++++++ pages.cn/common/gcloud.md | 31 ++++++++++++++++++++ pages.cn/common/gdb.md | 19 +++++++++++++ pages.cn/common/gdrive.md | 20 +++++++++++++ pages.cn/common/gem.md | 23 +++++++++++++++ pages.cn/common/geth.md | 19 +++++++++++++ pages.cn/common/ghc.md | 28 ++++++++++++++++++ pages.cn/common/gibo.md | 23 +++++++++++++++ pages.cn/common/gifsicle.md | 19 +++++++++++++ pages.cn/common/gist.md | 31 ++++++++++++++++++++ pages.cn/common/git-add.md | 23 +++++++++++++++ pages.cn/common/git-am.md | 16 +++++++++++ pages.cn/common/git-bisect.md | 20 +++++++++++++ pages.cn/common/git-blame.md | 11 ++++++++ pages.cn/common/git-branch.md | 27 ++++++++++++++++++ pages.cn/common/git-checkout.md | 31 ++++++++++++++++++++ pages.cn/common/git-cherry-pick.md | 16 +++++++++++ pages.cn/common/git-clean.md | 27 ++++++++++++++++++ pages.cn/common/git-clone.md | 23 +++++++++++++++ pages.cn/common/git-commit.md | 15 ++++++++++ pages.cn/common/git-config.md | 28 ++++++++++++++++++ pages.cn/common/git-diff.md | 39 ++++++++++++++++++++++++++ pages.cn/common/git-fetch.md | 23 +++++++++++++++ pages.cn/common/git-format-patch.md | 16 +++++++++++ pages.cn/common/git-gc.md | 23 +++++++++++++++ pages.cn/common/git-imerge.md | 28 ++++++++++++++++++ pages.cn/common/git-init.md | 11 ++++++++ pages.cn/common/git-log.md | 31 ++++++++++++++++++++ pages.cn/common/git-merge.md | 19 +++++++++++++ pages.cn/common/git-mv.md | 15 ++++++++++ pages.cn/common/git-pull.md | 15 ++++++++++ pages.cn/common/git-push.md | 31 ++++++++++++++++++++ pages.cn/common/git-rebase.md | 28 ++++++++++++++++++ pages.cn/common/git-reflog.md | 11 ++++++++ pages.cn/common/git-remote.md | 23 +++++++++++++++ pages.cn/common/git-reset.md | 32 +++++++++++++++++++++ pages.cn/common/git-rm.md | 15 ++++++++++ pages.cn/common/git-shortlog.md | 19 +++++++++++++ pages.cn/common/git-show.md | 23 +++++++++++++++ pages.cn/common/git-sizer.md | 15 ++++++++++ pages.cn/common/git-stash.md | 35 +++++++++++++++++++++++ pages.cn/common/git-status.md | 11 ++++++++ pages.cn/common/git-submodule.md | 19 +++++++++++++ pages.cn/common/git-svn.md | 23 +++++++++++++++ pages.cn/common/git-tag.md | 32 +++++++++++++++++++++ pages.cn/common/git-worktree.md | 19 +++++++++++++ pages.cn/common/git.md | 19 +++++++++++++ pages.cn/common/gitk.md | 23 +++++++++++++++ pages.cn/common/gitsome.md | 28 ++++++++++++++++++ pages.cn/common/glances.md | 23 +++++++++++++++ pages.cn/common/gnomon.md | 23 +++++++++++++++ pages.cn/common/gnuplot.md | 19 +++++++++++++ pages.cn/common/go.md | 27 ++++++++++++++++++ pages.cn/common/gocryptfs.md | 23 +++++++++++++++ pages.cn/common/godoc.md | 23 +++++++++++++++ pages.cn/common/godot.md | 23 +++++++++++++++ pages.cn/common/gofmt.md | 19 +++++++++++++ pages.cn/common/gource.md | 28 ++++++++++++++++++ pages.cn/common/gpg-zip.md | 15 ++++++++++ pages.cn/common/gpg.md | 31 ++++++++++++++++++++ pages.cn/common/gradle.md | 23 +++++++++++++++ pages.cn/common/grep.md | 36 ++++++++++++++++++++++++ pages.cn/common/groff.md | 24 ++++++++++++++++ pages.cn/common/groups.md | 15 ++++++++++ pages.cn/common/grunt.md | 31 ++++++++++++++++++++ pages.cn/common/gtop.md | 15 ++++++++++ pages.cn/common/guetzli.md | 15 ++++++++++ pages.cn/common/guile.md | 19 +++++++++++++ pages.cn/common/gulp.md | 12 ++++++++ pages.cn/common/gunzip.md | 15 ++++++++++ pages.cn/common/gzip.md | 23 +++++++++++++++ pages.cn/common/handbrakecli.md | 19 +++++++++++++ pages.cn/common/hangups.md | 15 ++++++++++ pages.cn/common/haxelib.md | 19 +++++++++++++ pages.cn/common/head.md | 19 +++++++++++++ pages.cn/common/helm.md | 35 +++++++++++++++++++++++ pages.cn/common/help2man.md | 23 +++++++++++++++ pages.cn/common/heroku.md | 27 ++++++++++++++++++ pages.cn/common/hg-add.md | 23 +++++++++++++++ pages.cn/common/hg-branch.md | 11 ++++++++ pages.cn/common/hg-clone.md | 23 +++++++++++++++ pages.cn/common/hg-commit.md | 27 ++++++++++++++++++ pages.cn/common/hg-init.md | 11 ++++++++ pages.cn/common/hg-log.md | 35 +++++++++++++++++++++++ pages.cn/common/hg-pull.md | 31 ++++++++++++++++++++ pages.cn/common/hg-push.md | 27 ++++++++++++++++++ pages.cn/common/hg-remove.md | 23 +++++++++++++++ pages.cn/common/hg-serve.md | 27 ++++++++++++++++++ pages.cn/common/hg-update.md | 19 +++++++++++++ pages.cn/common/hg.md | 20 +++++++++++++ pages.cn/common/history.md | 15 ++++++++++ pages.cn/common/hn.md | 19 +++++++++++++ pages.cn/common/host.md | 19 +++++++++++++ pages.cn/common/hostess.md | 19 +++++++++++++ pages.cn/common/hostid.md | 7 +++++ pages.cn/common/hr.md | 15 ++++++++++ pages.cn/common/htpasswd.md | 23 +++++++++++++++ pages.cn/common/http.md | 31 ++++++++++++++++++++ pages.cn/common/hub.md | 24 ++++++++++++++++ pages.cn/common/hugo.md | 31 ++++++++++++++++++++ pages.cn/common/hyperfine.md | 27 ++++++++++++++++++ pages.cn/common/iconv.md | 15 ++++++++++ pages.cn/common/id.md | 11 ++++++++ pages.cn/common/id3tag.md | 15 ++++++++++ pages.cn/common/if.md | 11 ++++++++ pages.cn/common/ifconfig.md | 23 +++++++++++++++ pages.cn/common/ignite.md | 19 +++++++++++++ pages.cn/common/imapsync.md | 7 +++++ pages.cn/common/import.md | 16 +++++++++++ pages.cn/common/in2csv.md | 20 +++++++++++++ pages.cn/common/inkscape.md | 28 ++++++++++++++++++ pages.cn/common/install.md | 24 ++++++++++++++++ pages.cn/common/ionic.md | 27 ++++++++++++++++++ pages.cn/common/ionice.md | 17 +++++++++++ pages.cn/common/ioping.md | 19 +++++++++++++ pages.cn/common/ipcs.md | 11 ++++++++ pages.cn/common/iperf.md | 15 ++++++++++ pages.cn/common/iperf3.md | 23 +++++++++++++++ pages.cn/common/ipfs.md | 32 +++++++++++++++++++++ pages.cn/common/irssi.md | 27 ++++++++++++++++++ pages.cn/common/jar.md | 15 ++++++++++ pages.cn/common/java.md | 15 ++++++++++ pages.cn/common/javac.md | 19 +++++++++++++ pages.cn/common/jekyll.md | 15 ++++++++++ pages.cn/common/jest.md | 23 +++++++++++++++ pages.cn/common/jhat.md | 15 ++++++++++ pages.cn/common/jmap.md | 19 +++++++++++++ pages.cn/common/jobs.md | 19 +++++++++++++ pages.cn/common/join.md | 15 ++++++++++ pages.cn/common/jpegoptim.md | 19 +++++++++++++ pages.cn/common/jps.md | 23 +++++++++++++++ pages.cn/common/jq.md | 27 ++++++++++++++++++ pages.cn/common/jrnl.md | 23 +++++++++++++++ pages.cn/common/json5.md | 27 ++++++++++++++++++ pages.cn/common/jstack.md | 15 ++++++++++ pages.cn/common/julia.md | 27 ++++++++++++++++++ pages.cn/common/jupyter.md | 28 ++++++++++++++++++ pages.cn/common/k6.md | 27 ++++++++++++++++++ pages.cn/common/kafkacat.md | 35 +++++++++++++++++++++++ pages.cn/common/kak.md | 36 ++++++++++++++++++++++++ pages.cn/common/keepass2.md | 15 ++++++++++ pages.cn/common/keybase.md | 31 ++++++++++++++++++++ pages.cn/common/kill.md | 28 ++++++++++++++++++ pages.cn/common/killall.md | 24 ++++++++++++++++ pages.cn/common/knife.md | 31 ++++++++++++++++++++ pages.cn/common/kompose.md | 15 ++++++++++ pages.cn/common/kube-fzf.md | 28 ++++++++++++++++++ pages.cn/common/kubeadm.md | 31 ++++++++++++++++++++ pages.cn/common/kubectl.md | 31 ++++++++++++++++++++ pages.cn/common/kubectx.md | 19 +++++++++++++ pages.cn/common/kubens.md | 15 ++++++++++ pages.cn/common/kubetail.md | 19 +++++++++++++ pages.cn/common/laravel.md | 19 +++++++++++++ pages.cn/common/last.md | 27 ++++++++++++++++++ pages.cn/common/latexmk.md | 28 ++++++++++++++++++ pages.cn/common/leave.md | 20 +++++++++++++ pages.cn/common/lebab.md | 24 ++++++++++++++++ pages.cn/common/lein.md | 23 +++++++++++++++ pages.cn/common/less.md | 35 +++++++++++++++++++++++ pages.cn/common/lex.md | 16 +++++++++++ pages.cn/common/license.md | 19 +++++++++++++ pages.cn/common/light-arionum-cli.md | 35 +++++++++++++++++++++++ pages.cn/common/link.md | 8 ++++++ pages.cn/common/live-server.md | 19 +++++++++++++ pages.cn/common/ln.md | 15 ++++++++++ pages.cn/common/loc.md | 19 +++++++++++++ pages.cn/common/locust.md | 27 ++++++++++++++++++ pages.cn/common/logname.md | 7 +++++ pages.cn/common/logstash.md | 16 +++++++++++ pages.cn/common/lolcat.md | 19 +++++++++++++ pages.cn/common/lorem.md | 19 +++++++++++++ pages.cn/common/lp.md | 23 +++++++++++++++ pages.cn/common/lpass.md | 23 +++++++++++++++ pages.cn/common/lpstat.md | 19 +++++++++++++ pages.cn/common/ls.md | 27 ++++++++++++++++++ pages.cn/common/lsof.md | 32 +++++++++++++++++++++ pages.cn/common/lua.md | 15 ++++++++++ pages.cn/common/luac.md | 11 ++++++++ pages.cn/common/lumen.md | 11 ++++++++ pages.cn/common/lwp-request.md | 28 ++++++++++++++++++ pages.cn/common/lz4.md | 27 ++++++++++++++++++ pages.cn/common/m4.md | 11 ++++++++ pages.cn/common/magento.md | 35 +++++++++++++++++++++++ pages.cn/common/mailx.md | 27 ++++++++++++++++++ pages.cn/common/make.md | 28 ++++++++++++++++++ pages.cn/common/makensis.md | 16 +++++++++++ pages.cn/common/man.md | 23 +++++++++++++++ pages.cn/common/mc.md | 8 ++++++ pages.cn/common/md5sum.md | 15 ++++++++++ pages.cn/common/mdp.md | 19 +++++++++++++ pages.cn/common/mediainfo.md | 15 ++++++++++ pages.cn/common/meshlabserver.md | 23 +++++++++++++++ pages.cn/common/meteor.md | 27 ++++++++++++++++++ pages.cn/common/micro.md | 28 ++++++++++++++++++ pages.cn/common/minetest.md | 20 +++++++++++++ pages.cn/common/minetestserver.md | 36 ++++++++++++++++++++++++ pages.cn/common/minikube.md | 19 +++++++++++++ pages.cn/common/mitmdump.md | 16 +++++++++++ pages.cn/common/mitmproxy.md | 11 ++++++++ pages.cn/common/mix.md | 23 +++++++++++++++ pages.cn/common/mkdir.md | 11 ++++++++ pages.cn/common/mkfifo.md | 7 +++++ pages.cn/common/mktemp.md | 15 ++++++++++ pages.cn/common/mlr.md | 27 ++++++++++++++++++ pages.cn/common/mmv.md | 19 +++++++++++++ pages.cn/common/mocha.md | 23 +++++++++++++++ pages.cn/common/mogrify.md | 24 ++++++++++++++++ pages.cn/common/mongo.md | 19 +++++++++++++ pages.cn/common/mongod.md | 15 ++++++++++ pages.cn/common/mongodump.md | 27 ++++++++++++++++++ pages.cn/common/mongorestore.md | 19 +++++++++++++ pages.cn/common/monodis.md | 31 ++++++++++++++++++++ pages.cn/common/monop.md | 31 ++++++++++++++++++++ pages.cn/common/montage.md | 24 ++++++++++++++++ pages.cn/common/more.md | 19 +++++++++++++ pages.cn/common/moro.md | 31 ++++++++++++++++++++ pages.cn/common/mosh.md | 28 ++++++++++++++++++ pages.cn/common/most.md | 35 +++++++++++++++++++++++ pages.cn/common/mount.md | 23 +++++++++++++++ pages.cn/common/mp4box.md | 15 ++++++++++ pages.cn/common/mpc.md | 28 ++++++++++++++++++ pages.cn/common/mpv.md | 27 ++++++++++++++++++ pages.cn/common/mr.md | 19 +++++++++++++ pages.cn/common/msbuild.md | 31 ++++++++++++++++++++ pages.cn/common/msmtp.md | 16 +++++++++++ pages.cn/common/mtr.md | 23 +++++++++++++++ pages.cn/common/mutool.md | 23 +++++++++++++++ pages.cn/common/mutt.md | 23 +++++++++++++++ pages.cn/common/mv.md | 23 +++++++++++++++ pages.cn/common/mvn.md | 36 ++++++++++++++++++++++++ pages.cn/common/mysql.md | 23 +++++++++++++++ pages.cn/common/mysqldump.md | 11 ++++++++ pages.cn/common/nano.md | 15 ++++++++++ pages.cn/common/nasm.md | 23 +++++++++++++++ pages.cn/common/nc.md | 39 ++++++++++++++++++++++++++ pages.cn/common/ncmpcpp.md | 19 +++++++++++++ pages.cn/common/neofetch.md | 19 +++++++++++++ pages.cn/common/ng.md | 35 +++++++++++++++++++++++ pages.cn/common/nginx.md | 23 +++++++++++++++ pages.cn/common/ngrep.md | 23 +++++++++++++++ pages.cn/common/nice.md | 8 ++++++ pages.cn/common/nikto.md | 23 +++++++++++++++ pages.cn/common/nim.md | 24 ++++++++++++++++ pages.cn/common/nimble.md | 28 ++++++++++++++++++ pages.cn/common/nix-collect-garbage.md | 16 +++++++++++ pages.cn/common/nix-env.md | 27 ++++++++++++++++++ pages.cn/common/nl.md | 23 +++++++++++++++ pages.cn/common/nmap.md | 32 +++++++++++++++++++++ pages.cn/common/node.md | 15 ++++++++++ pages.cn/common/nohup.md | 7 +++++ pages.cn/common/nokogiri.md | 23 +++++++++++++++ pages.cn/common/noti.md | 15 ++++++++++ pages.cn/common/npm-check.md | 19 +++++++++++++ pages.cn/common/npm.md | 36 ++++++++++++++++++++++++ pages.cn/common/nproc.md | 15 ++++++++++ pages.cn/common/npx.md | 15 ++++++++++ pages.cn/common/nrm.md | 24 ++++++++++++++++ pages.cn/common/nslookup.md | 31 ++++++++++++++++++++ pages.cn/common/numfmt.md | 15 ++++++++++ pages.cn/common/nvim.md | 36 ++++++++++++++++++++++++ pages.cn/common/nvm.md | 28 ++++++++++++++++++ pages.cn/common/objdump.md | 15 ++++++++++ pages.cn/common/od.md | 28 ++++++++++++++++++ pages.cn/common/odps-auth.md | 31 ++++++++++++++++++++ pages.cn/common/odps-func.md | 19 +++++++++++++ pages.cn/common/odps-inst.md | 23 +++++++++++++++ pages.cn/common/odps-resource.md | 27 ++++++++++++++++++ pages.cn/common/odps-table.md | 23 +++++++++++++++ pages.cn/common/odps-tunnel.md | 19 +++++++++++++ pages.cn/common/odps.md | 27 ++++++++++++++++++ pages.cn/common/omf.md | 28 ++++++++++++++++++ pages.cn/common/openssl.md | 31 ++++++++++++++++++++ pages.cn/common/opt.md | 15 ++++++++++ pages.cn/common/optipng.md | 27 ++++++++++++++++++ pages.cn/common/p4.md | 35 +++++++++++++++++++++++ pages.cn/common/p5.md | 19 +++++++++++++ pages.cn/common/paci.md | 23 +++++++++++++++ pages.cn/common/pandoc.md | 23 +++++++++++++++ pages.cn/common/parallel.md | 27 ++++++++++++++++++ pages.cn/common/pass.md | 28 ++++++++++++++++++ pages.cn/common/passwd.md | 19 +++++++++++++ pages.cn/common/paste.md | 23 +++++++++++++++ pages.cn/common/patch.md | 16 +++++++++++ pages.cn/common/pdfjoin.md | 15 ++++++++++ pages.cn/common/pdflatex.md | 11 ++++++++ pages.cn/common/pdfposter.md | 11 ++++++++ pages.cn/common/pdftk.md | 23 +++++++++++++++ pages.cn/common/pdftotext.md | 19 +++++++++++++ pages.cn/common/pdfunite.md | 11 ++++++++ pages.cn/common/peerflix.md | 23 +++++++++++++++ pages.cn/common/perl.md | 31 ++++++++++++++++++++ pages.cn/common/pg_ctl.md | 19 +++++++++++++ pages.cn/common/pg_dump.md | 19 +++++++++++++ pages.cn/common/pg_restore.md | 23 +++++++++++++++ pages.cn/common/pgrep.md | 15 ++++++++++ pages.cn/common/phing.md | 35 +++++++++++++++++++++++ pages.cn/common/phive.md | 35 +++++++++++++++++++++++ pages.cn/common/php-artisan.md | 19 +++++++++++++ pages.cn/common/php-yii.md | 15 ++++++++++ pages.cn/common/php.md | 23 +++++++++++++++ pages.cn/common/phpcpd.md | 27 ++++++++++++++++++ pages.cn/common/phpcs.md | 35 +++++++++++++++++++++++ pages.cn/common/phpize.md | 11 ++++++++ pages.cn/common/phploc.md | 31 ++++++++++++++++++++ pages.cn/common/phpmd.md | 31 ++++++++++++++++++++ pages.cn/common/phpstan.md | 27 ++++++++++++++++++ pages.cn/common/phpunit.md | 19 +++++++++++++ pages.cn/common/picard.md | 15 ++++++++++ pages.cn/common/pigz.md | 23 +++++++++++++++ pages.cn/common/ping.md | 27 ++++++++++++++++++ pages.cn/common/ping6.md | 23 +++++++++++++++ pages.cn/common/pinky.md | 27 ++++++++++++++++++ pages.cn/common/pip.md | 27 ++++++++++++++++++ pages.cn/common/pipenv.md | 32 +++++++++++++++++++++ pages.cn/common/pkill.md | 16 +++++++++++ pages.cn/common/play.md | 20 +++++++++++++ pages.cn/common/pm2.md | 24 ++++++++++++++++ pages.cn/common/pngcrush.md | 15 ++++++++++ pages.cn/common/postcss.md | 35 +++++++++++++++++++++++ pages.cn/common/printenv.md | 15 ++++++++++ pages.cn/common/printf.md | 23 +++++++++++++++ pages.cn/common/progpilot.md | 15 ++++++++++ pages.cn/common/prosodyctl.md | 23 +++++++++++++++ pages.cn/common/protoc.md | 15 ++++++++++ pages.cn/common/ps.md | 27 ++++++++++++++++++ pages.cn/common/psgrep.md | 15 ++++++++++ pages.cn/common/psql.md | 23 +++++++++++++++ pages.cn/common/pssh.md | 27 ++++++++++++++++++ pages.cn/common/pt.md | 24 ++++++++++++++++ pages.cn/common/pup.md | 27 ++++++++++++++++++ pages.cn/common/pv.md | 27 ++++++++++++++++++ pages.cn/common/pwd.md | 11 ++++++++ pages.cn/common/pycodestyle.md | 23 +++++++++++++++ pages.cn/common/pyenv-virtualenv.md | 11 ++++++++ pages.cn/common/pyenv.md | 27 ++++++++++++++++++ pages.cn/common/pyflakes.md | 19 +++++++++++++ pages.cn/common/pygmentize.md | 27 ++++++++++++++++++ pages.cn/common/python.md | 27 ++++++++++++++++++ pages.cn/common/q.md | 27 ++++++++++++++++++ pages.cn/common/qemu-img.md | 19 +++++++++++++ pages.cn/common/qemu.md | 24 ++++++++++++++++ pages.cn/common/qpdf.md | 23 +++++++++++++++ pages.cn/common/quota.md | 23 +++++++++++++++ pages.cn/common/r.md | 15 ++++++++++ pages.cn/common/rabin2.md | 24 ++++++++++++++++ pages.cn/common/rails.md | 23 +++++++++++++++ pages.cn/common/rainbowstream.md | 32 +++++++++++++++++++++ pages.cn/common/rbash.md | 20 +++++++++++++ pages.cn/common/rbenv.md | 31 ++++++++++++++++++++ pages.cn/common/rdfind.md | 19 +++++++++++++ pages.cn/common/read.md | 27 ++++++++++++++++++ pages.cn/common/readlink.md | 11 ++++++++ pages.cn/common/realpath.md | 23 +++++++++++++++ pages.cn/common/redis-cli.md | 23 +++++++++++++++ pages.cn/common/redshift.md | 23 +++++++++++++++ pages.cn/common/rename.md | 23 +++++++++++++++ pages.cn/common/renice.md | 15 ++++++++++ pages.cn/common/repren.md | 23 +++++++++++++++ pages.cn/common/restic.md | 27 ++++++++++++++++++ pages.cn/common/rev.md | 11 ++++++++ pages.cn/common/rg.md | 31 ++++++++++++++++++++ pages.cn/common/rm.md | 23 +++++++++++++++ pages.cn/common/rmdir.md | 11 ++++++++ pages.cn/common/roll.md | 27 ++++++++++++++++++ pages.cn/common/route.md | 15 ++++++++++ pages.cn/common/rsstail.md | 23 +++++++++++++++ pages.cn/common/rsync.md | 32 +++++++++++++++++++++ pages.cn/common/rtv.md | 28 ++++++++++++++++++ pages.cn/common/ruby.md | 23 +++++++++++++++ pages.cn/common/rustc.md | 16 +++++++++++ pages.cn/common/rustfmt.md | 15 ++++++++++ pages.cn/common/rustup.md | 28 ++++++++++++++++++ pages.cn/common/rvm.md | 31 ++++++++++++++++++++ pages.cn/common/s.md | 19 +++++++++++++ pages.cn/common/sails.md | 23 +++++++++++++++ pages.cn/common/salt-call.md | 19 +++++++++++++ pages.cn/common/salt-key.md | 20 +++++++++++++ pages.cn/common/salt-run.md | 11 ++++++++ pages.cn/common/salt.md | 19 +++++++++++++ pages.cn/common/samtools.md | 36 ++++++++++++++++++++++++ pages.cn/common/sass.md | 19 +++++++++++++ pages.cn/common/sc-im.md | 28 ++++++++++++++++++ pages.cn/common/scala.md | 19 +++++++++++++ pages.cn/common/scheme.md | 23 +++++++++++++++ pages.cn/common/scp.md | 28 ++++++++++++++++++ pages.cn/common/scrapy.md | 31 ++++++++++++++++++++ pages.cn/common/screen.md | 31 ++++++++++++++++++++ pages.cn/common/screenfetch.md | 23 +++++++++++++++ pages.cn/common/script.md | 23 +++++++++++++++ pages.cn/common/sdk.md | 28 ++++++++++++++++++ pages.cn/common/sed.md | 35 +++++++++++++++++++++++ pages.cn/common/sendmail.md | 15 ++++++++++ pages.cn/common/seq.md | 19 +++++++++++++ pages.cn/common/serverless.md | 28 ++++++++++++++++++ pages.cn/common/set.md | 19 +++++++++++++ pages.cn/common/sftp.md | 33 ++++++++++++++++++++++ pages.cn/common/sh.md | 20 +++++++++++++ pages.cn/common/sha1sum.md | 15 ++++++++++ pages.cn/common/sha224sum.md | 15 ++++++++++ pages.cn/common/sha256sum.md | 15 ++++++++++ pages.cn/common/sha384sum.md | 15 ++++++++++ pages.cn/common/sha512sum.md | 15 ++++++++++ pages.cn/common/shards.md | 23 +++++++++++++++ pages.cn/common/shc.md | 19 +++++++++++++ pages.cn/common/shellcheck.md | 19 +++++++++++++ pages.cn/common/shopt.md | 24 ++++++++++++++++ pages.cn/common/shred.md | 19 +++++++++++++ pages.cn/common/shuf.md | 19 +++++++++++++ pages.cn/common/singularity.md | 27 ++++++++++++++++++ pages.cn/common/skicka.md | 27 ++++++++++++++++++ pages.cn/common/sl.md | 23 +++++++++++++++ pages.cn/common/slackcat.md | 19 +++++++++++++ pages.cn/common/sleep.md | 15 ++++++++++ pages.cn/common/slimrb.md | 15 ++++++++++ pages.cn/common/smartctl.md | 24 ++++++++++++++++ pages.cn/common/socat.md | 15 ++++++++++ pages.cn/common/sort.md | 31 ++++++++++++++++++++ pages.cn/common/source.md | 7 +++++ pages.cn/common/sox.md | 28 ++++++++++++++++++ pages.cn/common/spatial.md | 35 +++++++++++++++++++++++ pages.cn/common/speedtest-cli.md | 19 +++++++++++++ pages.cn/common/spike.md | 19 +++++++++++++ pages.cn/common/split.md | 19 +++++++++++++ pages.cn/common/sqlite3.md | 15 ++++++++++ pages.cn/common/sqlmap.md | 23 +++++++++++++++ pages.cn/common/sqsc.md | 31 ++++++++++++++++++++ pages.cn/common/srm.md | 20 +++++++++++++ pages.cn/common/ssh-copy-id.md | 15 ++++++++++ pages.cn/common/ssh-keygen.md | 31 ++++++++++++++++++++ pages.cn/common/ssh.md | 36 ++++++++++++++++++++++++ pages.cn/common/sshfs.md | 23 +++++++++++++++ pages.cn/common/sshpass.md | 16 +++++++++++ pages.cn/common/st-flash.md | 15 ++++++++++ pages.cn/common/st-info.md | 15 ++++++++++ pages.cn/common/st-util.md | 15 ++++++++++ pages.cn/common/stack.md | 31 ++++++++++++++++++++ pages.cn/common/standard.md | 31 ++++++++++++++++++++ pages.cn/common/stat.md | 27 ++++++++++++++++++ pages.cn/common/stdbuf.md | 15 ++++++++++ pages.cn/common/stolonctl.md | 19 +++++++++++++ pages.cn/common/stow.md | 24 ++++++++++++++++ pages.cn/common/strings.md | 19 +++++++++++++ pages.cn/common/stty.md | 23 +++++++++++++++ pages.cn/common/su.md | 15 ++++++++++ pages.cn/common/subfinder.md | 24 ++++++++++++++++ pages.cn/common/subl.md | 19 +++++++++++++ pages.cn/common/subliminal.md | 7 +++++ pages.cn/common/sudo.md | 23 +++++++++++++++ pages.cn/common/sum.md | 12 ++++++++ pages.cn/common/supervisorctl.md | 24 ++++++++++++++++ pages.cn/common/supervisord.md | 12 ++++++++ pages.cn/common/surge.md | 19 +++++++++++++ pages.cn/common/svgcleaner.md | 11 ++++++++ pages.cn/common/svgo.md | 36 ++++++++++++++++++++++++ pages.cn/common/svn.md | 27 ++++++++++++++++++ pages.cn/common/swagger-codegen.md | 19 +++++++++++++ pages.cn/common/swift.md | 27 ++++++++++++++++++ pages.cn/common/sync.md | 11 ++++++++ pages.cn/common/tabula.md | 27 ++++++++++++++++++ pages.cn/common/tac.md | 11 ++++++++ pages.cn/common/tail.md | 23 +++++++++++++++ pages.cn/common/tar.md | 36 ++++++++++++++++++++++++ pages.cn/common/task.md | 23 +++++++++++++++ pages.cn/common/tb.md | 27 ++++++++++++++++++ pages.cn/common/tcpdump.md | 35 +++++++++++++++++++++++ pages.cn/common/tee.md | 19 +++++++++++++ pages.cn/common/telnet.md | 23 +++++++++++++++ pages.cn/common/terraform.md | 19 +++++++++++++ pages.cn/common/tesseract.md | 23 +++++++++++++++ pages.cn/common/test.md | 24 ++++++++++++++++ pages.cn/common/tig.md | 27 ++++++++++++++++++ pages.cn/common/time.md | 7 +++++ pages.cn/common/timeout.md | 11 ++++++++ pages.cn/common/timew.md | 23 +++++++++++++++ pages.cn/common/tldr.md | 7 +++++ pages.cn/common/tldrl.md | 15 ++++++++++ pages.cn/common/tmux.md | 35 +++++++++++++++++++++++ pages.cn/common/tokei.md | 19 +++++++++++++ pages.cn/common/touch.md | 15 ++++++++++ pages.cn/common/tox.md | 24 ++++++++++++++++ pages.cn/common/tpp.md | 11 ++++++++ pages.cn/common/tput.md | 27 ++++++++++++++++++ pages.cn/common/tr.md | 27 ++++++++++++++++++ pages.cn/common/traceroute.md | 23 +++++++++++++++ pages.cn/common/traefik.md | 19 +++++++++++++ pages.cn/common/trans.md | 23 +++++++++++++++ pages.cn/common/transcode.md | 15 ++++++++++ pages.cn/common/trash-cli.md | 23 +++++++++++++++ pages.cn/common/true.md | 8 ++++++ pages.cn/common/truncate.md | 15 ++++++++++ pages.cn/common/tslint.md | 19 +++++++++++++ pages.cn/common/tsort.md | 8 ++++++ pages.cn/common/tty.md | 7 +++++ pages.cn/common/ufraw-batch.md | 19 +++++++++++++ pages.cn/common/umount.md | 16 +++++++++++ pages.cn/common/uname.md | 20 +++++++++++++ pages.cn/common/unar.md | 23 +++++++++++++++ pages.cn/common/unexpand.md | 23 +++++++++++++++ pages.cn/common/uniq.md | 24 ++++++++++++++++ pages.cn/common/unlink.md | 8 ++++++ pages.cn/common/unrar.md | 19 +++++++++++++ pages.cn/common/unzip.md | 23 +++++++++++++++ pages.cn/common/uptime.md | 19 +++++++++++++ pages.cn/common/upx.md | 15 ++++++++++ pages.cn/common/users.md | 11 ++++++++ pages.cn/common/vagrant.md | 23 +++++++++++++++ pages.cn/common/valgrind.md | 20 +++++++++++++ pages.cn/common/vault.md | 27 ++++++++++++++++++ pages.cn/common/vcsh.md | 27 ++++++++++++++++++ pages.cn/common/vegeta.md | 28 ++++++++++++++++++ pages.cn/common/view.md | 8 ++++++ pages.cn/common/vim.md | 36 ++++++++++++++++++++++++ pages.cn/common/vimdiff.md | 16 +++++++++++ pages.cn/common/vimtutor.md | 11 ++++++++ pages.cn/common/virtualenv.md | 19 +++++++++++++ pages.cn/common/visudo.md | 11 ++++++++ pages.cn/common/vsce.md | 23 +++++++++++++++ pages.cn/common/vue.md | 16 +++++++++++ pages.cn/common/w.md | 12 ++++++++ pages.cn/common/w3m.md | 11 ++++++++ pages.cn/common/wait.md | 11 ++++++++ pages.cn/common/waitress-serve.md | 27 ++++++++++++++++++ pages.cn/common/wasm-objdump.md | 19 +++++++++++++ pages.cn/common/wasm-opt.md | 19 +++++++++++++ pages.cn/common/wasm2c.md | 11 ++++++++ pages.cn/common/wasm2wat.md | 11 ++++++++ pages.cn/common/wat2wasm.md | 15 ++++++++++ pages.cn/common/watch.md | 15 ++++++++++ pages.cn/common/wc.md | 19 +++++++++++++ pages.cn/common/weasyprint.md | 23 +++++++++++++++ pages.cn/common/webpack.md | 19 +++++++++++++ pages.cn/common/wget.md | 36 ++++++++++++++++++++++++ pages.cn/common/where.md | 8 ++++++ pages.cn/common/which.md | 11 ++++++++ pages.cn/common/while.md | 11 ++++++++ pages.cn/common/who.md | 19 +++++++++++++ pages.cn/common/whoami.md | 11 ++++++++ pages.cn/common/wordgrinder.md | 15 ++++++++++ pages.cn/common/wpa_supplicant.md | 11 ++++++++ pages.cn/common/wuzz.md | 23 +++++++++++++++ pages.cn/common/x_x.md | 15 ++++++++++ pages.cn/common/xargs.md | 16 +++++++++++ pages.cn/common/xcv.md | 19 +++++++++++++ pages.cn/common/xmllint.md | 27 ++++++++++++++++++ pages.cn/common/xo.md | 23 +++++++++++++++ pages.cn/common/xsv.md | 27 ++++++++++++++++++ pages.cn/common/xxd.md | 27 ++++++++++++++++++ pages.cn/common/xz.md | 27 ++++++++++++++++++ pages.cn/common/yarn.md | 27 ++++++++++++++++++ pages.cn/common/yes.md | 11 ++++++++ pages.cn/common/yesod.md | 24 ++++++++++++++++ pages.cn/common/youtube-dl.md | 23 +++++++++++++++ pages.cn/common/z.md | 27 ++++++++++++++++++ pages.cn/common/zbarimg.md | 7 +++++ pages.cn/common/zcat.md | 7 +++++ pages.cn/common/zdb.md | 15 ++++++++++ pages.cn/common/zfs.md | 27 ++++++++++++++++++ pages.cn/common/zip.md | 35 +++++++++++++++++++++++ pages.cn/common/zless.md | 7 +++++ pages.cn/common/zopflipng.md | 11 ++++++++ pages.cn/common/zpool.md | 31 ++++++++++++++++++++ pages.cn/common/zsh.md | 20 +++++++++++++ pages.cn/common/zstd.md | 23 +++++++++++++++ pages.cn/linux/add-apt-repository.md | 19 +++++++++++++ pages.cn/linux/adduser.md | 23 +++++++++++++++ pages.cn/linux/alpine.md | 16 +++++++++++ pages.cn/linux/apache2ctl.md | 24 ++++++++++++++++ pages.cn/linux/apk.md | 27 ++++++++++++++++++ pages.cn/linux/apt-cache.md | 23 +++++++++++++++ pages.cn/linux/apt-file.md | 15 ++++++++++ pages.cn/linux/apt-get.md | 28 ++++++++++++++++++ pages.cn/linux/apt-key.md | 23 +++++++++++++++ pages.cn/linux/apt-mark.md | 23 +++++++++++++++ pages.cn/linux/apt.md | 27 ++++++++++++++++++ pages.cn/linux/aptitude.md | 27 ++++++++++++++++++ pages.cn/linux/arch.md | 8 ++++++ pages.cn/linux/archey.md | 7 +++++ pages.cn/linux/arp-scan.md | 19 +++++++++++++ pages.cn/linux/as.md | 20 +++++++++++++ pages.cn/linux/aspell.md | 23 +++++++++++++++ pages.cn/linux/at.md | 15 ++++++++++ pages.cn/linux/authconfig.md | 35 +++++++++++++++++++++++ pages.cn/linux/autorandr.md | 19 +++++++++++++ pages.cn/linux/beep.md | 23 +++++++++++++++ pages.cn/linux/bmon.md | 19 +++++++++++++ pages.cn/linux/brew.md | 35 +++++++++++++++++++++++ pages.cn/linux/bzip2.md | 15 ++++++++++ pages.cn/linux/cal.md | 23 +++++++++++++++ pages.cn/linux/calc.md | 11 ++++++++ pages.cn/linux/certbot.md | 28 ++++++++++++++++++ pages.cn/linux/chage.md | 23 +++++++++++++++ pages.cn/linux/chattr.md | 15 ++++++++++ pages.cn/linux/chkconfig.md | 27 ++++++++++++++++++ pages.cn/linux/cmus.md | 24 ++++++++++++++++ pages.cn/linux/command.md | 7 +++++ pages.cn/linux/compgen.md | 23 +++++++++++++++ pages.cn/linux/compose.md | 12 ++++++++ pages.cn/linux/conky.md | 27 ++++++++++++++++++ pages.cn/linux/cpufreq-aperf.md | 20 +++++++++++++ pages.cn/linux/cpufreq-info.md | 31 ++++++++++++++++++++ pages.cn/linux/cpufreq-set.md | 20 +++++++++++++ pages.cn/linux/cpuid.md | 15 ++++++++++ pages.cn/linux/cryptsetup.md | 19 +++++++++++++ pages.cn/linux/csplit.md | 24 ++++++++++++++++ pages.cn/linux/dash.md | 20 +++++++++++++ pages.cn/linux/datamash.md | 19 +++++++++++++ pages.cn/linux/dbus-daemon.md | 27 ++++++++++++++++++ pages.cn/linux/diff3.md | 11 ++++++++ pages.cn/linux/disown.md | 16 +++++++++++ pages.cn/linux/dmesg.md | 23 +++++++++++++++ pages.cn/linux/dmidecode.md | 28 ++++++++++++++++++ pages.cn/linux/dnf.md | 19 +++++++++++++ pages.cn/linux/dpkg-query.md | 19 +++++++++++++ pages.cn/linux/dpkg.md | 27 ++++++++++++++++++ pages.cn/linux/ebuild.md | 35 +++++++++++++++++++++++ pages.cn/linux/edit.md | 12 ++++++++ pages.cn/linux/edquota.md | 28 ++++++++++++++++++ pages.cn/linux/eject.md | 31 ++++++++++++++++++++ pages.cn/linux/emerge.md | 31 ++++++++++++++++++++ pages.cn/linux/entr.md | 19 +++++++++++++ pages.cn/linux/envsubst.md | 20 +++++++++++++ pages.cn/linux/equery.md | 23 +++++++++++++++ pages.cn/linux/eval.md | 11 ++++++++ pages.cn/linux/export.md | 19 +++++++++++++ pages.cn/linux/eyeD3.md | 19 +++++++++++++ pages.cn/linux/f5fpc.md | 23 +++++++++++++++ pages.cn/linux/fallocate.md | 16 +++++++++++ pages.cn/linux/fatlabel.md | 11 ++++++++ pages.cn/linux/fc-list.md | 7 +++++ pages.cn/linux/fc-match.md | 7 +++++ pages.cn/linux/fc-pattern.md | 7 +++++ pages.cn/linux/fc.md | 15 ++++++++++ pages.cn/linux/fdisk.md | 11 ++++++++ pages.cn/linux/feh.md | 27 ++++++++++++++++++ pages.cn/linux/figlet.md | 19 +++++++++++++ pages.cn/linux/file.md | 23 +++++++++++++++ pages.cn/linux/findmnt.md | 23 +++++++++++++++ pages.cn/linux/firejail.md | 27 ++++++++++++++++++ pages.cn/linux/firewall-cmd.md | 23 +++++++++++++++ pages.cn/linux/flatpak.md | 27 ++++++++++++++++++ pages.cn/linux/foreman.md | 27 ++++++++++++++++++ pages.cn/linux/free.md | 19 +++++++++++++ pages.cn/linux/fsck.md | 15 ++++++++++ pages.cn/linux/fuser.md | 8 ++++++ pages.cn/linux/genkernel.md | 23 +++++++++++++++ pages.cn/linux/getent.md | 23 +++++++++++++++ pages.cn/linux/getfacl.md | 15 ++++++++++ pages.cn/linux/gnome-terminal.md | 19 +++++++++++++ pages.cn/linux/gpasswd.md | 23 +++++++++++++++ pages.cn/linux/groupadd.md | 11 ++++++++ pages.cn/linux/groupdel.md | 7 +++++ pages.cn/linux/groupmod.md | 11 ++++++++ pages.cn/linux/gs.md | 27 ++++++++++++++++++ pages.cn/linux/guix-package.md | 27 ++++++++++++++++++ pages.cn/linux/gunicorn.md | 27 ++++++++++++++++++ pages.cn/linux/halt.md | 11 ++++++++ pages.cn/linux/hardinfo.md | 15 ++++++++++ pages.cn/linux/hexdump.md | 15 ++++++++++ pages.cn/linux/hostname.md | 23 +++++++++++++++ pages.cn/linux/hostnamectl.md | 11 ++++++++ pages.cn/linux/htop.md | 15 ++++++++++ pages.cn/linux/http-prompt.md | 15 ++++++++++ pages.cn/linux/httpie.md | 31 ++++++++++++++++++++ pages.cn/linux/hwclock.md | 15 ++++++++++ pages.cn/linux/i7z.md | 7 +++++ pages.cn/linux/ifdown.md | 11 ++++++++ pages.cn/linux/ifup.md | 11 ++++++++ pages.cn/linux/imgp.md | 15 ++++++++++ pages.cn/linux/inxi.md | 11 ++++++++ pages.cn/linux/iostat.md | 27 ++++++++++++++++++ pages.cn/linux/ip.md | 27 ++++++++++++++++++ pages.cn/linux/ipcalc.md | 23 +++++++++++++++ pages.cn/linux/iptables.md | 31 ++++++++++++++++++++ pages.cn/linux/isoinfo.md | 15 ++++++++++ pages.cn/linux/iw.md | 19 +++++++++++++ pages.cn/linux/jobs.md | 27 ++++++++++++++++++ pages.cn/linux/journalctl.md | 27 ++++++++++++++++++ pages.cn/linux/kexec.md | 19 +++++++++++++ pages.cn/linux/lastlog.md | 19 +++++++++++++ pages.cn/linux/ldconfig.md | 15 ++++++++++ pages.cn/linux/ldd.md | 11 ++++++++ pages.cn/linux/light.md | 19 +++++++++++++ pages.cn/linux/lldb.md | 15 ++++++++++ pages.cn/linux/locate.md | 15 ++++++++++ pages.cn/linux/logger.md | 23 +++++++++++++++ pages.cn/linux/logwatch.md | 11 ++++++++ pages.cn/linux/losetup.md | 19 +++++++++++++ pages.cn/linux/lrunzip.md | 24 ++++++++++++++++ pages.cn/linux/lrzip.md | 28 ++++++++++++++++++ pages.cn/linux/lrztar.md | 24 ++++++++++++++++ pages.cn/linux/lrzuntar.md | 24 ++++++++++++++++ pages.cn/linux/lsattr.md | 23 +++++++++++++++ pages.cn/linux/lsb_release.md | 19 +++++++++++++ pages.cn/linux/lsblk.md | 27 ++++++++++++++++++ pages.cn/linux/lscpu.md | 15 ++++++++++ pages.cn/linux/lshw.md | 19 +++++++++++++ pages.cn/linux/lsmod.md | 8 ++++++ pages.cn/linux/lspci.md | 23 +++++++++++++++ pages.cn/linux/lsscsi.md | 15 ++++++++++ pages.cn/linux/lsusb.md | 23 +++++++++++++++ pages.cn/linux/ltrace.md | 19 +++++++++++++ pages.cn/linux/lvcreate.md | 20 +++++++++++++ pages.cn/linux/lxc.md | 32 +++++++++++++++++++++ pages.cn/linux/mdadm.md | 27 ++++++++++++++++++ pages.cn/linux/microcom.md | 11 ++++++++ pages.cn/linux/mke2fs.md | 15 ++++++++++ pages.cn/linux/mkfs.cramfs.md | 11 ++++++++ pages.cn/linux/mkfs.exfat.md | 15 ++++++++++ pages.cn/linux/mkfs.fat.md | 19 +++++++++++++ pages.cn/linux/mkfs.minix.md | 7 +++++ pages.cn/linux/mkfs.ntfs.md | 15 ++++++++++ pages.cn/linux/mkfs.vfat.md | 19 +++++++++++++ pages.cn/linux/mkisofs.md | 12 ++++++++ pages.cn/linux/mknod.md | 19 +++++++++++++ pages.cn/linux/mkswap.md | 19 +++++++++++++ pages.cn/linux/modinfo.md | 11 ++++++++ pages.cn/linux/modprobe.md | 23 +++++++++++++++ pages.cn/linux/mpstat.md | 15 ++++++++++ pages.cn/linux/mycli.md | 15 ++++++++++ pages.cn/linux/n.md | 23 +++++++++++++++ pages.cn/linux/namei.md | 24 ++++++++++++++++ pages.cn/linux/ncat.md | 15 ++++++++++ pages.cn/linux/ncdu.md | 19 +++++++++++++ pages.cn/linux/ndctl.md | 31 ++++++++++++++++++++ pages.cn/linux/nethogs.md | 19 +++++++++++++ pages.cn/linux/netstat.md | 35 +++++++++++++++++++++++ pages.cn/linux/nft.md | 32 +++++++++++++++++++++ pages.cn/linux/nm.md | 19 +++++++++++++ pages.cn/linux/nmcli.md | 27 ++++++++++++++++++ pages.cn/linux/nmon.md | 15 ++++++++++ pages.cn/linux/nmtui.md | 24 ++++++++++++++++ pages.cn/linux/notify-send.md | 15 ++++++++++ pages.cn/linux/ntfsfix.md | 7 +++++ pages.cn/linux/opkg.md | 31 ++++++++++++++++++++ pages.cn/linux/pacaur.md | 27 ++++++++++++++++++ pages.cn/linux/pacman.md | 35 +++++++++++++++++++++++ pages.cn/linux/pamac.md | 23 +++++++++++++++ pages.cn/linux/pasuspender.md | 7 +++++ pages.cn/linux/pdfgrep.md | 23 +++++++++++++++ pages.cn/linux/perf.md | 19 +++++++++++++ pages.cn/linux/phar.md | 35 +++++++++++++++++++++++ pages.cn/linux/pkgadd.md | 11 ++++++++ pages.cn/linux/pkginfo.md | 19 +++++++++++++ pages.cn/linux/pkgmk.md | 27 ++++++++++++++++++ pages.cn/linux/pkgrm.md | 7 +++++ pages.cn/linux/playerctl.md | 27 ++++++++++++++++++ pages.cn/linux/popd.md | 15 ++++++++++ pages.cn/linux/ports.md | 15 ++++++++++ pages.cn/linux/poweroff.md | 7 +++++ pages.cn/linux/print.md | 12 ++++++++ pages.cn/linux/prt-get.md | 31 ++++++++++++++++++++ pages.cn/linux/pstree.md | 15 ++++++++++ pages.cn/linux/pulseaudio.md | 23 +++++++++++++++ pages.cn/linux/pushd.md | 16 +++++++++++ pages.cn/linux/pvcreate.md | 11 ++++++++ pages.cn/linux/pwgen.md | 15 ++++++++++ pages.cn/linux/qsub.md | 19 +++++++++++++ pages.cn/linux/quotacheck.md | 28 ++++++++++++++++++ pages.cn/linux/rdesktop.md | 28 ++++++++++++++++++ pages.cn/linux/reboot.md | 11 ++++++++ pages.cn/linux/reflector.md | 15 ++++++++++ pages.cn/linux/repquota.md | 27 ++++++++++++++++++ pages.cn/linux/reset.md | 11 ++++++++ pages.cn/linux/rfkill.md | 23 +++++++++++++++ pages.cn/linux/rofi.md | 15 ++++++++++ pages.cn/linux/rpcinfo.md | 23 +++++++++++++++ pages.cn/linux/rpm.md | 27 ++++++++++++++++++ pages.cn/linux/rspamc.md | 19 +++++++++++++ pages.cn/linux/rtcwake.md | 27 ++++++++++++++++++ pages.cn/linux/rtorrent.md | 19 +++++++++++++ pages.cn/linux/run-mailcap.md | 24 ++++++++++++++++ pages.cn/linux/runit.md | 11 ++++++++ pages.cn/linux/runsv.md | 11 ++++++++ pages.cn/linux/runsvchdir.md | 7 +++++ pages.cn/linux/runsvdir.md | 15 ++++++++++ pages.cn/linux/sar.md | 27 ++++++++++++++++++ pages.cn/linux/sbatch.md | 19 +++++++++++++ pages.cn/linux/see.md | 12 ++++++++ pages.cn/linux/sensible-browser.md | 11 ++++++++ pages.cn/linux/service.md | 20 +++++++++++++ pages.cn/linux/setfacl.md | 19 +++++++++++++ pages.cn/linux/shasum.md | 23 +++++++++++++++ pages.cn/linux/shutdown.md | 23 +++++++++++++++ pages.cn/linux/sinfo.md | 23 +++++++++++++++ pages.cn/linux/slapt-get.md | 28 ++++++++++++++++++ pages.cn/linux/sm.md | 27 ++++++++++++++++++ pages.cn/linux/smbclient.md | 23 +++++++++++++++ pages.cn/linux/snap.md | 28 ++++++++++++++++++ pages.cn/linux/snapper.md | 27 ++++++++++++++++++ pages.cn/linux/squeue.md | 19 +++++++++++++ pages.cn/linux/ss.md | 27 ++++++++++++++++++ pages.cn/linux/ssh-add.md | 24 ++++++++++++++++ pages.cn/linux/sshuttle.md | 16 +++++++++++ pages.cn/linux/strace.md | 27 ++++++++++++++++++ pages.cn/linux/sv.md | 15 ++++++++++ pages.cn/linux/swapoff.md | 19 +++++++++++++ pages.cn/linux/swapon.md | 23 +++++++++++++++ pages.cn/linux/sysctl.md | 23 +++++++++++++++ pages.cn/linux/systemctl.md | 27 ++++++++++++++++++ pages.cn/linux/systemd-analyze.md | 11 ++++++++ pages.cn/linux/tcpflow.md | 7 +++++ pages.cn/linux/tcpkill.md | 7 +++++ pages.cn/linux/terminator.md | 23 +++++++++++++++ pages.cn/linux/thunar.md | 15 ++++++++++ pages.cn/linux/timedatectl.md | 23 +++++++++++++++ pages.cn/linux/tomb.md | 31 ++++++++++++++++++++ pages.cn/linux/top.md | 23 +++++++++++++++ pages.cn/linux/trap.md | 20 +++++++++++++ pages.cn/linux/tree.md | 31 ++++++++++++++++++++ pages.cn/linux/trizen.md | 27 ++++++++++++++++++ pages.cn/linux/ufw.md | 36 ++++++++++++++++++++++++ pages.cn/linux/ulimit.md | 19 +++++++++++++ pages.cn/linux/umask.md | 19 +++++++++++++ pages.cn/linux/units.md | 24 ++++++++++++++++ pages.cn/linux/unset.md | 11 ++++++++ pages.cn/linux/update-alternatives.md | 23 +++++++++++++++ pages.cn/linux/update-rc.d.md | 20 +++++++++++++ pages.cn/linux/updatedb.md | 12 ++++++++ pages.cn/linux/useradd.md | 23 +++++++++++++++ pages.cn/linux/userdel.md | 7 +++++ pages.cn/linux/usermod.md | 15 ++++++++++ pages.cn/linux/vgcreate.md | 11 ++++++++ pages.cn/linux/viewnior.md | 15 ++++++++++ pages.cn/linux/vncserver.md | 15 ++++++++++ pages.cn/linux/vncviewer.md | 19 +++++++++++++ pages.cn/linux/wall.md | 15 ++++++++++ pages.cn/linux/watch.md | 15 ++++++++++ pages.cn/linux/whatis.md | 19 +++++++++++++ pages.cn/linux/whereis.md | 19 +++++++++++++ pages.cn/linux/wodim.md | 20 +++++++++++++ pages.cn/linux/wpa_cli.md | 27 ++++++++++++++++++ pages.cn/linux/write.md | 16 +++++++++++ pages.cn/linux/x11vnc.md | 24 ++++++++++++++++ pages.cn/linux/xar.md | 15 ++++++++++ pages.cn/linux/xbps.md | 23 +++++++++++++++ pages.cn/linux/xclip.md | 32 +++++++++++++++++++++ pages.cn/linux/xdotool.md | 27 ++++++++++++++++++ pages.cn/linux/xeyes.md | 11 ++++++++ pages.cn/linux/xfce4-terminal.md | 27 ++++++++++++++++++ pages.cn/linux/xinput.md | 15 ++++++++++ pages.cn/linux/xman.md | 15 ++++++++++ pages.cn/linux/xrandr.md | 23 +++++++++++++++ pages.cn/linux/xsel.md | 27 ++++++++++++++++++ pages.cn/linux/xsetwacom.md | 23 +++++++++++++++ pages.cn/linux/xtrlock.md | 15 ++++++++++ pages.cn/linux/yank.md | 19 +++++++++++++ pages.cn/linux/yaourt.md | 23 +++++++++++++++ pages.cn/linux/yay.md | 28 ++++++++++++++++++ pages.cn/linux/yum.md | 27 ++++++++++++++++++ pages.cn/linux/zenity.md | 24 ++++++++++++++++ pages.cn/linux/zramctl.md | 20 +++++++++++++ pages.cn/linux/zypper.md | 23 +++++++++++++++ pages.cn/osx/airport.md | 19 +++++++++++++ pages.cn/osx/apachectl.md | 15 ++++++++++ pages.cn/osx/archey.md | 19 +++++++++++++ pages.cn/osx/as.md | 20 +++++++++++++ pages.cn/osx/asr.md | 20 +++++++++++++ pages.cn/osx/base64.md | 19 +++++++++++++ pages.cn/osx/brew-cask.md | 35 +++++++++++++++++++++++ pages.cn/osx/brew-mas.md | 27 ++++++++++++++++++ pages.cn/osx/brew.md | 35 +++++++++++++++++++++++ pages.cn/osx/brightness.md | 15 ++++++++++ pages.cn/osx/caffeinate.md | 15 ++++++++++ pages.cn/osx/cal.md | 27 ++++++++++++++++++ pages.cn/osx/carthage.md | 23 +++++++++++++++ pages.cn/osx/codesign.md | 11 ++++++++ pages.cn/osx/command.md | 7 +++++ pages.cn/osx/compgen.md | 23 +++++++++++++++ pages.cn/osx/date.md | 19 +++++++++++++ pages.cn/osx/dd.md | 19 +++++++++++++ pages.cn/osx/defaults.md | 23 +++++++++++++++ pages.cn/osx/diskutil.md | 19 +++++++++++++ pages.cn/osx/ditto.md | 15 ++++++++++ pages.cn/osx/dmesg.md | 15 ++++++++++ pages.cn/osx/drutil.md | 11 ++++++++ pages.cn/osx/du.md | 27 ++++++++++++++++++ pages.cn/osx/duti.md | 27 ++++++++++++++++++ pages.cn/osx/eval.md | 11 ++++++++ pages.cn/osx/export.md | 15 ++++++++++ pages.cn/osx/fc.md | 15 ++++++++++ pages.cn/osx/feh.md | 27 ++++++++++++++++++ pages.cn/osx/file.md | 23 +++++++++++++++ pages.cn/osx/fsck.md | 20 +++++++++++++ pages.cn/osx/gunicorn.md | 27 ++++++++++++++++++ pages.cn/osx/head.md | 11 ++++++++ pages.cn/osx/hexdump.md | 15 ++++++++++ pages.cn/osx/hostname.md | 11 ++++++++ pages.cn/osx/imgcat.md | 8 ++++++ pages.cn/osx/launchctl.md | 32 +++++++++++++++++++++ pages.cn/osx/lldb.md | 15 ++++++++++ pages.cn/osx/locate.md | 15 ++++++++++ pages.cn/osx/logger.md | 23 +++++++++++++++ pages.cn/osx/look.md | 11 ++++++++ pages.cn/osx/m.md | 23 +++++++++++++++ pages.cn/osx/md5.md | 19 +++++++++++++ pages.cn/osx/mdfind.md | 15 ++++++++++ pages.cn/osx/mdutil.md | 15 ++++++++++ pages.cn/osx/mkfile.md | 15 ++++++++++ pages.cn/osx/n.md | 23 +++++++++++++++ pages.cn/osx/netstat.md | 27 ++++++++++++++++++ pages.cn/osx/networksetup.md | 19 +++++++++++++ pages.cn/osx/nm.md | 19 +++++++++++++ pages.cn/osx/oathtool.md | 15 ++++++++++ pages.cn/osx/open.md | 27 ++++++++++++++++++ pages.cn/osx/opensnoop.md | 19 +++++++++++++ pages.cn/osx/osascript.md | 27 ++++++++++++++++++ pages.cn/osx/pbcopy.md | 11 ++++++++ pages.cn/osx/pbpaste.md | 11 ++++++++ pages.cn/osx/pdfgrep.md | 23 +++++++++++++++ pages.cn/osx/pmset.md | 28 ++++++++++++++++++ pages.cn/osx/pod.md | 31 ++++++++++++++++++++ pages.cn/osx/popd.md | 15 ++++++++++ pages.cn/osx/port.md | 27 ++++++++++++++++++ pages.cn/osx/pushd.md | 16 +++++++++++ pages.cn/osx/pwgen.md | 15 ++++++++++ pages.cn/osx/qlmanage.md | 15 ++++++++++ pages.cn/osx/route.md | 28 ++++++++++++++++++ pages.cn/osx/rubocop.md | 31 ++++++++++++++++++++ pages.cn/osx/runit.md | 11 ++++++++ pages.cn/osx/runsv.md | 11 ++++++++ pages.cn/osx/runsvchdir.md | 7 +++++ pages.cn/osx/runsvdir.md | 15 ++++++++++ pages.cn/osx/say.md | 23 +++++++++++++++ pages.cn/osx/scutil.md | 28 ++++++++++++++++++ pages.cn/osx/sed.md | 31 ++++++++++++++++++++ pages.cn/osx/shasum.md | 23 +++++++++++++++ pages.cn/osx/shuf.md | 19 +++++++++++++ pages.cn/osx/shutdown.md | 19 +++++++++++++ pages.cn/osx/sips.md | 28 ++++++++++++++++++ pages.cn/osx/softwareupdate.md | 19 +++++++++++++ pages.cn/osx/split.md | 15 ++++++++++ pages.cn/osx/ssh-add.md | 28 ++++++++++++++++++ pages.cn/osx/sshuttle.md | 16 +++++++++++ pages.cn/osx/stat.md | 23 +++++++++++++++ pages.cn/osx/stty.md | 23 +++++++++++++++ pages.cn/osx/sv.md | 15 ++++++++++ pages.cn/osx/sw_vers.md | 11 ++++++++ pages.cn/osx/sysctl.md | 23 +++++++++++++++ pages.cn/osx/system_profiler.md | 15 ++++++++++ pages.cn/osx/systemsetup.md | 23 +++++++++++++++ pages.cn/osx/top.md | 23 +++++++++++++++ pages.cn/osx/trap.md | 20 +++++++++++++ pages.cn/osx/tree.md | 31 ++++++++++++++++++++ pages.cn/osx/uname.md | 20 +++++++++++++ pages.cn/osx/units.md | 27 ++++++++++++++++++ pages.cn/osx/w.md | 16 +++++++++++ pages.cn/osx/wacaw.md | 23 +++++++++++++++ pages.cn/osx/whereis.md | 7 +++++ pages.cn/osx/xattr.md | 23 +++++++++++++++ pages.cn/osx/xcodebuild.md | 15 ++++++++++ pages.cn/osx/xctool.md | 15 ++++++++++ pages.cn/osx/xed.md | 15 ++++++++++ pages.cn/osx/xsltproc.md | 11 ++++++++ pages.cn/osx/yank.md | 19 +++++++++++++ pages.cn/sunos/devfsadm.md | 15 ++++++++++ pages.cn/sunos/dmesg.md | 15 ++++++++++ pages.cn/sunos/prctl.md | 16 +++++++++++ pages.cn/sunos/prstat.md | 23 +++++++++++++++ pages.cn/sunos/runit.md | 11 ++++++++ pages.cn/sunos/runsv.md | 11 ++++++++ pages.cn/sunos/runsvchdir.md | 7 +++++ pages.cn/sunos/runsvdir.md | 15 ++++++++++ pages.cn/sunos/stty.md | 23 +++++++++++++++ pages.cn/sunos/sv.md | 15 ++++++++++ pages.cn/sunos/svcadm.md | 23 +++++++++++++++ pages.cn/sunos/svccfg.md | 15 ++++++++++ pages.cn/sunos/svcs.md | 23 +++++++++++++++ pages.cn/windows/assoc.md | 15 ++++++++++ pages.cn/windows/attrib.md | 27 ++++++++++++++++++ pages.cn/windows/choco-feature.md | 15 ++++++++++ pages.cn/windows/choco-info.md | 19 +++++++++++++ pages.cn/windows/choco-install.md | 35 +++++++++++++++++++++++ pages.cn/windows/choco-list.md | 27 ++++++++++++++++++ pages.cn/windows/choco-new.md | 23 +++++++++++++++ pages.cn/windows/choco-outdated.md | 19 +++++++++++++ pages.cn/windows/choco-pack.md | 15 ++++++++++ pages.cn/windows/choco-pin.md | 20 +++++++++++++ pages.cn/windows/choco-search.md | 27 ++++++++++++++++++ pages.cn/windows/choco-source.md | 31 ++++++++++++++++++++ pages.cn/windows/choco-uninstall.md | 23 +++++++++++++++ pages.cn/windows/choco-upgrade.md | 31 ++++++++++++++++++++ pages.cn/windows/choco.md | 20 +++++++++++++ pages.cn/windows/clip.md | 11 ++++++++ pages.cn/windows/cls.md | 7 +++++ pages.cn/windows/cmd.md | 35 +++++++++++++++++++++++ pages.cn/windows/color.md | 15 ++++++++++ pages.cn/windows/comp.md | 36 ++++++++++++++++++++++++ pages.cn/windows/del.md | 31 ++++++++++++++++++++ pages.cn/windows/dir.md | 19 +++++++++++++ pages.cn/windows/doskey.md | 31 ++++++++++++++++++++ pages.cn/windows/driverquery.md | 31 ++++++++++++++++++++ pages.cn/windows/eventcreate.md | 20 +++++++++++++ pages.cn/windows/exit.md | 15 ++++++++++ pages.cn/windows/expand.md | 23 +++++++++++++++ pages.cn/windows/find.md | 19 +++++++++++++ pages.cn/windows/findstr.md | 35 +++++++++++++++++++++++ pages.cn/windows/finger.md | 20 +++++++++++++ pages.cn/windows/fondue.md | 15 ++++++++++ pages.cn/windows/forfiles.md | 27 ++++++++++++++++++ pages.cn/windows/ftp.md | 35 +++++++++++++++++++++++ pages.cn/windows/getmac.md | 27 ++++++++++++++++++ pages.cn/windows/ipconfig.md | 23 +++++++++++++++ pages.cn/windows/iscc.md | 16 +++++++++++ pages.cn/windows/logoff.md | 15 ++++++++++ pages.cn/windows/mkdir.md | 11 ++++++++ pages.cn/windows/mklink.md | 19 +++++++++++++ pages.cn/windows/more.md | 31 ++++++++++++++++++++ pages.cn/windows/msg.md | 23 +++++++++++++++ pages.cn/windows/path.md | 19 +++++++++++++ pages.cn/windows/pathping.md | 35 +++++++++++++++++++++++ pages.cn/windows/popd.md | 7 +++++ pages.cn/windows/print.md | 11 ++++++++ pages.cn/windows/pushd.md | 8 ++++++ pages.cn/windows/pwlauncher.md | 11 ++++++++ pages.cn/windows/rdpsign.md | 23 +++++++++++++++ pages.cn/windows/reg-add.md | 23 +++++++++++++++ pages.cn/windows/reg-compare.md | 23 +++++++++++++++ pages.cn/windows/reg-copy.md | 15 ++++++++++ pages.cn/windows/reg-delete.md | 19 +++++++++++++ pages.cn/windows/reg-export.md | 11 ++++++++ pages.cn/windows/reg-flags.md | 19 +++++++++++++ pages.cn/windows/reg-import.md | 7 +++++ pages.cn/windows/reg-load.md | 8 ++++++ pages.cn/windows/reg-query.md | 23 +++++++++++++++ pages.cn/windows/reg-restore.md | 8 ++++++ pages.cn/windows/reg-save.md | 11 ++++++++ pages.cn/windows/reg-unload.md | 7 +++++ pages.cn/windows/reg.md | 16 +++++++++++ pages.cn/windows/repair-bde.md | 35 +++++++++++++++++++++++ pages.cn/windows/rmdir.md | 15 ++++++++++ pages.cn/windows/scoop.md | 35 +++++++++++++++++++++++ pages.cn/windows/set.md | 19 +++++++++++++ pages.cn/windows/sfc.md | 31 ++++++++++++++++++++ pages.cn/windows/shutdown.md | 35 +++++++++++++++++++++++ pages.cn/windows/sigverif.md | 7 +++++ pages.cn/windows/subst.md | 15 ++++++++++ pages.cn/windows/systeminfo.md | 19 +++++++++++++ pages.cn/windows/taskkill.md | 27 ++++++++++++++++++ pages.cn/windows/tasklist.md | 23 +++++++++++++++ pages.cn/windows/title.md | 7 +++++ pages.cn/windows/tree.md | 19 +++++++++++++ pages.cn/windows/type.md | 7 +++++ pages.cn/windows/tzutil.md | 15 ++++++++++ pages.cn/windows/units.md | 23 +++++++++++++++ pages.cn/windows/ver.md | 7 +++++ pages.cn/windows/vol.md | 11 ++++++++ pages.cn/windows/where.md | 20 +++++++++++++ pages.cn/windows/whoami.md | 23 +++++++++++++++ pages.cn/windows/xcopy.md | 35 +++++++++++++++++++++++ 1250 files changed, 26030 insertions(+) create mode 100644 pages.cn/common/7z.md create mode 100644 pages.cn/common/7za.md create mode 100644 pages.cn/common/7zr.md create mode 100644 pages.cn/common/ab.md create mode 100644 pages.cn/common/abduco.md create mode 100644 pages.cn/common/ack.md create mode 100644 pages.cn/common/adb.md create mode 100644 pages.cn/common/ag.md create mode 100644 pages.cn/common/airpaste.md create mode 100644 pages.cn/common/alias.md create mode 100644 pages.cn/common/ansible-galaxy.md create mode 100644 pages.cn/common/ansible-playbook.md create mode 100644 pages.cn/common/ansible.md create mode 100644 pages.cn/common/ansiweather.md create mode 100644 pages.cn/common/apg.md create mode 100644 pages.cn/common/apm.md create mode 100644 pages.cn/common/apropos.md create mode 100644 pages.cn/common/ar.md create mode 100644 pages.cn/common/aria2c.md create mode 100644 pages.cn/common/arp.md create mode 100644 pages.cn/common/asar.md create mode 100644 pages.cn/common/asciinema.md create mode 100644 pages.cn/common/assimp.md create mode 100644 pages.cn/common/astyle.md create mode 100644 pages.cn/common/at.md create mode 100644 pages.cn/common/atom.md create mode 100644 pages.cn/common/atq.md create mode 100644 pages.cn/common/atrm.md create mode 100644 pages.cn/common/autoflake.md create mode 100644 pages.cn/common/autojump.md create mode 100644 pages.cn/common/autossh.md create mode 100644 pages.cn/common/avrdude.md create mode 100644 pages.cn/common/awk.md create mode 100644 pages.cn/common/aws-s3.md create mode 100644 pages.cn/common/aws.md create mode 100644 pages.cn/common/axel.md create mode 100644 pages.cn/common/az.md create mode 100644 pages.cn/common/b2sum.md create mode 100644 pages.cn/common/babel.md create mode 100644 pages.cn/common/badblocks.md create mode 100644 pages.cn/common/banner.md create mode 100644 pages.cn/common/base32.md create mode 100644 pages.cn/common/base64.md create mode 100644 pages.cn/common/basename.md create mode 100644 pages.cn/common/bash.md create mode 100644 pages.cn/common/bashmarks.md create mode 100644 pages.cn/common/bat.md create mode 100644 pages.cn/common/batch.md create mode 100644 pages.cn/common/bc.md create mode 100644 pages.cn/common/beanstalkd.md create mode 100644 pages.cn/common/bedtools.md create mode 100644 pages.cn/common/berks.md create mode 100644 pages.cn/common/bg.md create mode 100644 pages.cn/common/blender.md create mode 100644 pages.cn/common/bmaptool.md create mode 100644 pages.cn/common/boot.md create mode 100644 pages.cn/common/borg.md create mode 100644 pages.cn/common/bosh.md create mode 100644 pages.cn/common/bower.md create mode 100644 pages.cn/common/box.md create mode 100644 pages.cn/common/browser-sync.md create mode 100644 pages.cn/common/bundle.md create mode 100644 pages.cn/common/bup.md create mode 100644 pages.cn/common/bw.md create mode 100644 pages.cn/common/c99.md create mode 100644 pages.cn/common/cabal.md create mode 100644 pages.cn/common/calibre-server.md create mode 100644 pages.cn/common/calibredb.md create mode 100644 pages.cn/common/cargo.md create mode 100644 pages.cn/common/case.md create mode 100644 pages.cn/common/cat.md create mode 100644 pages.cn/common/cd.md create mode 100644 pages.cn/common/chgrp.md create mode 100644 pages.cn/common/chmod.md create mode 100644 pages.cn/common/chown.md create mode 100644 pages.cn/common/chromium.md create mode 100644 pages.cn/common/chroot.md create mode 100644 pages.cn/common/chsh.md create mode 100644 pages.cn/common/cksum.md create mode 100644 pages.cn/common/clang.md create mode 100644 pages.cn/common/clear.md create mode 100644 pages.cn/common/cloc.md create mode 100644 pages.cn/common/cmake.md create mode 100644 pages.cn/common/cmark.md create mode 100644 pages.cn/common/cmp.md create mode 100644 pages.cn/common/code.md create mode 100644 pages.cn/common/coffee.md create mode 100644 pages.cn/common/column.md create mode 100644 pages.cn/common/comm.md create mode 100644 pages.cn/common/complete.md create mode 100644 pages.cn/common/composer.md create mode 100644 pages.cn/common/conda.md create mode 100644 pages.cn/common/consul-kv.md create mode 100644 pages.cn/common/consul.md create mode 100644 pages.cn/common/convert.md create mode 100644 pages.cn/common/convmv.md create mode 100644 pages.cn/common/cordova.md create mode 100644 pages.cn/common/couchdb.md create mode 100644 pages.cn/common/cowsay.md create mode 100644 pages.cn/common/cp.md create mode 100644 pages.cn/common/cpio.md create mode 100644 pages.cn/common/cppcheck.md create mode 100644 pages.cn/common/cppclean.md create mode 100644 pages.cn/common/cradle-deploy.md create mode 100644 pages.cn/common/cradle-elastic.md create mode 100644 pages.cn/common/cradle-install.md create mode 100644 pages.cn/common/cradle-package.md create mode 100644 pages.cn/common/cradle-sql.md create mode 100644 pages.cn/common/cradle.md create mode 100644 pages.cn/common/crontab.md create mode 100644 pages.cn/common/crystal.md create mode 100644 pages.cn/common/csc.md create mode 100644 pages.cn/common/csslint.md create mode 100644 pages.cn/common/csvclean.md create mode 100644 pages.cn/common/csvcut.md create mode 100644 pages.cn/common/csvformat.md create mode 100644 pages.cn/common/csvgrep.md create mode 100644 pages.cn/common/csvlook.md create mode 100644 pages.cn/common/csvpy.md create mode 100644 pages.cn/common/csvsort.md create mode 100644 pages.cn/common/csvstat.md create mode 100644 pages.cn/common/ctest.md create mode 100644 pages.cn/common/curl.md create mode 100644 pages.cn/common/cut.md create mode 100644 pages.cn/common/darkhttpd.md create mode 100644 pages.cn/common/date.md create mode 100644 pages.cn/common/dc.md create mode 100644 pages.cn/common/dd.md create mode 100644 pages.cn/common/decaffeinate.md create mode 100644 pages.cn/common/deluser.md create mode 100644 pages.cn/common/dep.md create mode 100644 pages.cn/common/detox.md create mode 100644 pages.cn/common/df.md create mode 100644 pages.cn/common/dhcpwn.md create mode 100644 pages.cn/common/diff.md create mode 100644 pages.cn/common/diffstat.md create mode 100644 pages.cn/common/dig.md create mode 100644 pages.cn/common/dircolors.md create mode 100644 pages.cn/common/dirname.md create mode 100644 pages.cn/common/dirs.md create mode 100644 pages.cn/common/dive.md create mode 100644 pages.cn/common/docker-compose.md create mode 100644 pages.cn/common/docker-machine.md create mode 100644 pages.cn/common/docker.md create mode 100644 pages.cn/common/dokku.md create mode 100644 pages.cn/common/dot.md create mode 100644 pages.cn/common/dotnet.md create mode 100644 pages.cn/common/doxygen.md create mode 100644 pages.cn/common/drill.md create mode 100644 pages.cn/common/drush.md create mode 100644 pages.cn/common/du.md create mode 100644 pages.cn/common/duplicity.md create mode 100644 pages.cn/common/ebook-convert.md create mode 100644 pages.cn/common/echo.md create mode 100644 pages.cn/common/ed.md create mode 100644 pages.cn/common/electrum.md create mode 100644 pages.cn/common/elinks.md create mode 100644 pages.cn/common/elm.md create mode 100644 pages.cn/common/emacs.md create mode 100644 pages.cn/common/emacsclient.md create mode 100644 pages.cn/common/ember.md create mode 100644 pages.cn/common/enca.md create mode 100644 pages.cn/common/enscript.md create mode 100644 pages.cn/common/env.md create mode 100644 pages.cn/common/erl.md create mode 100644 pages.cn/common/eslint.md create mode 100644 pages.cn/common/espeak.md create mode 100644 pages.cn/common/exa.md create mode 100644 pages.cn/common/exiftool.md create mode 100644 pages.cn/common/expand.md create mode 100644 pages.cn/common/expr.md create mode 100644 pages.cn/common/factor.md create mode 100644 pages.cn/common/false.md create mode 100644 pages.cn/common/fastboot.md create mode 100644 pages.cn/common/fd.md create mode 100644 pages.cn/common/fdupes.md create mode 100644 pages.cn/common/ffmpeg.md create mode 100644 pages.cn/common/ffprobe.md create mode 100644 pages.cn/common/fg.md create mode 100644 pages.cn/common/find.md create mode 100644 pages.cn/common/finger.md create mode 100644 pages.cn/common/fish.md create mode 100644 pages.cn/common/fisher.md create mode 100644 pages.cn/common/fkill.md create mode 100644 pages.cn/common/flac.md create mode 100644 pages.cn/common/flex.md create mode 100644 pages.cn/common/flutter.md create mode 100644 pages.cn/common/fly.md create mode 100644 pages.cn/common/fold.md create mode 100644 pages.cn/common/for.md create mode 100644 pages.cn/common/forever.md create mode 100644 pages.cn/common/fortune.md create mode 100644 pages.cn/common/fping.md create mode 100644 pages.cn/common/fswatch.md create mode 100644 pages.cn/common/fswebcam.md create mode 100644 pages.cn/common/ftp.md create mode 100644 pages.cn/common/fuck.md create mode 100644 pages.cn/common/fzf.md create mode 100644 pages.cn/common/g++.md create mode 100644 pages.cn/common/gatsby.md create mode 100644 pages.cn/common/gcal.md create mode 100644 pages.cn/common/gcc.md create mode 100644 pages.cn/common/gcloud.md create mode 100644 pages.cn/common/gdb.md create mode 100644 pages.cn/common/gdrive.md create mode 100644 pages.cn/common/gem.md create mode 100644 pages.cn/common/geth.md create mode 100644 pages.cn/common/ghc.md create mode 100644 pages.cn/common/gibo.md create mode 100644 pages.cn/common/gifsicle.md create mode 100644 pages.cn/common/gist.md create mode 100644 pages.cn/common/git-add.md create mode 100644 pages.cn/common/git-am.md create mode 100644 pages.cn/common/git-bisect.md create mode 100644 pages.cn/common/git-blame.md create mode 100644 pages.cn/common/git-branch.md create mode 100644 pages.cn/common/git-checkout.md create mode 100644 pages.cn/common/git-cherry-pick.md create mode 100644 pages.cn/common/git-clean.md create mode 100644 pages.cn/common/git-clone.md create mode 100644 pages.cn/common/git-commit.md create mode 100644 pages.cn/common/git-config.md create mode 100644 pages.cn/common/git-diff.md create mode 100644 pages.cn/common/git-fetch.md create mode 100644 pages.cn/common/git-format-patch.md create mode 100644 pages.cn/common/git-gc.md create mode 100644 pages.cn/common/git-imerge.md create mode 100644 pages.cn/common/git-init.md create mode 100644 pages.cn/common/git-log.md create mode 100644 pages.cn/common/git-merge.md create mode 100644 pages.cn/common/git-mv.md create mode 100644 pages.cn/common/git-pull.md create mode 100644 pages.cn/common/git-push.md create mode 100644 pages.cn/common/git-rebase.md create mode 100644 pages.cn/common/git-reflog.md create mode 100644 pages.cn/common/git-remote.md create mode 100644 pages.cn/common/git-reset.md create mode 100644 pages.cn/common/git-rm.md create mode 100644 pages.cn/common/git-shortlog.md create mode 100644 pages.cn/common/git-show.md create mode 100644 pages.cn/common/git-sizer.md create mode 100644 pages.cn/common/git-stash.md create mode 100644 pages.cn/common/git-status.md create mode 100644 pages.cn/common/git-submodule.md create mode 100644 pages.cn/common/git-svn.md create mode 100644 pages.cn/common/git-tag.md create mode 100644 pages.cn/common/git-worktree.md create mode 100644 pages.cn/common/git.md create mode 100644 pages.cn/common/gitk.md create mode 100644 pages.cn/common/gitsome.md create mode 100644 pages.cn/common/glances.md create mode 100644 pages.cn/common/gnomon.md create mode 100644 pages.cn/common/gnuplot.md create mode 100644 pages.cn/common/go.md create mode 100644 pages.cn/common/gocryptfs.md create mode 100644 pages.cn/common/godoc.md create mode 100644 pages.cn/common/godot.md create mode 100644 pages.cn/common/gofmt.md create mode 100644 pages.cn/common/gource.md create mode 100644 pages.cn/common/gpg-zip.md create mode 100644 pages.cn/common/gpg.md create mode 100644 pages.cn/common/gradle.md create mode 100644 pages.cn/common/grep.md create mode 100644 pages.cn/common/groff.md create mode 100644 pages.cn/common/groups.md create mode 100644 pages.cn/common/grunt.md create mode 100644 pages.cn/common/gtop.md create mode 100644 pages.cn/common/guetzli.md create mode 100644 pages.cn/common/guile.md create mode 100644 pages.cn/common/gulp.md create mode 100644 pages.cn/common/gunzip.md create mode 100644 pages.cn/common/gzip.md create mode 100644 pages.cn/common/handbrakecli.md create mode 100644 pages.cn/common/hangups.md create mode 100644 pages.cn/common/haxelib.md create mode 100644 pages.cn/common/head.md create mode 100644 pages.cn/common/helm.md create mode 100644 pages.cn/common/help2man.md create mode 100644 pages.cn/common/heroku.md create mode 100644 pages.cn/common/hg-add.md create mode 100644 pages.cn/common/hg-branch.md create mode 100644 pages.cn/common/hg-clone.md create mode 100644 pages.cn/common/hg-commit.md create mode 100644 pages.cn/common/hg-init.md create mode 100644 pages.cn/common/hg-log.md create mode 100644 pages.cn/common/hg-pull.md create mode 100644 pages.cn/common/hg-push.md create mode 100644 pages.cn/common/hg-remove.md create mode 100644 pages.cn/common/hg-serve.md create mode 100644 pages.cn/common/hg-update.md create mode 100644 pages.cn/common/hg.md create mode 100644 pages.cn/common/history.md create mode 100644 pages.cn/common/hn.md create mode 100644 pages.cn/common/host.md create mode 100644 pages.cn/common/hostess.md create mode 100644 pages.cn/common/hostid.md create mode 100644 pages.cn/common/hr.md create mode 100644 pages.cn/common/htpasswd.md create mode 100644 pages.cn/common/http.md create mode 100644 pages.cn/common/hub.md create mode 100644 pages.cn/common/hugo.md create mode 100644 pages.cn/common/hyperfine.md create mode 100644 pages.cn/common/iconv.md create mode 100644 pages.cn/common/id.md create mode 100644 pages.cn/common/id3tag.md create mode 100644 pages.cn/common/if.md create mode 100644 pages.cn/common/ifconfig.md create mode 100644 pages.cn/common/ignite.md create mode 100644 pages.cn/common/imapsync.md create mode 100644 pages.cn/common/import.md create mode 100644 pages.cn/common/in2csv.md create mode 100644 pages.cn/common/inkscape.md create mode 100644 pages.cn/common/install.md create mode 100644 pages.cn/common/ionic.md create mode 100644 pages.cn/common/ionice.md create mode 100644 pages.cn/common/ioping.md create mode 100644 pages.cn/common/ipcs.md create mode 100644 pages.cn/common/iperf.md create mode 100644 pages.cn/common/iperf3.md create mode 100644 pages.cn/common/ipfs.md create mode 100644 pages.cn/common/irssi.md create mode 100644 pages.cn/common/jar.md create mode 100644 pages.cn/common/java.md create mode 100644 pages.cn/common/javac.md create mode 100644 pages.cn/common/jekyll.md create mode 100644 pages.cn/common/jest.md create mode 100644 pages.cn/common/jhat.md create mode 100644 pages.cn/common/jmap.md create mode 100644 pages.cn/common/jobs.md create mode 100644 pages.cn/common/join.md create mode 100644 pages.cn/common/jpegoptim.md create mode 100644 pages.cn/common/jps.md create mode 100644 pages.cn/common/jq.md create mode 100644 pages.cn/common/jrnl.md create mode 100644 pages.cn/common/json5.md create mode 100644 pages.cn/common/jstack.md create mode 100644 pages.cn/common/julia.md create mode 100644 pages.cn/common/jupyter.md create mode 100644 pages.cn/common/k6.md create mode 100644 pages.cn/common/kafkacat.md create mode 100644 pages.cn/common/kak.md create mode 100644 pages.cn/common/keepass2.md create mode 100644 pages.cn/common/keybase.md create mode 100644 pages.cn/common/kill.md create mode 100644 pages.cn/common/killall.md create mode 100644 pages.cn/common/knife.md create mode 100644 pages.cn/common/kompose.md create mode 100644 pages.cn/common/kube-fzf.md create mode 100644 pages.cn/common/kubeadm.md create mode 100644 pages.cn/common/kubectl.md create mode 100644 pages.cn/common/kubectx.md create mode 100644 pages.cn/common/kubens.md create mode 100644 pages.cn/common/kubetail.md create mode 100644 pages.cn/common/laravel.md create mode 100644 pages.cn/common/last.md create mode 100644 pages.cn/common/latexmk.md create mode 100644 pages.cn/common/leave.md create mode 100644 pages.cn/common/lebab.md create mode 100644 pages.cn/common/lein.md create mode 100644 pages.cn/common/less.md create mode 100644 pages.cn/common/lex.md create mode 100644 pages.cn/common/license.md create mode 100644 pages.cn/common/light-arionum-cli.md create mode 100644 pages.cn/common/link.md create mode 100644 pages.cn/common/live-server.md create mode 100644 pages.cn/common/ln.md create mode 100644 pages.cn/common/loc.md create mode 100644 pages.cn/common/locust.md create mode 100644 pages.cn/common/logname.md create mode 100644 pages.cn/common/logstash.md create mode 100644 pages.cn/common/lolcat.md create mode 100644 pages.cn/common/lorem.md create mode 100644 pages.cn/common/lp.md create mode 100644 pages.cn/common/lpass.md create mode 100644 pages.cn/common/lpstat.md create mode 100644 pages.cn/common/ls.md create mode 100644 pages.cn/common/lsof.md create mode 100644 pages.cn/common/lua.md create mode 100644 pages.cn/common/luac.md create mode 100644 pages.cn/common/lumen.md create mode 100644 pages.cn/common/lwp-request.md create mode 100644 pages.cn/common/lz4.md create mode 100644 pages.cn/common/m4.md create mode 100644 pages.cn/common/magento.md create mode 100644 pages.cn/common/mailx.md create mode 100644 pages.cn/common/make.md create mode 100644 pages.cn/common/makensis.md create mode 100644 pages.cn/common/man.md create mode 100644 pages.cn/common/mc.md create mode 100644 pages.cn/common/md5sum.md create mode 100644 pages.cn/common/mdp.md create mode 100644 pages.cn/common/mediainfo.md create mode 100644 pages.cn/common/meshlabserver.md create mode 100644 pages.cn/common/meteor.md create mode 100644 pages.cn/common/micro.md create mode 100644 pages.cn/common/minetest.md create mode 100644 pages.cn/common/minetestserver.md create mode 100644 pages.cn/common/minikube.md create mode 100644 pages.cn/common/mitmdump.md create mode 100644 pages.cn/common/mitmproxy.md create mode 100644 pages.cn/common/mix.md create mode 100644 pages.cn/common/mkdir.md create mode 100644 pages.cn/common/mkfifo.md create mode 100644 pages.cn/common/mktemp.md create mode 100644 pages.cn/common/mlr.md create mode 100644 pages.cn/common/mmv.md create mode 100644 pages.cn/common/mocha.md create mode 100644 pages.cn/common/mogrify.md create mode 100644 pages.cn/common/mongo.md create mode 100644 pages.cn/common/mongod.md create mode 100644 pages.cn/common/mongodump.md create mode 100644 pages.cn/common/mongorestore.md create mode 100644 pages.cn/common/monodis.md create mode 100644 pages.cn/common/monop.md create mode 100644 pages.cn/common/montage.md create mode 100644 pages.cn/common/more.md create mode 100644 pages.cn/common/moro.md create mode 100644 pages.cn/common/mosh.md create mode 100644 pages.cn/common/most.md create mode 100644 pages.cn/common/mount.md create mode 100644 pages.cn/common/mp4box.md create mode 100644 pages.cn/common/mpc.md create mode 100644 pages.cn/common/mpv.md create mode 100644 pages.cn/common/mr.md create mode 100644 pages.cn/common/msbuild.md create mode 100644 pages.cn/common/msmtp.md create mode 100644 pages.cn/common/mtr.md create mode 100644 pages.cn/common/mutool.md create mode 100644 pages.cn/common/mutt.md create mode 100644 pages.cn/common/mv.md create mode 100644 pages.cn/common/mvn.md create mode 100644 pages.cn/common/mysql.md create mode 100644 pages.cn/common/mysqldump.md create mode 100644 pages.cn/common/nano.md create mode 100644 pages.cn/common/nasm.md create mode 100644 pages.cn/common/nc.md create mode 100644 pages.cn/common/ncmpcpp.md create mode 100644 pages.cn/common/neofetch.md create mode 100644 pages.cn/common/ng.md create mode 100644 pages.cn/common/nginx.md create mode 100644 pages.cn/common/ngrep.md create mode 100644 pages.cn/common/nice.md create mode 100644 pages.cn/common/nikto.md create mode 100644 pages.cn/common/nim.md create mode 100644 pages.cn/common/nimble.md create mode 100644 pages.cn/common/nix-collect-garbage.md create mode 100644 pages.cn/common/nix-env.md create mode 100644 pages.cn/common/nl.md create mode 100644 pages.cn/common/nmap.md create mode 100644 pages.cn/common/node.md create mode 100644 pages.cn/common/nohup.md create mode 100644 pages.cn/common/nokogiri.md create mode 100644 pages.cn/common/noti.md create mode 100644 pages.cn/common/npm-check.md create mode 100644 pages.cn/common/npm.md create mode 100644 pages.cn/common/nproc.md create mode 100644 pages.cn/common/npx.md create mode 100644 pages.cn/common/nrm.md create mode 100644 pages.cn/common/nslookup.md create mode 100644 pages.cn/common/numfmt.md create mode 100644 pages.cn/common/nvim.md create mode 100644 pages.cn/common/nvm.md create mode 100644 pages.cn/common/objdump.md create mode 100644 pages.cn/common/od.md create mode 100644 pages.cn/common/odps-auth.md create mode 100644 pages.cn/common/odps-func.md create mode 100644 pages.cn/common/odps-inst.md create mode 100644 pages.cn/common/odps-resource.md create mode 100644 pages.cn/common/odps-table.md create mode 100644 pages.cn/common/odps-tunnel.md create mode 100644 pages.cn/common/odps.md create mode 100644 pages.cn/common/omf.md create mode 100644 pages.cn/common/openssl.md create mode 100644 pages.cn/common/opt.md create mode 100644 pages.cn/common/optipng.md create mode 100644 pages.cn/common/p4.md create mode 100644 pages.cn/common/p5.md create mode 100644 pages.cn/common/paci.md create mode 100644 pages.cn/common/pandoc.md create mode 100644 pages.cn/common/parallel.md create mode 100644 pages.cn/common/pass.md create mode 100644 pages.cn/common/passwd.md create mode 100644 pages.cn/common/paste.md create mode 100644 pages.cn/common/patch.md create mode 100644 pages.cn/common/pdfjoin.md create mode 100644 pages.cn/common/pdflatex.md create mode 100644 pages.cn/common/pdfposter.md create mode 100644 pages.cn/common/pdftk.md create mode 100644 pages.cn/common/pdftotext.md create mode 100644 pages.cn/common/pdfunite.md create mode 100644 pages.cn/common/peerflix.md create mode 100644 pages.cn/common/perl.md create mode 100644 pages.cn/common/pg_ctl.md create mode 100644 pages.cn/common/pg_dump.md create mode 100644 pages.cn/common/pg_restore.md create mode 100644 pages.cn/common/pgrep.md create mode 100644 pages.cn/common/phing.md create mode 100644 pages.cn/common/phive.md create mode 100644 pages.cn/common/php-artisan.md create mode 100644 pages.cn/common/php-yii.md create mode 100644 pages.cn/common/php.md create mode 100644 pages.cn/common/phpcpd.md create mode 100644 pages.cn/common/phpcs.md create mode 100644 pages.cn/common/phpize.md create mode 100644 pages.cn/common/phploc.md create mode 100644 pages.cn/common/phpmd.md create mode 100644 pages.cn/common/phpstan.md create mode 100644 pages.cn/common/phpunit.md create mode 100644 pages.cn/common/picard.md create mode 100644 pages.cn/common/pigz.md create mode 100644 pages.cn/common/ping.md create mode 100644 pages.cn/common/ping6.md create mode 100644 pages.cn/common/pinky.md create mode 100644 pages.cn/common/pip.md create mode 100644 pages.cn/common/pipenv.md create mode 100644 pages.cn/common/pkill.md create mode 100644 pages.cn/common/play.md create mode 100644 pages.cn/common/pm2.md create mode 100644 pages.cn/common/pngcrush.md create mode 100644 pages.cn/common/postcss.md create mode 100644 pages.cn/common/printenv.md create mode 100644 pages.cn/common/printf.md create mode 100644 pages.cn/common/progpilot.md create mode 100644 pages.cn/common/prosodyctl.md create mode 100644 pages.cn/common/protoc.md create mode 100644 pages.cn/common/ps.md create mode 100644 pages.cn/common/psgrep.md create mode 100644 pages.cn/common/psql.md create mode 100644 pages.cn/common/pssh.md create mode 100644 pages.cn/common/pt.md create mode 100644 pages.cn/common/pup.md create mode 100644 pages.cn/common/pv.md create mode 100644 pages.cn/common/pwd.md create mode 100644 pages.cn/common/pycodestyle.md create mode 100644 pages.cn/common/pyenv-virtualenv.md create mode 100644 pages.cn/common/pyenv.md create mode 100644 pages.cn/common/pyflakes.md create mode 100644 pages.cn/common/pygmentize.md create mode 100644 pages.cn/common/python.md create mode 100644 pages.cn/common/q.md create mode 100644 pages.cn/common/qemu-img.md create mode 100644 pages.cn/common/qemu.md create mode 100644 pages.cn/common/qpdf.md create mode 100644 pages.cn/common/quota.md create mode 100644 pages.cn/common/r.md create mode 100644 pages.cn/common/rabin2.md create mode 100644 pages.cn/common/rails.md create mode 100644 pages.cn/common/rainbowstream.md create mode 100644 pages.cn/common/rbash.md create mode 100644 pages.cn/common/rbenv.md create mode 100644 pages.cn/common/rdfind.md create mode 100644 pages.cn/common/read.md create mode 100644 pages.cn/common/readlink.md create mode 100644 pages.cn/common/realpath.md create mode 100644 pages.cn/common/redis-cli.md create mode 100644 pages.cn/common/redshift.md create mode 100644 pages.cn/common/rename.md create mode 100644 pages.cn/common/renice.md create mode 100644 pages.cn/common/repren.md create mode 100644 pages.cn/common/restic.md create mode 100644 pages.cn/common/rev.md create mode 100644 pages.cn/common/rg.md create mode 100644 pages.cn/common/rm.md create mode 100644 pages.cn/common/rmdir.md create mode 100644 pages.cn/common/roll.md create mode 100644 pages.cn/common/route.md create mode 100644 pages.cn/common/rsstail.md create mode 100644 pages.cn/common/rsync.md create mode 100644 pages.cn/common/rtv.md create mode 100644 pages.cn/common/ruby.md create mode 100644 pages.cn/common/rustc.md create mode 100644 pages.cn/common/rustfmt.md create mode 100644 pages.cn/common/rustup.md create mode 100644 pages.cn/common/rvm.md create mode 100644 pages.cn/common/s.md create mode 100644 pages.cn/common/sails.md create mode 100644 pages.cn/common/salt-call.md create mode 100644 pages.cn/common/salt-key.md create mode 100644 pages.cn/common/salt-run.md create mode 100644 pages.cn/common/salt.md create mode 100644 pages.cn/common/samtools.md create mode 100644 pages.cn/common/sass.md create mode 100644 pages.cn/common/sc-im.md create mode 100644 pages.cn/common/scala.md create mode 100644 pages.cn/common/scheme.md create mode 100644 pages.cn/common/scp.md create mode 100644 pages.cn/common/scrapy.md create mode 100644 pages.cn/common/screen.md create mode 100644 pages.cn/common/screenfetch.md create mode 100644 pages.cn/common/script.md create mode 100644 pages.cn/common/sdk.md create mode 100644 pages.cn/common/sed.md create mode 100644 pages.cn/common/sendmail.md create mode 100644 pages.cn/common/seq.md create mode 100644 pages.cn/common/serverless.md create mode 100644 pages.cn/common/set.md create mode 100644 pages.cn/common/sftp.md create mode 100644 pages.cn/common/sh.md create mode 100644 pages.cn/common/sha1sum.md create mode 100644 pages.cn/common/sha224sum.md create mode 100644 pages.cn/common/sha256sum.md create mode 100644 pages.cn/common/sha384sum.md create mode 100644 pages.cn/common/sha512sum.md create mode 100644 pages.cn/common/shards.md create mode 100644 pages.cn/common/shc.md create mode 100644 pages.cn/common/shellcheck.md create mode 100644 pages.cn/common/shopt.md create mode 100644 pages.cn/common/shred.md create mode 100644 pages.cn/common/shuf.md create mode 100644 pages.cn/common/singularity.md create mode 100644 pages.cn/common/skicka.md create mode 100644 pages.cn/common/sl.md create mode 100644 pages.cn/common/slackcat.md create mode 100644 pages.cn/common/sleep.md create mode 100644 pages.cn/common/slimrb.md create mode 100644 pages.cn/common/smartctl.md create mode 100644 pages.cn/common/socat.md create mode 100644 pages.cn/common/sort.md create mode 100644 pages.cn/common/source.md create mode 100644 pages.cn/common/sox.md create mode 100644 pages.cn/common/spatial.md create mode 100644 pages.cn/common/speedtest-cli.md create mode 100644 pages.cn/common/spike.md create mode 100644 pages.cn/common/split.md create mode 100644 pages.cn/common/sqlite3.md create mode 100644 pages.cn/common/sqlmap.md create mode 100644 pages.cn/common/sqsc.md create mode 100644 pages.cn/common/srm.md create mode 100644 pages.cn/common/ssh-copy-id.md create mode 100644 pages.cn/common/ssh-keygen.md create mode 100644 pages.cn/common/ssh.md create mode 100644 pages.cn/common/sshfs.md create mode 100644 pages.cn/common/sshpass.md create mode 100644 pages.cn/common/st-flash.md create mode 100644 pages.cn/common/st-info.md create mode 100644 pages.cn/common/st-util.md create mode 100644 pages.cn/common/stack.md create mode 100644 pages.cn/common/standard.md create mode 100644 pages.cn/common/stat.md create mode 100644 pages.cn/common/stdbuf.md create mode 100644 pages.cn/common/stolonctl.md create mode 100644 pages.cn/common/stow.md create mode 100644 pages.cn/common/strings.md create mode 100644 pages.cn/common/stty.md create mode 100644 pages.cn/common/su.md create mode 100644 pages.cn/common/subfinder.md create mode 100644 pages.cn/common/subl.md create mode 100644 pages.cn/common/subliminal.md create mode 100644 pages.cn/common/sudo.md create mode 100644 pages.cn/common/sum.md create mode 100644 pages.cn/common/supervisorctl.md create mode 100644 pages.cn/common/supervisord.md create mode 100644 pages.cn/common/surge.md create mode 100644 pages.cn/common/svgcleaner.md create mode 100644 pages.cn/common/svgo.md create mode 100644 pages.cn/common/svn.md create mode 100644 pages.cn/common/swagger-codegen.md create mode 100644 pages.cn/common/swift.md create mode 100644 pages.cn/common/sync.md create mode 100644 pages.cn/common/tabula.md create mode 100644 pages.cn/common/tac.md create mode 100644 pages.cn/common/tail.md create mode 100644 pages.cn/common/tar.md create mode 100644 pages.cn/common/task.md create mode 100644 pages.cn/common/tb.md create mode 100644 pages.cn/common/tcpdump.md create mode 100644 pages.cn/common/tee.md create mode 100644 pages.cn/common/telnet.md create mode 100644 pages.cn/common/terraform.md create mode 100644 pages.cn/common/tesseract.md create mode 100644 pages.cn/common/test.md create mode 100644 pages.cn/common/tig.md create mode 100644 pages.cn/common/time.md create mode 100644 pages.cn/common/timeout.md create mode 100644 pages.cn/common/timew.md create mode 100644 pages.cn/common/tldr.md create mode 100644 pages.cn/common/tldrl.md create mode 100644 pages.cn/common/tmux.md create mode 100644 pages.cn/common/tokei.md create mode 100644 pages.cn/common/touch.md create mode 100644 pages.cn/common/tox.md create mode 100644 pages.cn/common/tpp.md create mode 100644 pages.cn/common/tput.md create mode 100644 pages.cn/common/tr.md create mode 100644 pages.cn/common/traceroute.md create mode 100644 pages.cn/common/traefik.md create mode 100644 pages.cn/common/trans.md create mode 100644 pages.cn/common/transcode.md create mode 100644 pages.cn/common/trash-cli.md create mode 100644 pages.cn/common/true.md create mode 100644 pages.cn/common/truncate.md create mode 100644 pages.cn/common/tslint.md create mode 100644 pages.cn/common/tsort.md create mode 100644 pages.cn/common/tty.md create mode 100644 pages.cn/common/ufraw-batch.md create mode 100644 pages.cn/common/umount.md create mode 100644 pages.cn/common/uname.md create mode 100644 pages.cn/common/unar.md create mode 100644 pages.cn/common/unexpand.md create mode 100644 pages.cn/common/uniq.md create mode 100644 pages.cn/common/unlink.md create mode 100644 pages.cn/common/unrar.md create mode 100644 pages.cn/common/unzip.md create mode 100644 pages.cn/common/uptime.md create mode 100644 pages.cn/common/upx.md create mode 100644 pages.cn/common/users.md create mode 100644 pages.cn/common/vagrant.md create mode 100644 pages.cn/common/valgrind.md create mode 100644 pages.cn/common/vault.md create mode 100644 pages.cn/common/vcsh.md create mode 100644 pages.cn/common/vegeta.md create mode 100644 pages.cn/common/view.md create mode 100644 pages.cn/common/vim.md create mode 100644 pages.cn/common/vimdiff.md create mode 100644 pages.cn/common/vimtutor.md create mode 100644 pages.cn/common/virtualenv.md create mode 100644 pages.cn/common/visudo.md create mode 100644 pages.cn/common/vsce.md create mode 100644 pages.cn/common/vue.md create mode 100644 pages.cn/common/w.md create mode 100644 pages.cn/common/w3m.md create mode 100644 pages.cn/common/wait.md create mode 100644 pages.cn/common/waitress-serve.md create mode 100644 pages.cn/common/wasm-objdump.md create mode 100644 pages.cn/common/wasm-opt.md create mode 100644 pages.cn/common/wasm2c.md create mode 100644 pages.cn/common/wasm2wat.md create mode 100644 pages.cn/common/wat2wasm.md create mode 100644 pages.cn/common/watch.md create mode 100644 pages.cn/common/wc.md create mode 100644 pages.cn/common/weasyprint.md create mode 100644 pages.cn/common/webpack.md create mode 100644 pages.cn/common/wget.md create mode 100644 pages.cn/common/where.md create mode 100644 pages.cn/common/which.md create mode 100644 pages.cn/common/while.md create mode 100644 pages.cn/common/who.md create mode 100644 pages.cn/common/whoami.md create mode 100644 pages.cn/common/wordgrinder.md create mode 100644 pages.cn/common/wpa_supplicant.md create mode 100644 pages.cn/common/wuzz.md create mode 100644 pages.cn/common/x_x.md create mode 100644 pages.cn/common/xargs.md create mode 100644 pages.cn/common/xcv.md create mode 100644 pages.cn/common/xmllint.md create mode 100644 pages.cn/common/xo.md create mode 100644 pages.cn/common/xsv.md create mode 100644 pages.cn/common/xxd.md create mode 100644 pages.cn/common/xz.md create mode 100644 pages.cn/common/yarn.md create mode 100644 pages.cn/common/yes.md create mode 100644 pages.cn/common/yesod.md create mode 100644 pages.cn/common/youtube-dl.md create mode 100644 pages.cn/common/z.md create mode 100644 pages.cn/common/zbarimg.md create mode 100644 pages.cn/common/zcat.md create mode 100644 pages.cn/common/zdb.md create mode 100644 pages.cn/common/zfs.md create mode 100644 pages.cn/common/zip.md create mode 100644 pages.cn/common/zless.md create mode 100644 pages.cn/common/zopflipng.md create mode 100644 pages.cn/common/zpool.md create mode 100644 pages.cn/common/zsh.md create mode 100644 pages.cn/common/zstd.md create mode 100644 pages.cn/linux/add-apt-repository.md create mode 100644 pages.cn/linux/adduser.md create mode 100644 pages.cn/linux/alpine.md create mode 100644 pages.cn/linux/apache2ctl.md create mode 100644 pages.cn/linux/apk.md create mode 100644 pages.cn/linux/apt-cache.md create mode 100644 pages.cn/linux/apt-file.md create mode 100644 pages.cn/linux/apt-get.md create mode 100644 pages.cn/linux/apt-key.md create mode 100644 pages.cn/linux/apt-mark.md create mode 100644 pages.cn/linux/apt.md create mode 100644 pages.cn/linux/aptitude.md create mode 100644 pages.cn/linux/arch.md create mode 100644 pages.cn/linux/archey.md create mode 100644 pages.cn/linux/arp-scan.md create mode 100644 pages.cn/linux/as.md create mode 100644 pages.cn/linux/aspell.md create mode 100644 pages.cn/linux/at.md create mode 100644 pages.cn/linux/authconfig.md create mode 100644 pages.cn/linux/autorandr.md create mode 100644 pages.cn/linux/beep.md create mode 100644 pages.cn/linux/bmon.md create mode 100644 pages.cn/linux/brew.md create mode 100644 pages.cn/linux/bzip2.md create mode 100644 pages.cn/linux/cal.md create mode 100644 pages.cn/linux/calc.md create mode 100644 pages.cn/linux/certbot.md create mode 100644 pages.cn/linux/chage.md create mode 100644 pages.cn/linux/chattr.md create mode 100644 pages.cn/linux/chkconfig.md create mode 100644 pages.cn/linux/cmus.md create mode 100644 pages.cn/linux/command.md create mode 100644 pages.cn/linux/compgen.md create mode 100644 pages.cn/linux/compose.md create mode 100644 pages.cn/linux/conky.md create mode 100644 pages.cn/linux/cpufreq-aperf.md create mode 100644 pages.cn/linux/cpufreq-info.md create mode 100644 pages.cn/linux/cpufreq-set.md create mode 100644 pages.cn/linux/cpuid.md create mode 100644 pages.cn/linux/cryptsetup.md create mode 100644 pages.cn/linux/csplit.md create mode 100644 pages.cn/linux/dash.md create mode 100644 pages.cn/linux/datamash.md create mode 100644 pages.cn/linux/dbus-daemon.md create mode 100644 pages.cn/linux/diff3.md create mode 100644 pages.cn/linux/disown.md create mode 100644 pages.cn/linux/dmesg.md create mode 100644 pages.cn/linux/dmidecode.md create mode 100644 pages.cn/linux/dnf.md create mode 100644 pages.cn/linux/dpkg-query.md create mode 100644 pages.cn/linux/dpkg.md create mode 100644 pages.cn/linux/ebuild.md create mode 100644 pages.cn/linux/edit.md create mode 100644 pages.cn/linux/edquota.md create mode 100644 pages.cn/linux/eject.md create mode 100644 pages.cn/linux/emerge.md create mode 100644 pages.cn/linux/entr.md create mode 100644 pages.cn/linux/envsubst.md create mode 100644 pages.cn/linux/equery.md create mode 100644 pages.cn/linux/eval.md create mode 100644 pages.cn/linux/export.md create mode 100644 pages.cn/linux/eyeD3.md create mode 100644 pages.cn/linux/f5fpc.md create mode 100644 pages.cn/linux/fallocate.md create mode 100644 pages.cn/linux/fatlabel.md create mode 100644 pages.cn/linux/fc-list.md create mode 100644 pages.cn/linux/fc-match.md create mode 100644 pages.cn/linux/fc-pattern.md create mode 100644 pages.cn/linux/fc.md create mode 100644 pages.cn/linux/fdisk.md create mode 100644 pages.cn/linux/feh.md create mode 100644 pages.cn/linux/figlet.md create mode 100644 pages.cn/linux/file.md create mode 100644 pages.cn/linux/findmnt.md create mode 100644 pages.cn/linux/firejail.md create mode 100644 pages.cn/linux/firewall-cmd.md create mode 100644 pages.cn/linux/flatpak.md create mode 100644 pages.cn/linux/foreman.md create mode 100644 pages.cn/linux/free.md create mode 100644 pages.cn/linux/fsck.md create mode 100644 pages.cn/linux/fuser.md create mode 100644 pages.cn/linux/genkernel.md create mode 100644 pages.cn/linux/getent.md create mode 100644 pages.cn/linux/getfacl.md create mode 100644 pages.cn/linux/gnome-terminal.md create mode 100644 pages.cn/linux/gpasswd.md create mode 100644 pages.cn/linux/groupadd.md create mode 100644 pages.cn/linux/groupdel.md create mode 100644 pages.cn/linux/groupmod.md create mode 100644 pages.cn/linux/gs.md create mode 100644 pages.cn/linux/guix-package.md create mode 100644 pages.cn/linux/gunicorn.md create mode 100644 pages.cn/linux/halt.md create mode 100644 pages.cn/linux/hardinfo.md create mode 100644 pages.cn/linux/hexdump.md create mode 100644 pages.cn/linux/hostname.md create mode 100644 pages.cn/linux/hostnamectl.md create mode 100644 pages.cn/linux/htop.md create mode 100644 pages.cn/linux/http-prompt.md create mode 100644 pages.cn/linux/httpie.md create mode 100644 pages.cn/linux/hwclock.md create mode 100644 pages.cn/linux/i7z.md create mode 100644 pages.cn/linux/ifdown.md create mode 100644 pages.cn/linux/ifup.md create mode 100644 pages.cn/linux/imgp.md create mode 100644 pages.cn/linux/inxi.md create mode 100644 pages.cn/linux/iostat.md create mode 100644 pages.cn/linux/ip.md create mode 100644 pages.cn/linux/ipcalc.md create mode 100644 pages.cn/linux/iptables.md create mode 100644 pages.cn/linux/isoinfo.md create mode 100644 pages.cn/linux/iw.md create mode 100644 pages.cn/linux/jobs.md create mode 100644 pages.cn/linux/journalctl.md create mode 100644 pages.cn/linux/kexec.md create mode 100644 pages.cn/linux/lastlog.md create mode 100644 pages.cn/linux/ldconfig.md create mode 100644 pages.cn/linux/ldd.md create mode 100644 pages.cn/linux/light.md create mode 100644 pages.cn/linux/lldb.md create mode 100644 pages.cn/linux/locate.md create mode 100644 pages.cn/linux/logger.md create mode 100644 pages.cn/linux/logwatch.md create mode 100644 pages.cn/linux/losetup.md create mode 100644 pages.cn/linux/lrunzip.md create mode 100644 pages.cn/linux/lrzip.md create mode 100644 pages.cn/linux/lrztar.md create mode 100644 pages.cn/linux/lrzuntar.md create mode 100644 pages.cn/linux/lsattr.md create mode 100644 pages.cn/linux/lsb_release.md create mode 100644 pages.cn/linux/lsblk.md create mode 100644 pages.cn/linux/lscpu.md create mode 100644 pages.cn/linux/lshw.md create mode 100644 pages.cn/linux/lsmod.md create mode 100644 pages.cn/linux/lspci.md create mode 100644 pages.cn/linux/lsscsi.md create mode 100644 pages.cn/linux/lsusb.md create mode 100644 pages.cn/linux/ltrace.md create mode 100644 pages.cn/linux/lvcreate.md create mode 100644 pages.cn/linux/lxc.md create mode 100644 pages.cn/linux/mdadm.md create mode 100644 pages.cn/linux/microcom.md create mode 100644 pages.cn/linux/mke2fs.md create mode 100644 pages.cn/linux/mkfs.cramfs.md create mode 100644 pages.cn/linux/mkfs.exfat.md create mode 100644 pages.cn/linux/mkfs.fat.md create mode 100644 pages.cn/linux/mkfs.minix.md create mode 100644 pages.cn/linux/mkfs.ntfs.md create mode 100644 pages.cn/linux/mkfs.vfat.md create mode 100644 pages.cn/linux/mkisofs.md create mode 100644 pages.cn/linux/mknod.md create mode 100644 pages.cn/linux/mkswap.md create mode 100644 pages.cn/linux/modinfo.md create mode 100644 pages.cn/linux/modprobe.md create mode 100644 pages.cn/linux/mpstat.md create mode 100644 pages.cn/linux/mycli.md create mode 100644 pages.cn/linux/n.md create mode 100644 pages.cn/linux/namei.md create mode 100644 pages.cn/linux/ncat.md create mode 100644 pages.cn/linux/ncdu.md create mode 100644 pages.cn/linux/ndctl.md create mode 100644 pages.cn/linux/nethogs.md create mode 100644 pages.cn/linux/netstat.md create mode 100644 pages.cn/linux/nft.md create mode 100644 pages.cn/linux/nm.md create mode 100644 pages.cn/linux/nmcli.md create mode 100644 pages.cn/linux/nmon.md create mode 100644 pages.cn/linux/nmtui.md create mode 100644 pages.cn/linux/notify-send.md create mode 100644 pages.cn/linux/ntfsfix.md create mode 100644 pages.cn/linux/opkg.md create mode 100644 pages.cn/linux/pacaur.md create mode 100644 pages.cn/linux/pacman.md create mode 100644 pages.cn/linux/pamac.md create mode 100644 pages.cn/linux/pasuspender.md create mode 100644 pages.cn/linux/pdfgrep.md create mode 100644 pages.cn/linux/perf.md create mode 100644 pages.cn/linux/phar.md create mode 100644 pages.cn/linux/pkgadd.md create mode 100644 pages.cn/linux/pkginfo.md create mode 100644 pages.cn/linux/pkgmk.md create mode 100644 pages.cn/linux/pkgrm.md create mode 100644 pages.cn/linux/playerctl.md create mode 100644 pages.cn/linux/popd.md create mode 100644 pages.cn/linux/ports.md create mode 100644 pages.cn/linux/poweroff.md create mode 100644 pages.cn/linux/print.md create mode 100644 pages.cn/linux/prt-get.md create mode 100644 pages.cn/linux/pstree.md create mode 100644 pages.cn/linux/pulseaudio.md create mode 100644 pages.cn/linux/pushd.md create mode 100644 pages.cn/linux/pvcreate.md create mode 100644 pages.cn/linux/pwgen.md create mode 100644 pages.cn/linux/qsub.md create mode 100644 pages.cn/linux/quotacheck.md create mode 100644 pages.cn/linux/rdesktop.md create mode 100644 pages.cn/linux/reboot.md create mode 100644 pages.cn/linux/reflector.md create mode 100644 pages.cn/linux/repquota.md create mode 100644 pages.cn/linux/reset.md create mode 100644 pages.cn/linux/rfkill.md create mode 100644 pages.cn/linux/rofi.md create mode 100644 pages.cn/linux/rpcinfo.md create mode 100644 pages.cn/linux/rpm.md create mode 100644 pages.cn/linux/rspamc.md create mode 100644 pages.cn/linux/rtcwake.md create mode 100644 pages.cn/linux/rtorrent.md create mode 100644 pages.cn/linux/run-mailcap.md create mode 100644 pages.cn/linux/runit.md create mode 100644 pages.cn/linux/runsv.md create mode 100644 pages.cn/linux/runsvchdir.md create mode 100644 pages.cn/linux/runsvdir.md create mode 100644 pages.cn/linux/sar.md create mode 100644 pages.cn/linux/sbatch.md create mode 100644 pages.cn/linux/see.md create mode 100644 pages.cn/linux/sensible-browser.md create mode 100644 pages.cn/linux/service.md create mode 100644 pages.cn/linux/setfacl.md create mode 100644 pages.cn/linux/shasum.md create mode 100644 pages.cn/linux/shutdown.md create mode 100644 pages.cn/linux/sinfo.md create mode 100644 pages.cn/linux/slapt-get.md create mode 100644 pages.cn/linux/sm.md create mode 100644 pages.cn/linux/smbclient.md create mode 100644 pages.cn/linux/snap.md create mode 100644 pages.cn/linux/snapper.md create mode 100644 pages.cn/linux/squeue.md create mode 100644 pages.cn/linux/ss.md create mode 100644 pages.cn/linux/ssh-add.md create mode 100644 pages.cn/linux/sshuttle.md create mode 100644 pages.cn/linux/strace.md create mode 100644 pages.cn/linux/sv.md create mode 100644 pages.cn/linux/swapoff.md create mode 100644 pages.cn/linux/swapon.md create mode 100644 pages.cn/linux/sysctl.md create mode 100644 pages.cn/linux/systemctl.md create mode 100644 pages.cn/linux/systemd-analyze.md create mode 100644 pages.cn/linux/tcpflow.md create mode 100644 pages.cn/linux/tcpkill.md create mode 100644 pages.cn/linux/terminator.md create mode 100644 pages.cn/linux/thunar.md create mode 100644 pages.cn/linux/timedatectl.md create mode 100644 pages.cn/linux/tomb.md create mode 100644 pages.cn/linux/top.md create mode 100644 pages.cn/linux/trap.md create mode 100644 pages.cn/linux/tree.md create mode 100644 pages.cn/linux/trizen.md create mode 100644 pages.cn/linux/ufw.md create mode 100644 pages.cn/linux/ulimit.md create mode 100644 pages.cn/linux/umask.md create mode 100644 pages.cn/linux/units.md create mode 100644 pages.cn/linux/unset.md create mode 100644 pages.cn/linux/update-alternatives.md create mode 100644 pages.cn/linux/update-rc.d.md create mode 100644 pages.cn/linux/updatedb.md create mode 100644 pages.cn/linux/useradd.md create mode 100644 pages.cn/linux/userdel.md create mode 100644 pages.cn/linux/usermod.md create mode 100644 pages.cn/linux/vgcreate.md create mode 100644 pages.cn/linux/viewnior.md create mode 100644 pages.cn/linux/vncserver.md create mode 100644 pages.cn/linux/vncviewer.md create mode 100644 pages.cn/linux/wall.md create mode 100644 pages.cn/linux/watch.md create mode 100644 pages.cn/linux/whatis.md create mode 100644 pages.cn/linux/whereis.md create mode 100644 pages.cn/linux/wodim.md create mode 100644 pages.cn/linux/wpa_cli.md create mode 100644 pages.cn/linux/write.md create mode 100644 pages.cn/linux/x11vnc.md create mode 100644 pages.cn/linux/xar.md create mode 100644 pages.cn/linux/xbps.md create mode 100644 pages.cn/linux/xclip.md create mode 100644 pages.cn/linux/xdotool.md create mode 100644 pages.cn/linux/xeyes.md create mode 100644 pages.cn/linux/xfce4-terminal.md create mode 100644 pages.cn/linux/xinput.md create mode 100644 pages.cn/linux/xman.md create mode 100644 pages.cn/linux/xrandr.md create mode 100644 pages.cn/linux/xsel.md create mode 100644 pages.cn/linux/xsetwacom.md create mode 100644 pages.cn/linux/xtrlock.md create mode 100644 pages.cn/linux/yank.md create mode 100644 pages.cn/linux/yaourt.md create mode 100644 pages.cn/linux/yay.md create mode 100644 pages.cn/linux/yum.md create mode 100644 pages.cn/linux/zenity.md create mode 100644 pages.cn/linux/zramctl.md create mode 100644 pages.cn/linux/zypper.md create mode 100644 pages.cn/osx/airport.md create mode 100644 pages.cn/osx/apachectl.md create mode 100644 pages.cn/osx/archey.md create mode 100644 pages.cn/osx/as.md create mode 100644 pages.cn/osx/asr.md create mode 100644 pages.cn/osx/base64.md create mode 100644 pages.cn/osx/brew-cask.md create mode 100644 pages.cn/osx/brew-mas.md create mode 100644 pages.cn/osx/brew.md create mode 100644 pages.cn/osx/brightness.md create mode 100644 pages.cn/osx/caffeinate.md create mode 100644 pages.cn/osx/cal.md create mode 100644 pages.cn/osx/carthage.md create mode 100644 pages.cn/osx/codesign.md create mode 100644 pages.cn/osx/command.md create mode 100644 pages.cn/osx/compgen.md create mode 100644 pages.cn/osx/date.md create mode 100644 pages.cn/osx/dd.md create mode 100644 pages.cn/osx/defaults.md create mode 100644 pages.cn/osx/diskutil.md create mode 100644 pages.cn/osx/ditto.md create mode 100644 pages.cn/osx/dmesg.md create mode 100644 pages.cn/osx/drutil.md create mode 100644 pages.cn/osx/du.md create mode 100644 pages.cn/osx/duti.md create mode 100644 pages.cn/osx/eval.md create mode 100644 pages.cn/osx/export.md create mode 100644 pages.cn/osx/fc.md create mode 100644 pages.cn/osx/feh.md create mode 100644 pages.cn/osx/file.md create mode 100644 pages.cn/osx/fsck.md create mode 100644 pages.cn/osx/gunicorn.md create mode 100644 pages.cn/osx/head.md create mode 100644 pages.cn/osx/hexdump.md create mode 100644 pages.cn/osx/hostname.md create mode 100644 pages.cn/osx/imgcat.md create mode 100644 pages.cn/osx/launchctl.md create mode 100644 pages.cn/osx/lldb.md create mode 100644 pages.cn/osx/locate.md create mode 100644 pages.cn/osx/logger.md create mode 100644 pages.cn/osx/look.md create mode 100644 pages.cn/osx/m.md create mode 100644 pages.cn/osx/md5.md create mode 100644 pages.cn/osx/mdfind.md create mode 100644 pages.cn/osx/mdutil.md create mode 100644 pages.cn/osx/mkfile.md create mode 100644 pages.cn/osx/n.md create mode 100644 pages.cn/osx/netstat.md create mode 100644 pages.cn/osx/networksetup.md create mode 100644 pages.cn/osx/nm.md create mode 100644 pages.cn/osx/oathtool.md create mode 100644 pages.cn/osx/open.md create mode 100644 pages.cn/osx/opensnoop.md create mode 100644 pages.cn/osx/osascript.md create mode 100644 pages.cn/osx/pbcopy.md create mode 100644 pages.cn/osx/pbpaste.md create mode 100644 pages.cn/osx/pdfgrep.md create mode 100644 pages.cn/osx/pmset.md create mode 100644 pages.cn/osx/pod.md create mode 100644 pages.cn/osx/popd.md create mode 100644 pages.cn/osx/port.md create mode 100644 pages.cn/osx/pushd.md create mode 100644 pages.cn/osx/pwgen.md create mode 100644 pages.cn/osx/qlmanage.md create mode 100644 pages.cn/osx/route.md create mode 100644 pages.cn/osx/rubocop.md create mode 100644 pages.cn/osx/runit.md create mode 100644 pages.cn/osx/runsv.md create mode 100644 pages.cn/osx/runsvchdir.md create mode 100644 pages.cn/osx/runsvdir.md create mode 100644 pages.cn/osx/say.md create mode 100644 pages.cn/osx/scutil.md create mode 100644 pages.cn/osx/sed.md create mode 100644 pages.cn/osx/shasum.md create mode 100644 pages.cn/osx/shuf.md create mode 100644 pages.cn/osx/shutdown.md create mode 100644 pages.cn/osx/sips.md create mode 100644 pages.cn/osx/softwareupdate.md create mode 100644 pages.cn/osx/split.md create mode 100644 pages.cn/osx/ssh-add.md create mode 100644 pages.cn/osx/sshuttle.md create mode 100644 pages.cn/osx/stat.md create mode 100644 pages.cn/osx/stty.md create mode 100644 pages.cn/osx/sv.md create mode 100644 pages.cn/osx/sw_vers.md create mode 100644 pages.cn/osx/sysctl.md create mode 100644 pages.cn/osx/system_profiler.md create mode 100644 pages.cn/osx/systemsetup.md create mode 100644 pages.cn/osx/top.md create mode 100644 pages.cn/osx/trap.md create mode 100644 pages.cn/osx/tree.md create mode 100644 pages.cn/osx/uname.md create mode 100644 pages.cn/osx/units.md create mode 100644 pages.cn/osx/w.md create mode 100644 pages.cn/osx/wacaw.md create mode 100644 pages.cn/osx/whereis.md create mode 100644 pages.cn/osx/xattr.md create mode 100644 pages.cn/osx/xcodebuild.md create mode 100644 pages.cn/osx/xctool.md create mode 100644 pages.cn/osx/xed.md create mode 100644 pages.cn/osx/xsltproc.md create mode 100644 pages.cn/osx/yank.md create mode 100644 pages.cn/sunos/devfsadm.md create mode 100644 pages.cn/sunos/dmesg.md create mode 100644 pages.cn/sunos/prctl.md create mode 100644 pages.cn/sunos/prstat.md create mode 100644 pages.cn/sunos/runit.md create mode 100644 pages.cn/sunos/runsv.md create mode 100644 pages.cn/sunos/runsvchdir.md create mode 100644 pages.cn/sunos/runsvdir.md create mode 100644 pages.cn/sunos/stty.md create mode 100644 pages.cn/sunos/sv.md create mode 100644 pages.cn/sunos/svcadm.md create mode 100644 pages.cn/sunos/svccfg.md create mode 100644 pages.cn/sunos/svcs.md create mode 100644 pages.cn/windows/assoc.md create mode 100644 pages.cn/windows/attrib.md create mode 100644 pages.cn/windows/choco-feature.md create mode 100644 pages.cn/windows/choco-info.md create mode 100644 pages.cn/windows/choco-install.md create mode 100644 pages.cn/windows/choco-list.md create mode 100644 pages.cn/windows/choco-new.md create mode 100644 pages.cn/windows/choco-outdated.md create mode 100644 pages.cn/windows/choco-pack.md create mode 100644 pages.cn/windows/choco-pin.md create mode 100644 pages.cn/windows/choco-search.md create mode 100644 pages.cn/windows/choco-source.md create mode 100644 pages.cn/windows/choco-uninstall.md create mode 100644 pages.cn/windows/choco-upgrade.md create mode 100644 pages.cn/windows/choco.md create mode 100644 pages.cn/windows/clip.md create mode 100644 pages.cn/windows/cls.md create mode 100644 pages.cn/windows/cmd.md create mode 100644 pages.cn/windows/color.md create mode 100644 pages.cn/windows/comp.md create mode 100644 pages.cn/windows/del.md create mode 100644 pages.cn/windows/dir.md create mode 100644 pages.cn/windows/doskey.md create mode 100644 pages.cn/windows/driverquery.md create mode 100644 pages.cn/windows/eventcreate.md create mode 100644 pages.cn/windows/exit.md create mode 100644 pages.cn/windows/expand.md create mode 100644 pages.cn/windows/find.md create mode 100644 pages.cn/windows/findstr.md create mode 100644 pages.cn/windows/finger.md create mode 100644 pages.cn/windows/fondue.md create mode 100644 pages.cn/windows/forfiles.md create mode 100644 pages.cn/windows/ftp.md create mode 100644 pages.cn/windows/getmac.md create mode 100644 pages.cn/windows/ipconfig.md create mode 100644 pages.cn/windows/iscc.md create mode 100644 pages.cn/windows/logoff.md create mode 100644 pages.cn/windows/mkdir.md create mode 100644 pages.cn/windows/mklink.md create mode 100644 pages.cn/windows/more.md create mode 100644 pages.cn/windows/msg.md create mode 100644 pages.cn/windows/path.md create mode 100644 pages.cn/windows/pathping.md create mode 100644 pages.cn/windows/popd.md create mode 100644 pages.cn/windows/print.md create mode 100644 pages.cn/windows/pushd.md create mode 100644 pages.cn/windows/pwlauncher.md create mode 100644 pages.cn/windows/rdpsign.md create mode 100644 pages.cn/windows/reg-add.md create mode 100644 pages.cn/windows/reg-compare.md create mode 100644 pages.cn/windows/reg-copy.md create mode 100644 pages.cn/windows/reg-delete.md create mode 100644 pages.cn/windows/reg-export.md create mode 100644 pages.cn/windows/reg-flags.md create mode 100644 pages.cn/windows/reg-import.md create mode 100644 pages.cn/windows/reg-load.md create mode 100644 pages.cn/windows/reg-query.md create mode 100644 pages.cn/windows/reg-restore.md create mode 100644 pages.cn/windows/reg-save.md create mode 100644 pages.cn/windows/reg-unload.md create mode 100644 pages.cn/windows/reg.md create mode 100644 pages.cn/windows/repair-bde.md create mode 100644 pages.cn/windows/rmdir.md create mode 100644 pages.cn/windows/scoop.md create mode 100644 pages.cn/windows/set.md create mode 100644 pages.cn/windows/sfc.md create mode 100644 pages.cn/windows/shutdown.md create mode 100644 pages.cn/windows/sigverif.md create mode 100644 pages.cn/windows/subst.md create mode 100644 pages.cn/windows/systeminfo.md create mode 100644 pages.cn/windows/taskkill.md create mode 100644 pages.cn/windows/tasklist.md create mode 100644 pages.cn/windows/title.md create mode 100644 pages.cn/windows/tree.md create mode 100644 pages.cn/windows/type.md create mode 100644 pages.cn/windows/tzutil.md create mode 100644 pages.cn/windows/units.md create mode 100644 pages.cn/windows/ver.md create mode 100644 pages.cn/windows/vol.md create mode 100644 pages.cn/windows/where.md create mode 100644 pages.cn/windows/whoami.md create mode 100644 pages.cn/windows/xcopy.md diff --git a/pages.cn/common/7z.md b/pages.cn/common/7z.md new file mode 100644 index 0000000000..fd94d72b9a --- /dev/null +++ b/pages.cn/common/7z.md @@ -0,0 +1,31 @@ +# 7z + +> A file archiver with high compression ratio. + +- Archive a file or folder: + +`7z a {{archived.7z}} {{path/to/file}}` + +- Encrypt an existing archive (including headers): + +`7z a {{encrypted.7z}} -p{{password}} -mhe {{archived.7z}}` + +- Extract an existing 7z file with original directory structure: + +`7z x {{archived.7z}}` + +- Extract an archive with user-defined output path: + +`7z x {{archived.7z}} -o{{path/to/output}}` + +- Archive using a specific archive type: + +`7z a -t {{zip|gzip|bzip2|tar|...}} {{archived.7z}} {{path/to/file}}` + +- List available archive types: + +`7z i` + +- List the contents of an archive file: + +`7z l {{archived.7z}}` diff --git a/pages.cn/common/7za.md b/pages.cn/common/7za.md new file mode 100644 index 0000000000..67d3b0a18e --- /dev/null +++ b/pages.cn/common/7za.md @@ -0,0 +1,24 @@ +# 7za + +> A file archiver with high compression ratio. +> A standalone version of `7z` with support for fewer archive types. + +- Archive a file or folder: + +`7za a {{archived.7z}} {{path/to/file}}` + +- Extract an existing 7z file with original directory structure: + +`7za x {{archived}}` + +- Archive using a specific archive type: + +`7za a -t{{zip|gzip|bzip2|tar|...}} {{archived}} {{path/to/file}}` + +- List available archive types: + +`7za i` + +- List the contents of an archive file: + +`7za l {{archived}}` diff --git a/pages.cn/common/7zr.md b/pages.cn/common/7zr.md new file mode 100644 index 0000000000..99f7044adb --- /dev/null +++ b/pages.cn/common/7zr.md @@ -0,0 +1,16 @@ +# 7zr + +> A file archiver with high compression ratio. +> A standalone version of `7z` that only supports .7z files. + +- Archive a file or folder: + +`7zr a {{archived.7z}} {{path/to/file}}` + +- Extract an existing 7z file with original directory structure: + +`7zr x {{archived.7z}}` + +- List the contents of an archive file: + +`7zr l {{archived.7z}}` diff --git a/pages.cn/common/ab.md b/pages.cn/common/ab.md new file mode 100644 index 0000000000..274dcf11f8 --- /dev/null +++ b/pages.cn/common/ab.md @@ -0,0 +1,19 @@ +# ab + +> Apache Benchmarking tool. The simplest tool to perform a load testing. + +- Execute 100 HTTP GET requests to given URL: + +`ab -n {{100}} {{url}}` + +- Execute 100 HTTP GET requests, processing up to 10 requests concurrently, to given URL: + +`ab -n {{100}} -c {{10}} {{url}}` + +- Use keep alive: + +`ab -k {{url}}` + +- Set the maximum number of seconds to spend for benchmarking: + +`ab -t {{60}} {{url}}` diff --git a/pages.cn/common/abduco.md b/pages.cn/common/abduco.md new file mode 100644 index 0000000000..dbfef4eefe --- /dev/null +++ b/pages.cn/common/abduco.md @@ -0,0 +1,23 @@ +# abduco + +> Terminal session manager. + +- List sessions: + +`abduco` + +- Attach to a session, creating it if it doesn't exist: + +`abduco -A {{name}} {{bash}}` + +- Attach to a session with `dvtm`, creating it if it doesn't exist: + +`abduco -A {{name}}` + +- Detach from a session: + +`Ctrl + \` + +- Attach to a session in read-only mode: + +`abduco -Ar {{name}}` diff --git a/pages.cn/common/ack.md b/pages.cn/common/ack.md new file mode 100644 index 0000000000..9ffed18067 --- /dev/null +++ b/pages.cn/common/ack.md @@ -0,0 +1,19 @@ +# ack + +> A search tool like grep, optimized for programmers. + +- Find files containing "foo": + +`ack {{foo}}` + +- Find files in a specific language: + +`ack --ruby {{each_with_object}}` + +- Count the total number of matches for the term "foo": + +`ack -ch {{foo}}` + +- Show the file names containing "foo" and number of matches in each file: + +`ack -cl {{foo}}` diff --git a/pages.cn/common/adb.md b/pages.cn/common/adb.md new file mode 100644 index 0000000000..323c6fcf58 --- /dev/null +++ b/pages.cn/common/adb.md @@ -0,0 +1,31 @@ +# adb + +> Android Debug Bridge: communicate with an Android emulator instance or connected Android devices. + +- Check whether the adb server process is running and start it: + +`adb start-server` + +- Terminate the adb server process: + +`adb kill-server` + +- Start a remote shell in the target emulator/device instance: + +`adb shell` + +- Push an Android application to an emulator/device: + +`adb install -r {{path/to/file.apk}}` + +- Copy a file/folder from the target device: + +`adb pull {{path/to/device_file_or_folder}} {{path/to/local_destination_folder}}` + +- Copy a file/folder to the target device: + +`adb push {{path/to/local_file_or_folder}} {{path/to/device_destination_folder}}` + +- Get a list of connected devices: + +`adb devices` diff --git a/pages.cn/common/ag.md b/pages.cn/common/ag.md new file mode 100644 index 0000000000..204a23a12a --- /dev/null +++ b/pages.cn/common/ag.md @@ -0,0 +1,31 @@ +# ag + +> The Silver Searcher. Like ack, but faster. + +- Find files containing "foo", and print the line matches in context: + +`ag {{foo}}` + +- Find files containing "foo" in a specific directory: + +`ag {{foo}} {{path/to/folder}}` + +- Find files containing "foo", but only list the filenames: + +`ag -l {{foo}}` + +- Find files containing "FOO" case-insensitively, and print only the match, rather than the whole line: + +`ag -i -o {{FOO}}` + +- Find "foo" in files with a name matching "bar": + +`ag {{foo}} -G {{bar}}` + +- Find files whose contents match a regular expression: + +`ag '{{^ba(r|z)$}}'` + +- Find files with a name matching "foo": + +`ag -g {{foo}}` diff --git a/pages.cn/common/airpaste.md b/pages.cn/common/airpaste.md new file mode 100644 index 0000000000..00fc49b474 --- /dev/null +++ b/pages.cn/common/airpaste.md @@ -0,0 +1,23 @@ +# airpaste + +> Share messages and files on the same network. + +- Wait for message and display when received: + +`airpaste` + +- Send text: + +`echo {{text}} | airpaste` + +- Send file: + +`airpaste < {{path/to/file}}` + +- Receive file: + +`airpaste > {{path/to/file}}` + +- Create/Join channel: + +`airpaste {{channel_name}}` diff --git a/pages.cn/common/alias.md b/pages.cn/common/alias.md new file mode 100644 index 0000000000..99c9c3c8a9 --- /dev/null +++ b/pages.cn/common/alias.md @@ -0,0 +1,28 @@ +# alias + +> Creates aliases -- words that are replaced by a command string. +> Aliases expire with the current shell session, unless they're defined in the shell's configuration file, e.g. `~/.bashrc`. + +- Create a generic alias: + +`alias {{word}}="{{command}}"` + +- View the command associated to a given alias: + +`alias {{word}}` + +- Remove an aliased command: + +`unalias {{word}}` + +- List all aliased words: + +`alias -p` + +- Turn rm into an interactive command: + +`alias {{rm}}="{{rm -i}}"` + +- Create `la` as a shortcut for `ls -a`: + +`alias {{la}}="{{ls -a}}"` diff --git a/pages.cn/common/ansible-galaxy.md b/pages.cn/common/ansible-galaxy.md new file mode 100644 index 0000000000..5ce91bb762 --- /dev/null +++ b/pages.cn/common/ansible-galaxy.md @@ -0,0 +1,23 @@ +# ansible-galaxy + +> Create and manage Ansible roles. + +- Install a role: + +`ansible-galaxy install {{username.role_name}}` + +- Remove a role: + +`ansible-galaxy remove {{username.role_name}}` + +- List installed roles: + +`ansible-galaxy list` + +- Search for a given role: + +`ansible-galaxy search {{role_name}}` + +- Create a new role: + +`ansible-galaxy init {{role_name}}` diff --git a/pages.cn/common/ansible-playbook.md b/pages.cn/common/ansible-playbook.md new file mode 100644 index 0000000000..74791d5ccb --- /dev/null +++ b/pages.cn/common/ansible-playbook.md @@ -0,0 +1,19 @@ +# ansible-playbook + +> Execute tasks defined in playbook on remote machines over SSH. + +- Run tasks in playbook: + +`ansible-playbook {{playbook}}` + +- Run tasks in playbook with custom host inventory: + +`ansible-playbook {{playbook}} -i {{inventory_file}}` + +- Run tasks in playbook with extra variables defined via the command line: + +`ansible-playbook {{playbook}} -e "{{variable1}}={{value1}} {{variable2}}={{value2}}"` + +- Run tasks in playbook with extra variables defined in a json file: + +`ansible-playbook {{playbook}} -e "@{{variables.json}}"` diff --git a/pages.cn/common/ansible.md b/pages.cn/common/ansible.md new file mode 100644 index 0000000000..d38ec6408c --- /dev/null +++ b/pages.cn/common/ansible.md @@ -0,0 +1,28 @@ +# ansible + +> Manage groups of computers remotely over SSH. +> Use the /etc/ansible/hosts file to add new groups/hosts. + +- List hosts belonging to a group: + +`ansible {{group}} --list-hosts` + +- Ping a group of hosts by invoking the ping module: + +`ansible {{group}} -m ping` + +- Display facts about a group of hosts by invoking the setup module: + +`ansible {{group}} -m setup` + +- Execute a command on a group of hosts by invoking command module with arguments: + +`ansible {{group}} -m command -a '{{my_command}}'` + +- Execute a command with administrative privileges: + +`ansible {{group}} --become --ask-become-pass -m command -a '{{my_command}}'` + +- Execute a command using a custom inventory file: + +`ansible {{group}} -i {{inventory_file}} -m command -a '{{my_command}}'` diff --git a/pages.cn/common/ansiweather.md b/pages.cn/common/ansiweather.md new file mode 100644 index 0000000000..b15a74709d --- /dev/null +++ b/pages.cn/common/ansiweather.md @@ -0,0 +1,15 @@ +# ansiweather + +> A shell script for displaying the current weather conditions in your terminal. + +- Display a forecast using metric units for the next five days for Rzeszow, Poland: + +`ansiweather -u {{metric}} -f {{5}} -l {{Rzeszow,PL}}` + +- Display a forecast showing symbols and daylight data for your current location: + +`ansiweather -s {{true}} -d {{true}}` + +- Display a forecast showing wind and humidity data for your current location: + +`ansiweather -w {{true}} -h {{true}}` diff --git a/pages.cn/common/apg.md b/pages.cn/common/apg.md new file mode 100644 index 0000000000..f9cd620556 --- /dev/null +++ b/pages.cn/common/apg.md @@ -0,0 +1,23 @@ +# apg + +> Creates arbitrarily complex random passwords. + +- Create random passwords (default password length is 8): + +`apg` + +- Create a password with at least 1 symbol (S), 1 number (N), 1 uppercase (C), 1 lowercase (L): + +`apg -M SNCL` + +- Create a password with 16 characters: + +`apg -m {{16}}` + +- Create a password with maximum length of 16: + +`apg -x {{16}}` + +- Create a password that doesn't appear in a dictionary (the dictionary file has to be provided): + +`apg -r {{dictionary_file}}` diff --git a/pages.cn/common/apm.md b/pages.cn/common/apm.md new file mode 100644 index 0000000000..63c83e99d7 --- /dev/null +++ b/pages.cn/common/apm.md @@ -0,0 +1,16 @@ +# apm + +> Atom editor Package Manager. +> See `atom`. + +- Install packages from http://atom.io/packages and themes from http://atom.io/themes: + +`apm install {{package_name}}` + +- Remove packages/themes: + +`apm remove {{package_name}}` + +- Upgrade packages/themes: + +`apm upgrade {{package_name}}` diff --git a/pages.cn/common/apropos.md b/pages.cn/common/apropos.md new file mode 100644 index 0000000000..7b9ca837f7 --- /dev/null +++ b/pages.cn/common/apropos.md @@ -0,0 +1,11 @@ +# apropos + +> Search in manpages, for example to find a new command. + +- Search for keyword: + +`apropos {{regular_expression}}` + +- Search without restricting output to terminal width: + +`apropos -l {{regular_expression}}` diff --git a/pages.cn/common/ar.md b/pages.cn/common/ar.md new file mode 100644 index 0000000000..9066b7fe9a --- /dev/null +++ b/pages.cn/common/ar.md @@ -0,0 +1,23 @@ +# ar + +> Create, modify, and extract from archives (.a, .so, .o). + +- Extract all members from an archive: + +`ar -x {{libfoo.a}}` + +- List the members of an archive: + +`ar -t {{libfoo.a}}` + +- Replace or add files to an archive: + +`ar -r {{libfoo.a}} {{foo.o}} {{bar.o}} {{baz.o}}` + +- Insert an object file index (equivalent to using `ranlib`): + +`ar -s {{libfoo.a}}` + +- Create an archive with files and an accompanying object file index: + +`ar -rs {{libfoo.a}} {{foo.o}} {{bar.o}} {{baz.o}}` diff --git a/pages.cn/common/aria2c.md b/pages.cn/common/aria2c.md new file mode 100644 index 0000000000..604ecc81a0 --- /dev/null +++ b/pages.cn/common/aria2c.md @@ -0,0 +1,28 @@ +# aria2c + +> Fast download utility. +> Supports HTTP(S), FTP, SFTP, BitTorrent, and Metalink. + +- Download a URI to a file: + +`aria2c {{url}}` + +- Download from multiple sources: + +`aria2c {{url_1}} {{url_2}}` + +- Download the URIs listed in a file: + +`aria2c -i {{filename}}` + +- Download with multiple connections: + +`aria2c -s {{connections_num}} {{url}}` + +- FTP download with username and password: + +`aria2c --ftp-user={{username}} --ftp-passwd={{password}} {{url}}` + +- Limit download speed in bytes/s: + +`aria2c --max-download-limit={{speed}} {{url}}` diff --git a/pages.cn/common/arp.md b/pages.cn/common/arp.md new file mode 100644 index 0000000000..7c6a70eac3 --- /dev/null +++ b/pages.cn/common/arp.md @@ -0,0 +1,19 @@ +# arp + +> Show and manipulate your system's ARP cache. + +- Show current arp table: + +`arp -a` + +- Clear the entire cache: + +`sudo arp -a -d` + +- Delete a specific entry: + +`arp -d {{address}}` + +- Create an entry: + +`arp -s {{address}} {{mac_address}}` diff --git a/pages.cn/common/asar.md b/pages.cn/common/asar.md new file mode 100644 index 0000000000..8cf1cf5439 --- /dev/null +++ b/pages.cn/common/asar.md @@ -0,0 +1,19 @@ +# asar + +> A file archiver for the Electron platform. + +- Archive a file or folder: + +`asar pack {{path/to/file}} {{archived.asar}}` + +- Extract an archive: + +`asar extract {{archived.asar}}` + +- Extract a specific file from an archive: + +`asar extract-file {{archived.asar}} {{file}}` + +- List the contents of an archive file: + +`asar list {{archived.asar}}` diff --git a/pages.cn/common/asciinema.md b/pages.cn/common/asciinema.md new file mode 100644 index 0000000000..d0b6314648 --- /dev/null +++ b/pages.cn/common/asciinema.md @@ -0,0 +1,35 @@ +# asciinema + +> Record and replay terminal sessions, and optionally share them on asciinema.org. + +- Associate the local install of `asciinema` with an asciinema.org account: + +`asciinema auth` + +- Make a new recording (once finished, user will be prompted to upload it or save it locally): + +`asciinema rec` + +- Make a new recording and save it to a local file: + +`asciinema rec {{path/to/file}}.cast` + +- Replay a terminal recording from a local file: + +`asciinema play {{path/to/file}}.cast` + +- Replay a terminal recording hosted on asciinema.org: + +`asciinema play https://asciinema.org/a/{{cast_id}}` + +- Make a new recording, limiting any idle time to at most 2.5 seconds: + +`asciinema rec -i {{2.5}}` + +- Print the full output of a locally saved recording: + +`asciinema cat {{path/to/file}}.cast` + +- Upload a locally saved terminal session to asciinema.org: + +`asciinema upload {{path/to/file}}.cast` diff --git a/pages.cn/common/assimp.md b/pages.cn/common/assimp.md new file mode 100644 index 0000000000..be6a98f82b --- /dev/null +++ b/pages.cn/common/assimp.md @@ -0,0 +1,32 @@ +# assimp + +> Command-line client for the Open Asset Import Library. +> Supports loading of 40+ 3D file formats, and exporting to several popular 3D formats. + +- List all supported import formats: + +`assimp listext` + +- List all supported export formats: + +`assimp listexport` + +- Convert a file to one of the supported output formats, using the default parameters: + +`assimp export {{input_file.stl}} {{output_file.obj}}` + +- Convert a file using custom parameters (the dox_cmd.h file in assimp's source code lists available parameters): + +`assimp export {{input_file.stl}} {{output_file.obj}} {{parameters}}` + +- Display a summary of a 3D file's contents: + +`assimp info {{path/to/file}}` + +- List all supported subcommands ("verbs"): + +`assimp help` + +- Get help on a specific subcommand (e.g. the parameters specific to it): + +`assimp {{subcommand}} --help` diff --git a/pages.cn/common/astyle.md b/pages.cn/common/astyle.md new file mode 100644 index 0000000000..09619b7616 --- /dev/null +++ b/pages.cn/common/astyle.md @@ -0,0 +1,24 @@ +# astyle + +> Source code indenter, formatter, and beautifier for the C, C++, C# and Java programming languages. +> Upon running, a copy of the original file is created with an ".orig" appended to the original file name. + +- Apply the default style of 4 spaces per indent and no formatting changes: + +`astyle {{source_file}}` + +- Apply the java style with attached braces: + +`astyle --style=java {{path/to/file}}` + +- Apply the allman style with broken braces: + +`astyle --style=allman {{path/to/file}}` + +- Apply a custom indent using spaces. Choose between 2 and 20 spaces: + +`astyle --indent=spaces={{number_of_spaces}} {{path/to/file}}` + +- Apply a custom indent using tabs. Choose between 2 and 20 tabs: + +`astyle --indent=tab={{number_of_tabs}} {{path/to/file}}` diff --git a/pages.cn/common/at.md b/pages.cn/common/at.md new file mode 100644 index 0000000000..e7aaceceec --- /dev/null +++ b/pages.cn/common/at.md @@ -0,0 +1,16 @@ +# at + +> Execute commands once at a later time. +> Service atd (or atrun) should be running for the actual executions. + +- Execute commands from standard input in 5 minutes (press `Ctrl + D` after entering commands): + +`at now + 5 minutes` + +- Execute a command from standard input at 10:00 AM today: + +`echo "{{./make_db_backup.sh}}" | at 1000` + +- Execute commands from a given file next Tuesday: + +`at -f {{path/to/file}} 9:30 PM Tue` diff --git a/pages.cn/common/atom.md b/pages.cn/common/atom.md new file mode 100644 index 0000000000..9ae6664f1b --- /dev/null +++ b/pages.cn/common/atom.md @@ -0,0 +1,24 @@ +# atom + +> A cross-platform pluggable text editor. +> Plugins are managed by `apm`. + +- Open a file or folder: + +`atom {{path/to/file_or_folder}}` + +- Open a file or folder in a new window: + +`atom -n {{path/to/file_or_folder}}` + +- Open a file or folder in an existing window: + +`atom --add {{path/to/file_or_folder}}` + +- Open atom in safe mode (does not load any additional packages): + +`atom --safe` + +- Prevent atom from forking into the background, keeping atom attached to the terminal: + +`atom --foreground` diff --git a/pages.cn/common/atq.md b/pages.cn/common/atq.md new file mode 100644 index 0000000000..4b993a4472 --- /dev/null +++ b/pages.cn/common/atq.md @@ -0,0 +1,15 @@ +# atq + +> Show jobs scheduled by `at` or `batch` commands. + +- Show the current user's scheduled jobs: + +`atq` + +- Show jobs from queue named 'a' (queues have single-character names): + +`atq -q {{a}}` + +- Show jobs of all users (run as super user): + +`sudo atq` diff --git a/pages.cn/common/atrm.md b/pages.cn/common/atrm.md new file mode 100644 index 0000000000..f874220c90 --- /dev/null +++ b/pages.cn/common/atrm.md @@ -0,0 +1,12 @@ +# atrm + +> Remove jobs scheduled by `at` or `batch` commands. +> To find job numbers use `atq`. + +- Remove job number 10: + +`atrm {{10}}` + +- Remove many jobs, separated by spaces: + +`atrm {{15}} {{17}} {{22}}` diff --git a/pages.cn/common/autoflake.md b/pages.cn/common/autoflake.md new file mode 100644 index 0000000000..625186b175 --- /dev/null +++ b/pages.cn/common/autoflake.md @@ -0,0 +1,19 @@ +# autoflake + +> A tool to remove unused imports and variables from Python code. + +- Remove unused variables from a single file and display the diff: + +`autoflake --remove-unused-variables {{file.py}}` + +- Remove unused imports from multiple files and display the diffs: + +`autoflake --remove-all-unused-imports {{file1.py}} {{file2.py}} {{file3.py}}` + +- Remove unused variables from a file, overwriting the file: + +`autoflake --remove-unused-variables --in-place {{file.py}}` + +- Remove unused variables recursively from all files in a directory, overwriting each file: + +`autoflake --remove-unused-variables --in-place --recursive {{path/to/directory}}` diff --git a/pages.cn/common/autojump.md b/pages.cn/common/autojump.md new file mode 100644 index 0000000000..9a6a0f5b90 --- /dev/null +++ b/pages.cn/common/autojump.md @@ -0,0 +1,24 @@ +# autojump + +> Quickly jump among the directories you visit the most. +> Aliases like j or jc are provided for even less typing. + +- Jump to a directory that contains the given pattern: + +`j {{pattern}}` + +- Jump to a sub-directory (child) of the current directory that contains the given pattern: + +`jc {{pattern}}` + +- Open a directory that contains the given pattern in the operating system file manager: + +`jo {{pattern}}` + +- Remove non-existing directories from the autojump database: + +`j --purge` + +- Show the entries in the autojump database: + +`j -s` diff --git a/pages.cn/common/autossh.md b/pages.cn/common/autossh.md new file mode 100644 index 0000000000..fafe9a7b95 --- /dev/null +++ b/pages.cn/common/autossh.md @@ -0,0 +1,28 @@ +# autossh + +> Runs, monitors and restarts SSH connections. +> Auto-reconnects to keep port forwarding tunnels up. Accepts all ssh flags. + +- Open an SSH session, restarting when a monitoring port fails return data: + +`autossh -M {{monitor_port}} {{ssh_command}}` + +- Open an SSH session which forwards a local port to a remote one, restarting if necessary: + +`autossh -M {{monitor_port}} -L {{local_port}}:localhost:{{remote_port}} {{user}}@{{host}}` + +- Fork before executing ssh (runs in the background) and don't open a remote shell: + +`autossh -f -M {{monitor_port}} -N {{ssh_command}}` + +- Run autossh in the background, with no monitoring port, instead relying on SSH keep-alives every 10 seconds to detect failure: + +`autossh -f -M 0 -N -o "ServerAliveInterval 10" -o "ServerAliveCountMax 3" {{ssh_command}}` + +- Run autossh in the background, with no monitoring port, no remote shell, exiting if the port forward fails: + +`autossh -f -M 0 -N -o "ServerAliveInterval 10" -o "ServerAliveCountMax 3" -o ExitOnForwardFailure=yes -L {{local_port}}:localhost:{{remote_port}} {{user}}@{{host}}` + +- Run autossh in the background with debug output logged to a file and ssh verbose output logged to a second file: + +`AUTOSSH_DEBUG=1 AUTOSSH_LOGFILE={{log_file}} autossh -f -M {{monitor_port}} -v -E {{ssh_log_file}} {{ssh_command}}` diff --git a/pages.cn/common/avrdude.md b/pages.cn/common/avrdude.md new file mode 100644 index 0000000000..4e3094d6e2 --- /dev/null +++ b/pages.cn/common/avrdude.md @@ -0,0 +1,19 @@ +# avrdude + +> Driver program for Atmel AVR microcontrollers programming. + +- Read AVR microcontroller: + +`avrdude -p {{AVR_device}} -c {{programmer}} -U flash:r:{{file.hex}}:i` + +- Write AVR microcontroller: + +`avrdude -p {{AVR_device}} -c {{programmer}} -U flash:w:{{file.hex}}` + +- List available AVR devices: + +`avrdude -p \?` + +- List available AVR programmers: + +`avrdude -c \?` diff --git a/pages.cn/common/awk.md b/pages.cn/common/awk.md new file mode 100644 index 0000000000..e526de359a --- /dev/null +++ b/pages.cn/common/awk.md @@ -0,0 +1,27 @@ +# awk + +> A versatile programming language for working on files. + +- Print the fifth column (a.k.a. field) in a space-separated file: + +`awk '{print $5}' {{filename}}` + +- Print the second column of the lines containing "something" in a space-separated file: + +`awk '/{{something}}/ {print $2}' {{filename}}` + +- Print the last column of each line in a file, using a comma (instead of space) as a field separator: + +`awk -F ',' '{print $NF}' {{filename}}` + +- Sum the values in the first column of a file and print the total: + +`awk '{s+=$1} END {print s}' {{filename}}` + +- Sum the values in the first column and pretty-print the values and then the total: + +`awk '{s+=$1; print $1} END {print "--------"; print s}' {{filename}}` + +- Print every third line starting from the first line: + +`awk 'NR%3==1' {{filename}}` diff --git a/pages.cn/common/aws-s3.md b/pages.cn/common/aws-s3.md new file mode 100644 index 0000000000..e16cfc16ab --- /dev/null +++ b/pages.cn/common/aws-s3.md @@ -0,0 +1,27 @@ +# aws s3 + +> CLI for AWS S3 - provides storage through web services interfaces. + +- Show files in a bucket: + +`aws s3 ls {{bucket_name}}` + +- Sync files and folders from local to bucket: + +`aws s3 sync {{path/to/files}} s3://{{bucket_name}}` + +- Sync files and folders from bucket to local: + +`aws s3 sync s3://{{bucket_name}} {{path/to/target}}` + +- Sync files and folders with exclusions: + +`aws s3 sync {{path/to/files}} s3://{{bucket_name}} --exclude {{path/to/file}} --exclude {{path/to/folder}}/*` + +- Remove file from bucket: + +`aws s3 rm s3://{{bucket}}/{{path/to/file}}` + +- Preview changes only: + +`aws s3 {{any_command}} --dryrun` diff --git a/pages.cn/common/aws.md b/pages.cn/common/aws.md new file mode 100644 index 0000000000..16b0472802 --- /dev/null +++ b/pages.cn/common/aws.md @@ -0,0 +1,23 @@ +# aws + +> The official CLI tool for Amazon Web Services. + +- List all IAM users: + +`aws iam list-users` + +- List all EC2 instances from a specific region: + +`aws ec2 describe-instances --region {{us-east-1}}` + +- Receive message from a specific SQS queue: + +`aws sqs receive-message --queue-url {{https://queue.amazonaws.com/546123/Test}}` + +- Publish message to the specific SNS topic: + +`aws sns publish --topic-arn {{arn:aws:sns:us-east-1:54633:testTopic}} --message "Message"` + +- To see help text for the AWS command: + +`aws {{command}} help` diff --git a/pages.cn/common/axel.md b/pages.cn/common/axel.md new file mode 100644 index 0000000000..c6687c92b5 --- /dev/null +++ b/pages.cn/common/axel.md @@ -0,0 +1,24 @@ +# axel + +> Download accelerator. +> Supports HTTP, HTTPS, and FTP. + +- Download a URL to a file: + +`axel {{url}}` + +- Download and specify filename: + +`axel {{url}} -o {{filename}}` + +- Download with multiple connections: + +`axel -n {{connections_num}} {{url}}` + +- Search for mirrors: + +`axel -S {{mirrors_num}} {{url}}` + +- Limit download speed (bytes per second): + +`axel -s {{speed}} {{url}}` diff --git a/pages.cn/common/az.md b/pages.cn/common/az.md new file mode 100644 index 0000000000..fc99b20c27 --- /dev/null +++ b/pages.cn/common/az.md @@ -0,0 +1,27 @@ +# az + +> The official CLI tool for Microsoft Azure. + +- Log in to Azure: + +`az login` + +- Manage azure subscription information: + +`az account` + +- List all Azure Managed Disks: + +`az disk list` + +- List all Azure virtual machines: + +`az vm list` + +- Manage Azure Kubernetes Services: + +`az aks` + +- Manage Azure Network resources: + +`az network` diff --git a/pages.cn/common/b2sum.md b/pages.cn/common/b2sum.md new file mode 100644 index 0000000000..23c865ebc6 --- /dev/null +++ b/pages.cn/common/b2sum.md @@ -0,0 +1,19 @@ +# b2sum + +> Calculate BLAKE2 cryptographic checksums. + +- Calculate the BLAKE2 checksum for a file: + +`b2sum {{filename1}}` + +- Calculate BLAKE2 checksums for multiple files: + +`b2sum {{filename1}} {{filename2}}` + +- Read a file of BLAKE2 sums and filenames and verify all files have matching checksums: + +`b2sum -c {{filename.b2}}` + +- Calculate the BLAKE2 checksum from stdin: + +`{{somecommand}} | shasum` diff --git a/pages.cn/common/babel.md b/pages.cn/common/babel.md new file mode 100644 index 0000000000..7a4a90a898 --- /dev/null +++ b/pages.cn/common/babel.md @@ -0,0 +1,35 @@ +# babel + +> A transpiler which converts code from JavaScript ES6/ES7 syntax to ES5 syntax. + +- Transpile a specified input file and output to stdout: + +`babel {{path/to/file}}` + +- Transpile a specified input file and output to a specific file: + +`babel {{path/to/input_file}} --out-file {{path/to/output_file}}` + +- Transpile the input file every time it is changed: + +`babel {{path/to/input_file}} --watch` + +- Transpile a whole directory of files: + +`babel {{path/to/input_directory}}` + +- Ignore specified comma-separated files in a directory: + +`babel {{path/to/input_directory}} --ignore {{ignored_files}}` + +- Transpile and output as minified JavaScript: + +`babel {{path/to/input_file}} --minified` + +- Choose a set of presets for output formatting: + +`babel {{path/to/input_file}} --presets {{presets}}` + +- Output all available options: + +`babel --help` diff --git a/pages.cn/common/badblocks.md b/pages.cn/common/badblocks.md new file mode 100644 index 0000000000..2102c3f11c --- /dev/null +++ b/pages.cn/common/badblocks.md @@ -0,0 +1,16 @@ +# badblocks + +> Search a device for bad blocks. +> Some usages of badblocks can cause destructive actions, such as erasing all the data on a disk, including the partition table. + +- Search a disk for bad blocks by using a non-destructive read-only test: + +`sudo badblocks {{/dev/sda}}` + +- Search an unmounted disk for bad blocks with a non-destructive read-write test: + +`sudo badblocks -n {{/dev/sda}}` + +- Search an unmounted disk for bad blocks with a destructive write test: + +`sudo badblocks -w {{/dev/sda}}` diff --git a/pages.cn/common/banner.md b/pages.cn/common/banner.md new file mode 100644 index 0000000000..01b903fa6f --- /dev/null +++ b/pages.cn/common/banner.md @@ -0,0 +1,15 @@ +# banner + +> Print the given argument as a large ASCII art. + +- Print the text message as a large banner (quotes are optional): + +`banner {{"Hello World"}}` + +- Print the text message as a banner with a width of 50 characters: + +`banner -w {{50}} {{"Hello World"}}` + +- Read text from stdin: + +`banner` diff --git a/pages.cn/common/base32.md b/pages.cn/common/base32.md new file mode 100644 index 0000000000..6bb4db2c91 --- /dev/null +++ b/pages.cn/common/base32.md @@ -0,0 +1,19 @@ +# base32 + +> Encode or decode file or standard input, to standard output. + +- Encode a file: + +`base32 {{filename}}` + +- Decode a file: + +`base32 -d {{filename}}` + +- Encode from stdin: + +`{{somecommand}} | base32` + +- Decode from stdin: + +`{{somecommand}} | base32 -d` diff --git a/pages.cn/common/base64.md b/pages.cn/common/base64.md new file mode 100644 index 0000000000..293ae7954e --- /dev/null +++ b/pages.cn/common/base64.md @@ -0,0 +1,19 @@ +# base64 + +> Encode or decode file or standard input, to standard output. + +- Encode a file: + +`base64 {{filename}}` + +- Decode a file: + +`base64 -d {{filename}}` + +- Encode from stdin: + +`{{somecommand}} | base64` + +- Decode from stdin: + +`{{somecommand}} | base64 -d` diff --git a/pages.cn/common/basename.md b/pages.cn/common/basename.md new file mode 100644 index 0000000000..1fcafd9155 --- /dev/null +++ b/pages.cn/common/basename.md @@ -0,0 +1,11 @@ +# basename + +> Returns non-directory portion of a pathname. + +- Show only the file name from a path: + +`basename {{path/to/file}}` + +- Show only the file name from a path, with a suffix removed: + +`basename {{path/to/file}} {{suffix}}` diff --git a/pages.cn/common/bash.md b/pages.cn/common/bash.md new file mode 100644 index 0000000000..a4fe539229 --- /dev/null +++ b/pages.cn/common/bash.md @@ -0,0 +1,28 @@ +# bash + +> Bourne-Again SHell. +> `sh`-compatible command line interpreter. + +- Start interactive shell: + +`bash` + +- Execute a command: + +`bash -c "{{command}}"` + +- Run commands from a file: + +`bash {{file.sh}}` + +- Run commands from a file, logging all commands executed to the terminal: + +`bash -x {{file.sh}}` + +- Run commands from STDIN: + +`bash -s` + +- Print the version information of bash (use `echo $BASH_VERSION` to show just the version string): + +`bash --version` diff --git a/pages.cn/common/bashmarks.md b/pages.cn/common/bashmarks.md new file mode 100644 index 0000000000..cdf05203ba --- /dev/null +++ b/pages.cn/common/bashmarks.md @@ -0,0 +1,23 @@ +# bashmarks + +> Save and jump to commonly used directories using 1 character commands. + +- List available bookmarks: + +`l` + +- Save the current folder as "bookmark_name": + +`s {{bookmark_name}}` + +- Go to a bookmarked folder: + +`g {{bookmark_name}}` + +- Print a bookmarked folder's contents: + +`p {{bookmark_name}}` + +- Delete a bookmark: + +`d {{bookmark_name}}` diff --git a/pages.cn/common/bat.md b/pages.cn/common/bat.md new file mode 100644 index 0000000000..fce3e2fce5 --- /dev/null +++ b/pages.cn/common/bat.md @@ -0,0 +1,28 @@ +# bat + +> Print and concatenate files. +> A `cat` clone with syntax highlighting and Git integration. + +- Print the contents of a file to the standard output: + +`bat {{file}}` + +- Concatenate several files into the target file: + +`bat {{file1}} {{file2}} > {{target_file}}` + +- Append several files into the target file: + +`bat {{file1}} {{file2}} >> {{target_file}}` + +- Number all output lines: + +`bat -n {{file}}` + +- Syntax highlight a json file: + +`bat --language json {{file.json}}` + +- Display all supported languages: + +`bat --list-languages` diff --git a/pages.cn/common/batch.md b/pages.cn/common/batch.md new file mode 100644 index 0000000000..d290f2150b --- /dev/null +++ b/pages.cn/common/batch.md @@ -0,0 +1,16 @@ +# batch + +> Execute commands at a later time when the system load levels permit. +> Service atd (or atrun) should be running for the actual executions. + +- Execute a command from standard input: + +`echo "{{./make_db_backup.sh}}" | batch` + +- Execute commands from a given file: + +`batch -f {{path/to/file}}` + +- Execute commands from standard input (press `Ctrl + D` when finished): + +`batch` diff --git a/pages.cn/common/bc.md b/pages.cn/common/bc.md new file mode 100644 index 0000000000..96758a0ba8 --- /dev/null +++ b/pages.cn/common/bc.md @@ -0,0 +1,19 @@ +# bc + +> Calculator. + +- Run calculator in interactive mode using the standard math library: + +`bc -l` + +- Calculate the result of an expression: + +`bc <<< "(1 + 2) * 2 ^ 2"` + +- Calculate expression and force number of decimal places to 10: + +`bc <<< "scale=10; 5 / 3"` + +- Calculate expression with sine and cosine using mathlib: + +`bc -l <<< "s(1) + c(1)"` diff --git a/pages.cn/common/beanstalkd.md b/pages.cn/common/beanstalkd.md new file mode 100644 index 0000000000..1768b8e455 --- /dev/null +++ b/pages.cn/common/beanstalkd.md @@ -0,0 +1,19 @@ +# beanstalkd + +> A simple and generic work-queue server. + +- Start beanstalkd, listening on port 11300: + +`beanstalkd` + +- Start beanstalkd listening on a custom port and address: + +`beanstalkd -l {{ip_address}} -p {{port_number}}` + +- Persist work queues by saving them to disk: + +`beanstalkd -b {{path/to/persistence_directory}}` + +- Sync to the persistence directory every 500 milliseconds: + +`beanstalkd -b {{path/to/persistence_directory}} -f {{500}}` diff --git a/pages.cn/common/bedtools.md b/pages.cn/common/bedtools.md new file mode 100644 index 0000000000..659ec45e60 --- /dev/null +++ b/pages.cn/common/bedtools.md @@ -0,0 +1,28 @@ +# bedtools + +> A swiss-army knife of tools for genomic-analysis tasks. +> Used to intersect, group, convert and count data in BAM, BED, GFF/GTF, VCF format. + +- Intersect two files with respect to the sequences' strand and save the result to {{path/to/output_file}}: + +`bedtools intersect -a {{path/to/file_1}} -b {{path/to/file_2}} -s > {{path/to/output_file}}` + +- Intersect two files with a left outer join, i.e. report each feature from {{file_1}} and NULL if no overlap with {{file_2}}: + +`bedtools intersect -a {{path/to/file_1}} -b {{path/to/file_2}} -lof > {{path/to/output_file}}` + +- Using more efficient algorithm to intersect two pre-sorted files: + +`bedtools intersect -a {{path/to/file_1}} -b {{path/to/file_2}} -sorted > {{path/to/output_file}}` + +- Group file {{path/to/file}} based on the first three and the fifth column and summarize the sixth column by summing it up: + +`bedtools groupby -i {{path/to/file}} -c 1-3,5 -g 6 -o sum` + +- Convert bam-formated file to a bed-formated one: + +`bedtools bamtobed -i {{path/to/file}}.bam > {{path/to/file}}.bed` + +- Find for all features in {{file_1}}.bed the closest one in {{file_2}}.bed and write their distance in an extra column (input files must be sorted): + +`bedtools closest -a {{path/to/file_1}}.bed -b {{path/to/file_2}}.bed -d` diff --git a/pages.cn/common/berks.md b/pages.cn/common/berks.md new file mode 100644 index 0000000000..ba9510b281 --- /dev/null +++ b/pages.cn/common/berks.md @@ -0,0 +1,19 @@ +# berks + +> Chef cookbook dependency manager. + +- Install cookbook dependencies into a local repo: + +`berks install` + +- Update a specific cookbook and its dependencies: + +`berks update {{cookbook}}` + +- Upload a cookbook to the Chef server: + +`berks upload {{cookbook}}` + +- View the dependencies of a cookbook: + +`berks contingent {{cookbook}}` diff --git a/pages.cn/common/bg.md b/pages.cn/common/bg.md new file mode 100644 index 0000000000..6b73133977 --- /dev/null +++ b/pages.cn/common/bg.md @@ -0,0 +1,11 @@ +# bg + +> Resumes jobs that have been suspended (e.g. using `Ctrl + Z`), and keeps them running in the background. + +- Resume most recently suspended job and run it in the background: + +`bg` + +- Resume a specific job (use `jobs -l` to get its ID) and run it in the background: + +`bg {{job_id}}` diff --git a/pages.cn/common/blender.md b/pages.cn/common/blender.md new file mode 100644 index 0000000000..19d3c25a41 --- /dev/null +++ b/pages.cn/common/blender.md @@ -0,0 +1,32 @@ +# blender + +> Command-line interface to the Blender 3D computer graphics application. +> Arguments are executed in the order they are given. + +- Render all frames of an animation in the background, without loading the UI (output is saved to `/tmp`): + +`blender -b {{filename}}.blend -a` + +- Render an animation using a specific image naming pattern, in a path relative (`//`) to the .blend file: + +`blender -b {{filename}}.blend -o //{{render/frame_###.png}} -a` + +- Render the 10th frame of an animation as a single image, saved to an existing folder (absolute path): + +`blender -b {{filename}}.blend -o {{/path/to/output_folder}} -f {{10}}` + +- Render the second last frame in an animation as a JPEG image, saved to an existing folder (relative path): + +`blender -b {{filename}}.blend -o //{{output_folder}} -F {{JPEG}} -f {{-2}}` + +- Render the animation of a specific scene, starting at frame 10 and ending at frame 500: + +`blender -b {{filename}}.blend -S {{scene_name}} -s {{10}} -e {{500}} -a` + +- Render an animation at a specific resolution, by passing a Python expression: + +`blender -b {{filename}}.blend --python-expr '{{import bpy; bpy.data.scenes[0].render.resolution_percentage = 25}}' -a` + +- Start an interactive Blender session in the terminal with a python console (do `import bpy` after starting): + +`blender -b --python-console` diff --git a/pages.cn/common/bmaptool.md b/pages.cn/common/bmaptool.md new file mode 100644 index 0000000000..e92595d695 --- /dev/null +++ b/pages.cn/common/bmaptool.md @@ -0,0 +1,19 @@ +# bmaptool + +> Create or Copy blockmaps intelligently (and therefore faster than `cp` or `dd`). + +- Create a blockmap from image file: + +`bmaptool create -o {{blockmap.bmap}} {{source.img}}` + +- Copy an image file into sdb: + +`bmaptool copy --bmap {{blockmap.bmap}} {{source.img}} {{/dev/sdb}}` + +- Copy a compressed image file into sdb: + +`bmaptool copy --bmap {{blockmap.bmap}} {{source.img.gz}} {{/dev/sdb}}` + +- Copy an image file into sdb without using a blockmap: + +`bmaptool copy --nobmap {{source.img}} {{/dev/sdb}}` diff --git a/pages.cn/common/boot.md b/pages.cn/common/boot.md new file mode 100644 index 0000000000..a1cf1e53a7 --- /dev/null +++ b/pages.cn/common/boot.md @@ -0,0 +1,27 @@ +# boot + +> Build tooling for the Clojure programming language. + +- Start a REPL session either with the project or standalone: + +`boot repl` + +- Build a single "uberjar": + +`boot jar` + +- Learn about a command: + +`boot cljs --help` + +- Generate scaffolding for a new project based on a template: + +`boot --dependencies boot/new new --template {{template_name}} --name {{project_name}}` + +- Build for development (if using the boot/new template): + +`boot dev` + +- Build for production (if using the boot/new template): + +`boot prod` diff --git a/pages.cn/common/borg.md b/pages.cn/common/borg.md new file mode 100644 index 0000000000..9f777c23aa --- /dev/null +++ b/pages.cn/common/borg.md @@ -0,0 +1,32 @@ +# borg + +> Deduplicating backup tool. +> Creates local or remote backups that are mountable as filesystems. + +- Initialise a (local) repository: + +`borg init {{/path/to/repo_folder}}` + +- Backup a folder into the repository, creating an archive called "Monday": + +`borg create --progress {{/path/to/repo_folder}}::{{Monday}} {{/path/to/source_folder}}` + +- List all archives in a repository: + +`borg list {{/path/to/repo_folder}}` + +- Extract a specific folder from the "Monday" archive in a remote repository, excluding all *.ext files: + +`borg extract {{user}}@{{host}}:{{/path/to/repo_folder}}::{{Monday}} {{path/to/target_folder}} --exclude '{{*.ext}}'` + +- Prune a repository by deleting all archives older than 7 days, listing changes: + +`borg prune --keep-within {{7d}} --list {{/path/to/repo_folder}}` + +- Mount a repository as a FUSE filesystem: + +`borg mount {{/path/to/repo_folder}}::{{Monday}} {{/path/to/mountpoint}}` + +- Display help on creating archives: + +`borg create --help` diff --git a/pages.cn/common/bosh.md b/pages.cn/common/bosh.md new file mode 100644 index 0000000000..07b0c9c0ee --- /dev/null +++ b/pages.cn/common/bosh.md @@ -0,0 +1,35 @@ +# bosh + +> Command line tool to deploy and manage the bosh director. + +- Create local alias for director: + +`bosh alias-env {{environment_name}} -e {{ip_address|url}} --ca-cert {{ca_certificate}}` + +- List environments: + +`bosh environments` + +- Login to the director: + +`bosh login -e {{environment}} ` + +- List deployments: + +`bosh -e {{environment}} deployments` + +- List environment virtual machines: + +`bosh -e {{environment}} vms -d {{deployment}}` + +- Ssh into virtual machine: + +`bosh -e {{environment}} ssh {{virtual_machine}} -d {{deployment}}` + +- Upload stemcell: + +`bosh -e {{environment}} upload-stemcell {{stemcell_file|url}}` + +- Show current cloud config: + +`bosh -e {{environment}} cloud-config` diff --git a/pages.cn/common/bower.md b/pages.cn/common/bower.md new file mode 100644 index 0000000000..7387d4f015 --- /dev/null +++ b/pages.cn/common/bower.md @@ -0,0 +1,32 @@ +# bower + +> A package manager optimized for front-end web development. +> A package can be a GitHub user/repo shorthand, a Git endpoint, a URL or a registered package. + +- Install a project's dependencies, listed in its bower.json: + +`bower install` + +- Install one or more packages to the bower_components directory: + +`bower install {{package}} {{package}}` + +- Uninstall packages locally from the bower_components directory: + +`bower uninstall {{package}} {{package}}` + +- List local packages and possible updates: + +`bower list` + +- Display help information about a bower command: + +`bower help {{command}}` + +- Create a bower.json file for your package: + +`bower init` + +- Install a specific dependency version, and add it to bower.json: + +`bower install {{local_name}}={{package}}#{{version}} --save` diff --git a/pages.cn/common/box.md b/pages.cn/common/box.md new file mode 100644 index 0000000000..d7d63fef1c --- /dev/null +++ b/pages.cn/common/box.md @@ -0,0 +1,31 @@ +# box + +> A PHP application for building and managing Phars. + +- Build a new Phar file: + +`box build` + +- Build a new Phar file using a specific config file: + +`box build -c {{path/to/config}}` + +- Display information about the PHAR PHP extension: + +`box info` + +- Display information about a specific Phar file: + +`box info {{path/to/phar_file}}` + +- Validate the first found config file in the working directory: + +`box validate` + +- Verify the signature of a specific Phar file: + +`box verify {{path/to/phar_file}}` + +- Display all available commands and options: + +`box help` diff --git a/pages.cn/common/browser-sync.md b/pages.cn/common/browser-sync.md new file mode 100644 index 0000000000..a50fce7852 --- /dev/null +++ b/pages.cn/common/browser-sync.md @@ -0,0 +1,19 @@ +# browser-sync + +> Starts local web server that updates browser on file changes. + +- Start a server from a specific directory: + +`browser-sync start --server {{path/to/directory}} --files {{path/to/directory}}` + +- Start a server from local directory, watching all css files in some directory: + +`browser-sync start --server --files '{{path/to/directory/*.css}}'` + +- Create configuration file: + +`browser-sync init` + +- Start browser-sync from config file: + +`browser-sync start --config {{config_file}}` diff --git a/pages.cn/common/bundle.md b/pages.cn/common/bundle.md new file mode 100644 index 0000000000..3b63b55492 --- /dev/null +++ b/pages.cn/common/bundle.md @@ -0,0 +1,19 @@ +# bundle + +> Dependency manager for the Ruby programming language. + +- Install all gems defined in the gemfile expected in the working directory: + +`bundle install` + +- Update all gems by the rules defined in the gemfile and regenerate gemfile.lock: + +`bundle update` + +- Update one specific gem defined in the gemfile: + +`bundle update --source {{gemname}}` + +- Create a new gem skeleton: + +`bundle gem {{gemname}}` diff --git a/pages.cn/common/bup.md b/pages.cn/common/bup.md new file mode 100644 index 0000000000..bd5e112fed --- /dev/null +++ b/pages.cn/common/bup.md @@ -0,0 +1,23 @@ +# bup + +> Backup system based on the git packfile format, providing fast incremental saves and global deduplication. + +- Initialize a backup repository in the specified local directory: + +`bup -d {{path/to/repository}} init` + +- Prepare a given folder before taking a backup: + +`bup -d {{path/to/repository}} index {{path/to/folder}}` + +- Backup a folder to the repository: + +`bup -d {{path/to/repository}} save -n {{backup_name}} {{path/to/folder}}` + +- Show the backup snapshots currently stored in the repository: + +`bup -d {{path/to/repository}} ls` + +- Restore a specific backup snapshot to a target directory: + +`bup -d {{path/to/repository}} restore -C {{path/to/target_directory}} {{backup_name}}` diff --git a/pages.cn/common/bw.md b/pages.cn/common/bw.md new file mode 100644 index 0000000000..7fbd6bd1d0 --- /dev/null +++ b/pages.cn/common/bw.md @@ -0,0 +1,23 @@ +# bw + +> A CLI to access and manage a Bitwarden vault. + +- Log in to a Bitwarden user account: + +`bw login` + +- Log out of a Bitwarden user account: + +`bw logout` + +- Search and display items from Bitwarden vault: + +`bw list items --search {{github}}` + +- Display a particular item from Bitwarden vault: + +`bw get item {{github}}` + +- Create a folder in Bitwarden vault: + +`{{echo -n '{"name":"My Folder1"}' | base64}} | bw create folder` diff --git a/pages.cn/common/c99.md b/pages.cn/common/c99.md new file mode 100644 index 0000000000..8108939ad8 --- /dev/null +++ b/pages.cn/common/c99.md @@ -0,0 +1,19 @@ +# c99 + +> Compiles C programs according to the ISO C standard. + +- Compile source file(s) and create an executable: + +`c99 {{file.c}}` + +- Compile source file(s) and create an executable with a custom name: + +`c99 -o {{executable_name}} {{file.c}}` + +- Compile source file(s) and create object file(s): + +`c99 -c {{file.c}}` + +- Compile source file(s), link with object file(s), and create an executable: + +`c99 {{file.c}} {{file.o}}` diff --git a/pages.cn/common/cabal.md b/pages.cn/common/cabal.md new file mode 100644 index 0000000000..f87aa6b862 --- /dev/null +++ b/pages.cn/common/cabal.md @@ -0,0 +1,28 @@ +# cabal + +> Command line interface to the Haskell package infrastructure (Cabal). +> Manage Haskell projects and Cabal packages from the Hackage package repository. + +- Search and list packages from Hackage: + +`cabal list {{search_string}}` + +- Show information about a package: + +`cabal info {{package_name}}` + +- Download and install a package: + +`cabal install {{package_name}}` + +- Create a new Haskell project in the current directory: + +`cabal init` + +- Build the project in the current directory: + +`cabal build` + +- Run tests of the project in the current directory: + +`cabal test` diff --git a/pages.cn/common/calibre-server.md b/pages.cn/common/calibre-server.md new file mode 100644 index 0000000000..f84eac4425 --- /dev/null +++ b/pages.cn/common/calibre-server.md @@ -0,0 +1,17 @@ +# calibre-server + +> A server application that can be used to distribute ebooks over a network. +> Ebooks must be imported into the library using the GUI or calibredb before. +> Part of the Calibre ebook library. + +- Start a server to distribute ebooks. Access at http://localhost:8080: + +`calibre-server` + +- Start server on different port. Access at http://localhost:port: + +`calibre-server --port {{port}}` + +- Password protect the server: + +`calibre-server --username {{username}} --password {{password}}` diff --git a/pages.cn/common/calibredb.md b/pages.cn/common/calibredb.md new file mode 100644 index 0000000000..8d12b9ae67 --- /dev/null +++ b/pages.cn/common/calibredb.md @@ -0,0 +1,24 @@ +# calibredb + +> Tool to manipulate the your ebook database. +> Part of the Calibre ebook library. + +- List ebooks in the library with additional information: + +`calibredb list` + +- Search for ebooks displaying additional information: + +`calibredb list --search {{search_term}}` + +- Search for just ids of ebooks: + +`calibredb search {{search_term}}` + +- Add one or more ebooks to the library: + +`calibredb add {{file1 file2 …}}` + +- Remove one or more ebooks from the library. You need ebook-ids (see above): + +`calibredb remove {{id1 id2 …}}` diff --git a/pages.cn/common/cargo.md b/pages.cn/common/cargo.md new file mode 100644 index 0000000000..dbc5755ee9 --- /dev/null +++ b/pages.cn/common/cargo.md @@ -0,0 +1,32 @@ +# cargo + +> Rust package manager. +> Manage Rust projects and their module dependencies (crates). + +- Search for crates: + +`cargo search {{search_string}}` + +- Install a crate: + +`cargo install {{crate_name}}` + +- List installed crates: + +`cargo install --list` + +- Create a new binary Rust project in the current directory: + +`cargo init --bin` + +- Create a new library Rust project in the current directory: + +`cargo init` + +- Build the Rust project in the current directory: + +`cargo build` + +- Build with multiple parallel jobs: + +`cargo build -j {{jobs}}` diff --git a/pages.cn/common/case.md b/pages.cn/common/case.md new file mode 100644 index 0000000000..9949758582 --- /dev/null +++ b/pages.cn/common/case.md @@ -0,0 +1,11 @@ +# case + +> Branch based on the value of an expression. + +- Match a variable against string literals to decide which command to run: + +`case {{$tocount}} in {{words}}) {{wc -w README}}; ;; {{lines}}) {{wc -l README}}; ;; esac` + +- Combine patterns with |, use * as a fallback pattern: + +`case {{$tocount}} in {{[wW]|words}}) {{wc -w README}}; ;; {{[lL]|lines}}) {{wc -l README}}; ;; *) {{echo "what?"}}; ;; esac` diff --git a/pages.cn/common/cat.md b/pages.cn/common/cat.md new file mode 100644 index 0000000000..15332bcefe --- /dev/null +++ b/pages.cn/common/cat.md @@ -0,0 +1,19 @@ +# cat + +> Print and concatenate files. + +- Print the contents of a file to the standard output: + +`cat {{file}}` + +- Concatenate several files into the target file: + +`cat {{file1}} {{file2}} > {{target_file}}` + +- Append several files into the target file: + +`cat {{file1}} {{file2}} >> {{target_file}}` + +- Number all output lines: + +`cat -n {{file}}` diff --git a/pages.cn/common/cd.md b/pages.cn/common/cd.md new file mode 100644 index 0000000000..d8f37e28ee --- /dev/null +++ b/pages.cn/common/cd.md @@ -0,0 +1,19 @@ +# cd + +> Change the current working directory. + +- Go to the given directory: + +`cd {{path/to/directory}}` + +- Go to home directory of current user: + +`cd` + +- Go up to the parent of the current directory: + +`cd ..` + +- Go to the previously chosen directory: + +`cd -` diff --git a/pages.cn/common/chgrp.md b/pages.cn/common/chgrp.md new file mode 100644 index 0000000000..519fd28064 --- /dev/null +++ b/pages.cn/common/chgrp.md @@ -0,0 +1,19 @@ +# chgrp + +> Change group ownership of files and folders. + +- Change the owner of a file/folder: + +`chgrp {{group}} {{path/to/file}}` + +- Recursively change the owner of a folder and its contents: + +`chgrp -R {{group}} {{path/to/folder}}` + +- Change the owner of a symbolic link: + +`chgrp -h {{user}} {{path/to/symlink}}` + +- Change the owner of a file/folder to match a reference file: + +`chgrp --reference={{path/to/reference_file}} {{path/to/file}}` diff --git a/pages.cn/common/chmod.md b/pages.cn/common/chmod.md new file mode 100644 index 0000000000..61a5011e72 --- /dev/null +++ b/pages.cn/common/chmod.md @@ -0,0 +1,27 @@ +# chmod + +> Change the access permissions of a file or directory. + +- Give the [u]ser who owns a file the right to e[x]ecute it: + +`chmod u+x {{file}}` + +- Give the user rights to [r]ead and [w]rite to a file/directory: + +`chmod u+rw {{file}}` + +- Remove executable rights from the [g]roup: + +`chmod g-x {{file}}` + +- Give [a]ll users rights to read and execute: + +`chmod a+rx {{file}}` + +- Give [o]thers (not in the file owner's group) the same rights as the group: + +`chmod o=g {{file}}` + +- Change permissions recursively giving [g]roup and [o]thers the abililty to [w]rite: + +`chmod -R g+w,o+w {{directory}}` diff --git a/pages.cn/common/chown.md b/pages.cn/common/chown.md new file mode 100644 index 0000000000..c62d6e1778 --- /dev/null +++ b/pages.cn/common/chown.md @@ -0,0 +1,23 @@ +# chown + +> Change user and group ownership of files and folders. + +- Change the owner user of a file/folder: + +`chown {{user}} {{path/to/file}}` + +- Change the owner user and group of a file/folder: + +`chown {{user}}:{{group}} {{path/to/file}}` + +- Recursively change the owner of a folder and its contents: + +`chown -R {{user}} {{path/to/folder}}` + +- Change the owner of a symbolic link: + +`chown -h {{user}} {{path/to/symlink}}` + +- Change the owner of a file/folder to match a reference file: + +`chown --reference={{path/to/reference_file}} {{path/to/file}}` diff --git a/pages.cn/common/chromium.md b/pages.cn/common/chromium.md new file mode 100644 index 0000000000..fce4e80170 --- /dev/null +++ b/pages.cn/common/chromium.md @@ -0,0 +1,27 @@ +# chromium + +> Open-source web browser from Google. + +- Open a file: + +`chromium {{path/to/file.html}}` + +- Open an URL: + +`chromium {{example.com}}` + +- Open in incognito mode: + +`chromium --incognito {{example.com}}` + +- Open in a new window: + +`chromium --new-window {{example.com}}` + +- Open in app mode (without toolbars, URL bar, buttons, etc.): + +`chromium --app='{{https://example.com}}'` + +- Use a proxy server: + +`chromium --proxy-server="{{socks5://hostname:66}}" {{example.com}}` diff --git a/pages.cn/common/chroot.md b/pages.cn/common/chroot.md new file mode 100644 index 0000000000..e01eb5febe --- /dev/null +++ b/pages.cn/common/chroot.md @@ -0,0 +1,11 @@ +# chroot + +> Run command or interactive shell with special root directory. + +- Run command as new root directory: + +`chroot {{/path/to/new/root}} {{command}}` + +- Specify user and group (ID or name) to use: + +`chroot --userspec={{user:group}}` diff --git a/pages.cn/common/chsh.md b/pages.cn/common/chsh.md new file mode 100644 index 0000000000..6627cfb8cb --- /dev/null +++ b/pages.cn/common/chsh.md @@ -0,0 +1,7 @@ +# chsh + +> Change user's login shell. + +- Change shell: + +`chsh -s {{path/to/shell_binary}} {{username}}` diff --git a/pages.cn/common/cksum.md b/pages.cn/common/cksum.md new file mode 100644 index 0000000000..d8a3d16004 --- /dev/null +++ b/pages.cn/common/cksum.md @@ -0,0 +1,8 @@ +# cksum + +> Calculates CRC checksums and byte counts of a file. +> Note, on old UNIX systems the CRC implementation may differ. + +- Display a 32 bit checksum, size in bytes and filename: + +`cksum {{filename}}` diff --git a/pages.cn/common/clang.md b/pages.cn/common/clang.md new file mode 100644 index 0000000000..f2bf73f004 --- /dev/null +++ b/pages.cn/common/clang.md @@ -0,0 +1,19 @@ +# clang + +> Compiler for C, C++, and Objective-C source files. Can be used as a drop-in replacement for GCC. + +- Compile a source code file into an executable binary: + +`clang {{input_source.c}} -o {{output_executable}}` + +- Activate output of all errors and warnings: + +`clang {{input_source.c}} -Wall -o {{output_executable}}` + +- Include libraries located at a different path than the source file: + +`clang {{input_source.c}} -o {{output_executable}} -I{{header_path}} -L{{library_path}} -l{{library_name}}` + +- Compile source code into LLVM Intermediate Representation (IR): + +`clang -S -emit-llvm {{file.c}} -o {{file.ll}}` diff --git a/pages.cn/common/clear.md b/pages.cn/common/clear.md new file mode 100644 index 0000000000..aa133e6a92 --- /dev/null +++ b/pages.cn/common/clear.md @@ -0,0 +1,7 @@ +# clear + +> Clears the screen of the terminal. + +- Clear the screen (equivalent to typing Control-L when using the bash shell): + +`clear` diff --git a/pages.cn/common/cloc.md b/pages.cn/common/cloc.md new file mode 100644 index 0000000000..5a9283bcda --- /dev/null +++ b/pages.cn/common/cloc.md @@ -0,0 +1,15 @@ +# cloc + +> Count, and compute differences of, lines of source code and comments. + +- Count all the lines of code in a directory: + +`cloc {{/path/to/directory}}` + +- Count all the lines of code in a directory, displaying a progress bar during the counting process: + +`cloc --progress=1 {{/path/to/directory}}` + +- Compare 2 directory structures and count the differences between them: + +`cloc --diff {{/directory/one}} {{/directory/two}}` diff --git a/pages.cn/common/cmake.md b/pages.cn/common/cmake.md new file mode 100644 index 0000000000..98e8859188 --- /dev/null +++ b/pages.cn/common/cmake.md @@ -0,0 +1,16 @@ +# cmake + +> Cross-platform build system generator. +> It generates Makefiles, Visual Studio projects or others, depending on the target system. + +- Generate a Makefile and use it to compile a project in the same folder as the source: + +`cmake && make` + +- Generate a Makefile and use it to compile a project in a separate "build" folder (out-of-source build): + +`cmake -H. -B{{build}} && make -C {{build}}` + +- Run cmake in interactive mode (it will ask for each variable, instead of using defaults): + +`cmake -i` diff --git a/pages.cn/common/cmark.md b/pages.cn/common/cmark.md new file mode 100644 index 0000000000..96d51122c9 --- /dev/null +++ b/pages.cn/common/cmark.md @@ -0,0 +1,19 @@ +# cmark + +> Converts CommonMark Markdown formatted text to other formats. + +- Render a Commonmark Markdown file to HTML: + +`cmark --to html {{filename.md}}` + +- Convert data from standard input to latex: + +`cmark --to latex` + +- Convert straight quotes to smart quotes: + +`cmark --smart --to html {{filename.md}}` + +- Validate utf8 characters: + +`cmark --validate-utf8 {{filename.md}}` diff --git a/pages.cn/common/cmp.md b/pages.cn/common/cmp.md new file mode 100644 index 0000000000..9f392cb94e --- /dev/null +++ b/pages.cn/common/cmp.md @@ -0,0 +1,11 @@ +# cmp + +> Compare two files. + +- Find the byte number and line number of the first difference between the files: + +`cmp {{file1}} {{file2}}` + +- Find the byte number and differing bytes of every difference: + +`cmp -l {{file1}} {{file2}}` diff --git a/pages.cn/common/code.md b/pages.cn/common/code.md new file mode 100644 index 0000000000..f94c3ff44f --- /dev/null +++ b/pages.cn/common/code.md @@ -0,0 +1,23 @@ +# code + +> Visual Studio Code. + +- Open VS Code: + +`code` + +- Open the current directory in VS Code: + +`code .` + +- Open a file or directory in VS Code: + +`code {{path/to/file_or_folder}}` + +- Open a file or directory in the currently open VS Code window: + +`code --reuse-window {{path/to/file_or_folder}}` + +- Compare two files in VS Code: + +`code -d {{file1}} {{file2}}` diff --git a/pages.cn/common/coffee.md b/pages.cn/common/coffee.md new file mode 100644 index 0000000000..08d51e02ea --- /dev/null +++ b/pages.cn/common/coffee.md @@ -0,0 +1,23 @@ +# coffee + +> Executes CoffeeScript scripts or compiles them into JavaScript. + +- Run a script: + +`coffee {{path/to/file.coffee}}` + +- Compile to JavaScript and save to a file with the same name: + +`coffee --compile {{path/to/file.coffee}}` + +- Compile to JavaScript and save to a given output file: + +`coffee --compile {{path/to/file.coffee}} --output {{path/to/file.js}}` + +- Run interactive REPL: + +`coffee --interactive` + +- Watch script for changes and re-run script: + +`coffee --watch {{path/to/file.coffee}}` diff --git a/pages.cn/common/column.md b/pages.cn/common/column.md new file mode 100644 index 0000000000..55c4c80e98 --- /dev/null +++ b/pages.cn/common/column.md @@ -0,0 +1,20 @@ +# column + +> Format standard input or file into multiple columns. +> Rows are filled before columns; default separator is whitespace. + +- Format output for a 30 characters wide display: + +`printf "header1 header2\nbar foo\n" | column -c {{30}}` + +- Specify column delimiter character for the -t option (i.e. "," for csv); default is whitespace: + +`printf "header1,header2\nbar,foo\n" | column -s{{,}}` + +- Split columns automatically and auto-align in a tabular format: + +`printf "header1 header2\nbar foo\n" | column -t` + +- Fill columns before filling rows: + +`printf "header1\nbar\nfoobar\n" | column -c {{30}} -x` diff --git a/pages.cn/common/comm.md b/pages.cn/common/comm.md new file mode 100644 index 0000000000..e1c031d776 --- /dev/null +++ b/pages.cn/common/comm.md @@ -0,0 +1,23 @@ +# comm + +> Select or reject lines common to two files. Both files must be sorted. + +- Produce three tab-separated columns: lines only in first file, lines only in second file and common lines: + +`comm {{file1}} {{file2}}` + +- Print only lines common to both files: + +`comm -12 {{file1}} {{file2}}` + +- Print only lines common to both files, reading one file from stdin: + +`cat {{file1}} | comm -12 - {{file2}}` + +- Get lines only found in first file, saving the result to a third file: + +`comm -23 {{file1}} {{file2}} > {{file1_only}}` + +- Print lines only found in second file, when the files aren't sorted: + +`comm -13 <(sort {{file1}}) <(sort {{file2}})` diff --git a/pages.cn/common/complete.md b/pages.cn/common/complete.md new file mode 100644 index 0000000000..2dce89ed3c --- /dev/null +++ b/pages.cn/common/complete.md @@ -0,0 +1,15 @@ +# complete + +> Provides argument autocompletion to shell commands. + +- Apply a function that performs autocompletion to a command: + +`complete -F {{function}} {{command}}` + +- Apply a command that performs autocompletion to another command: + +`complete -C {{autocomplete_command}} {{command}}` + +- Apply autocompletion without appending a space to the completed word: + +`complete -o nospace -F {{function}} {{command}}` diff --git a/pages.cn/common/composer.md b/pages.cn/common/composer.md new file mode 100644 index 0000000000..9edf9a87da --- /dev/null +++ b/pages.cn/common/composer.md @@ -0,0 +1,23 @@ +# composer + +> A package-based dependency manager for PHP projects. + +- Add a package as a dependency for this project, adding it to `composer.json`: + +`composer require {{user/package_name}}` + +- Install all the dependencies in this project's `composer.json`: + +`composer install` + +- Uninstall a package from this project, removing it as a dependency from `composer.json`: + +`composer remove {{user/package_name}}` + +- Update all the dependencies in this project's `composer.json`: + +`composer update` + +- Update composer to the latest version: + +`composer self-update` diff --git a/pages.cn/common/conda.md b/pages.cn/common/conda.md new file mode 100644 index 0000000000..3d3b760da6 --- /dev/null +++ b/pages.cn/common/conda.md @@ -0,0 +1,35 @@ +# conda + +> Package, dependency and environment management for any programming language. + +- Create a new environment, installing named packages into it: + +`conda create --name {{environment_name}} {{python=2.7 matplotlib}}` + +- List all environments: + +`conda info --envs` + +- Load or unload an environment: + +`source {{activate|deactivate}} {{environment_name}}` + +- Delete an environment (remove all packages): + +`conda remove --name {{environment_name}} --all` + +- Search conda channels for a package by name: + +`conda search {{package_name}}` + +- Install packages into the current environment: + +`conda install {{python=3.4 numpy}}` + +- List currently installed packages in current environment: + +`conda list` + +- Delete unused packages and caches: + +`conda clean --all` diff --git a/pages.cn/common/consul-kv.md b/pages.cn/common/consul-kv.md new file mode 100644 index 0000000000..dc1b2a48af --- /dev/null +++ b/pages.cn/common/consul-kv.md @@ -0,0 +1,15 @@ +# consul-kv + +> Distributed key-value store with health checking and service discovery. + +- Read a value from the key-value store: + +`consul kv get {{key}}` + +- Store a new key-value pair: + +`consul kv put {{key}} {{value}}` + +- Delete a key-value pair: + +`consul kv delete {{key}}` diff --git a/pages.cn/common/consul.md b/pages.cn/common/consul.md new file mode 100644 index 0000000000..a0231d788c --- /dev/null +++ b/pages.cn/common/consul.md @@ -0,0 +1,15 @@ +# consul + +> Distributed key-value store with health checking and service discovery. + +- Check the Consul version: + +`consul --version` + +- Show general help: + +`consul --help` + +- Show help for a sub-command: + +`consul {{sub-command}} --help` diff --git a/pages.cn/common/convert.md b/pages.cn/common/convert.md new file mode 100644 index 0000000000..95748cfdf3 --- /dev/null +++ b/pages.cn/common/convert.md @@ -0,0 +1,23 @@ +# convert + +> Imagemagick image conversion tool. + +- Convert an image from JPG to PNG: + +`convert {{image.jpg}} {{image.png}}` + +- Scale an image 50% its original size: + +`convert {{image.png}} -resize 50% {{image2.png}}` + +- Scale an image keeping the original aspect ratio to a maximum dimension of 640x480: + +`convert {{image.png}} -resize 640x480 {{image2.png}}` + +- Horizontally append images: + +`convert {{image1.png}} {{image2.png}} {{image3.png}} +append {{image123.png}}` + +- Create a gif from a series of images with 100ms delay between them: + +`convert {{image1.png}} {{image2.png}} {{image3.png}} -delay {{100}} {{animation.gif}}` diff --git a/pages.cn/common/convmv.md b/pages.cn/common/convmv.md new file mode 100644 index 0000000000..0f1597b2db --- /dev/null +++ b/pages.cn/common/convmv.md @@ -0,0 +1,11 @@ +# convmv + +> Convert filenames (NOT file content) from one encoding to another. + +- Test filename encoding conversion (don't actually change the filename): + +`convmv -f {{from_encoding}} -t {{to_encoding}} {{input_file}}` + +- Convert filename encoding and rename the file to the new encoding: + +`convmv -f {{from_encoding}} -t {{to_encoding}} --notest {{input_file}}` diff --git a/pages.cn/common/cordova.md b/pages.cn/common/cordova.md new file mode 100644 index 0000000000..eee38d2585 --- /dev/null +++ b/pages.cn/common/cordova.md @@ -0,0 +1,27 @@ +# cordova + +> Mobile apps with HTML, CSS & JS. + +- Create a cordova project: + +`cordova create {{path}} {{package_name}} {{project_name}}` + +- Display the current workspace status: + +`cordova info` + +- Add a cordova platform: + +`cordova platform add {{platform}}` + +- Remove a cordova platform: + +`cordova platform remove {{platform}}` + +- Add a cordova plugin: + +`cordova plugin add {{pluginid}}` + +- Remove a cordova plugin: + +`cordova plugin remove {{pluginid}}` diff --git a/pages.cn/common/couchdb.md b/pages.cn/common/couchdb.md new file mode 100644 index 0000000000..d61bc3c1d4 --- /dev/null +++ b/pages.cn/common/couchdb.md @@ -0,0 +1,23 @@ +# couchdb + +> Command line interface for Apache CouchDB database server. + +- Start couchdb: + +`couchdb` + +- Start couchdb interactive shell: + +`couchdb -i` + +- Start couchdb as a background process: + +`couchdb -b` + +- Kill the background process (Note: It will respawn if needed): + +`couchdb -k` + +- Shutdown the background process: + +`couchdb -d` diff --git a/pages.cn/common/cowsay.md b/pages.cn/common/cowsay.md new file mode 100644 index 0000000000..f74bd23304 --- /dev/null +++ b/pages.cn/common/cowsay.md @@ -0,0 +1,19 @@ +# cowsay + +> Generate an ASCII character (by default a cow) saying or thinking something. + +- Print an ASCII cow saying "Hello world!": + +`cowsay "Hello world!"` + +- List all available characters: + +`cowsay -l` + +- Print an ASCII dragon saying "Hello!": + +`echo "Hello!" | cowsay -f dragon` + +- Print a stoned thinking ASCII cow: + +`cowthink -s "I'm just a cow, not a great thinker ..."` diff --git a/pages.cn/common/cp.md b/pages.cn/common/cp.md new file mode 100644 index 0000000000..0495557364 --- /dev/null +++ b/pages.cn/common/cp.md @@ -0,0 +1,27 @@ +# cp + +> Copy files and folders. + +- Copy a file to another location: + +`cp {{path/to/file.ext}} {{path/to/copy.ext}}` + +- Copy a file into another folder, keeping the filename: + +`cp {{path/to/file.ext}} {{path/to/target_parent_folder}}` + +- Copy a folder recursively to another location: + +`cp -r {{path/to/folder}} {{path/to/copy}}` + +- Copy a folder recursively, in verbose mode (shows files as they are copied): + +`cp -vr {{path/to/folder}} {{path/to/copy}}` + +- Copy the contents of a folder into another folder: + +`cp -r {{path/to/source_folder/*}} {{path/to/target_folder}}` + +- Copy text files to another location, in interactive mode (prompts user before overwriting): + +`cp -i {{*.txt}} {{path/to/target_folder}}` diff --git a/pages.cn/common/cpio.md b/pages.cn/common/cpio.md new file mode 100644 index 0000000000..adbcf4056f --- /dev/null +++ b/pages.cn/common/cpio.md @@ -0,0 +1,16 @@ +# cpio + +> Copies files in and out of archives. +> Supports the following archive formats: cpio's custom binary, old ASCII, new ASCII, crc, HPUX binary, HPUX old ASCII, old tar, and POSIX.1 tar. + +- Take a list of file names from standard input and add them [o]nto an archive in cpio's binary format: + +`echo "{{file1}} {{file2}} {{file3}}" | cpio -o > {{archive.cpio}}` + +- Copy all files and folders in a directory and add them [o]nto an archive, in [v]erbose mode: + +`find {{path/to/directory}} | cpio -ov > {{archive.cpio}}` + +- P[i]ck all files from an archive, generating [d]irectories where needed, in [v]erbose mode: + +`cpio -idv < {{archive.cpio}}` diff --git a/pages.cn/common/cppcheck.md b/pages.cn/common/cppcheck.md new file mode 100644 index 0000000000..b3f66e9053 --- /dev/null +++ b/pages.cn/common/cppcheck.md @@ -0,0 +1,32 @@ +# cppcheck + +> A static analysis tool for C/C++ code. +> Instead of syntax errors, it focuses on the types of bugs that compilers normally do not detect. + +- Recursively check the current folder, showing progress on the screen and logging error messages to a file: + +`cppcheck . 2> cppcheck.log` + +- Recursively check a given folder, and don't print progress messages: + +`cppcheck --quiet {{path/to/folder}}` + +- Check a given file, specifying which tests to perform (by default only errors are shown): + +`cppcheck --enable={{error|warning|style|performance|portability|information|all}} {{path/to/file.cpp}}` + +- List available tests, filtered by a given search pattern: + +`cppcheck --errorlist | grep "{{search_pattern}}"` + +- Check a given file, ignoring specific tests: + +`cppcheck --suppress={{test_id1}} --suppress={{test_id2}} {{path/to/file.cpp}}` + +- Check the current folder, providing paths for include files located outside it (e.g. external libraries): + +`cppcheck -I {{include/folder_1}} -I {{include/folder_2}} .` + +- Check a Microsoft Visual Studio project (`*.vcxproj`) or solution (`*.sln`): + +`cppcheck --project={{path/to/project.sln}}` diff --git a/pages.cn/common/cppclean.md b/pages.cn/common/cppclean.md new file mode 100644 index 0000000000..3e240a73bb --- /dev/null +++ b/pages.cn/common/cppclean.md @@ -0,0 +1,19 @@ +# cppclean + +> Find unused code in C++ projects. + +- Run in a project's folder: + +`cppclean {{path/to/project}}` + +- Run on a project where the headers are in the "inc1/" and "inc2/" folders: + +`cppclean {{path/to/project}} --include-path={{inc1}} --include-path={{inc2}}` + +- Run on a specific file "main.cpp": + +`cppclean {{main.cpp}}` + +- Run on the current directory, excluding the "build" directory: + +`cppclean {{.}} --exclude={{build}}` diff --git a/pages.cn/common/cradle-deploy.md b/pages.cn/common/cradle-deploy.md new file mode 100644 index 0000000000..05b9d40d21 --- /dev/null +++ b/pages.cn/common/cradle-deploy.md @@ -0,0 +1,19 @@ +# cradle deploy + +> Manage Cradle deployments. + +- Deploy Cradle to a server: + +`cradle deploy production` + +- Deploy static assets to Amazon S3: + +`cradle deploy s3` + +- Deploy static assets including the Yarn "components" directory: + +`cradle deploy s3 --include-yarn` + +- Deploy static assets including the "upload" directory: + +`cradle deploy s3 --include-upload` diff --git a/pages.cn/common/cradle-elastic.md b/pages.cn/common/cradle-elastic.md new file mode 100644 index 0000000000..57336a15f6 --- /dev/null +++ b/pages.cn/common/cradle-elastic.md @@ -0,0 +1,27 @@ +# cradle elastic + +> Manage the ElasticSearch instances for a Cradle instance. + +- Truncate the ElasticSearch index: + +`cradle elastic flush` + +- Truncate the ElasticSearch index for a specific package: + +`cradle elastic flush {{package_name}}` + +- Submit the ElasticSearch schema: + +`cradle elastic map` + +- Submit the ElasticSearch schema for a specific package: + +`cradle elastic map {{package_name}}` + +- Populate the ElasticSearch indices for all packages: + +`cradle elastic populate` + +- Populate the ElasticSearch indices for a specific package: + +`cradle elastic populate {{package_name}}` diff --git a/pages.cn/common/cradle-install.md b/pages.cn/common/cradle-install.md new file mode 100644 index 0000000000..b19753875e --- /dev/null +++ b/pages.cn/common/cradle-install.md @@ -0,0 +1,23 @@ +# cradle install + +> Installs the Cradle PHP framework components. + +- Install Cradle's components (User will be prompted for further details): + +`cradle install` + +- Forcefully overwrite files: + +`cradle install --force` + +- Skip running SQL migrations: + +`cradle install --skip-sql` + +- Skip running package updates: + +`cradle install --skip-versioning` + +- Use specific database details: + +`cradle install -h {{hostname}} -u {{username}} -p {{password}}` diff --git a/pages.cn/common/cradle-package.md b/pages.cn/common/cradle-package.md new file mode 100644 index 0000000000..b1d18fd78a --- /dev/null +++ b/pages.cn/common/cradle-package.md @@ -0,0 +1,31 @@ +# cradle package + +> Manage packages for a Cradle instance. + +- Display a list of available packages: + +`cradle package list` + +- Search for a package: + +`cradle package search {{package}}` + +- Install a package from Packagist: + +`cradle package install {{package}}` + +- Install a specific version of a package: + +`cradle package install {{package}} {{version}}` + +- Update a package: + +`cradle package update {{package}}` + +- Update a package to a specific version: + +`cradle package update {{package}} {{version}}` + +- Remove a specific package: + +`cradle package remove {{package}}` diff --git a/pages.cn/common/cradle-sql.md b/pages.cn/common/cradle-sql.md new file mode 100644 index 0000000000..87b8804d9b --- /dev/null +++ b/pages.cn/common/cradle-sql.md @@ -0,0 +1,27 @@ +# cradle sql + +> Manage Cradle SQL databases. + +- Rebuild the database schema: + +`cradle sql build` + +- Rebuild the database schema for a specific package: + +`cradle sql build {{package_name}}` + +- Empty the entire database: + +`cradle sql flush` + +- Empty the database tables for a specific package: + +`cradle sql flush {{package_name}}` + +- Populate the tables for all packages: + +`cradle sql populate` + +- Populate the tables for a specific package: + +`cradle sql populate {{package_name}}` diff --git a/pages.cn/common/cradle.md b/pages.cn/common/cradle.md new file mode 100644 index 0000000000..691a49d65f --- /dev/null +++ b/pages.cn/common/cradle.md @@ -0,0 +1,20 @@ +# cradle + +> The Cradle PHP framework. +> See `cradle-install`, `cradle-deploy` and other pages for additional information. + +- Connect to a server: + +`cradle connect {{server_name}}` + +- Display general help: + +`cradle help` + +- Display help for a specific command: + +`cradle {{command}} help` + +- Execute a Cradle command: + +`cradle {{command}}` diff --git a/pages.cn/common/crontab.md b/pages.cn/common/crontab.md new file mode 100644 index 0000000000..d907bd4bad --- /dev/null +++ b/pages.cn/common/crontab.md @@ -0,0 +1,28 @@ +# crontab + +> Schedule cron jobs to run on a time interval for the current user. +> Job definition format: "(min) (hour) (day_of_month) (month) (day_of_week) command_to_execute". + +- Edit the crontab file for the current user: + +`crontab -e` + +- View a list of existing cron jobs for current user: + +`crontab -l` + +- Remove all cron jobs for the current user: + +`crontab -r` + +- Sample job which runs at 10:00 every day. * means any value: + +`0 10 * * * {{path/to/script.sh}}` + +- Sample job which runs every minute on the 3rd of April: + +`* * 3 Apr * {{path/to/script.sh}}` + +- Sample job which runs at 02:30 every Friday: + +`30 2 * * Fri {{path/to/script.sh}}` diff --git a/pages.cn/common/crystal.md b/pages.cn/common/crystal.md new file mode 100644 index 0000000000..e9ea964006 --- /dev/null +++ b/pages.cn/common/crystal.md @@ -0,0 +1,23 @@ +# crystal + +> Tool for managing crystal source code. + +- Run a crystal file: + +`crystal {{path/to/file.cr}}` + +- Compile a file and all dependencies to a single executable: + +`crystal build {{path/to/file.cr}}` + +- Start a local interactive server for testing the language: + +`crystal play` + +- Create a project directory for a crystal application: + +`crystal init app {{application_name}}` + +- Display all help options: + +`crystal help` diff --git a/pages.cn/common/csc.md b/pages.cn/common/csc.md new file mode 100644 index 0000000000..f6ce5cdaa9 --- /dev/null +++ b/pages.cn/common/csc.md @@ -0,0 +1,35 @@ +# csc + +> The Microsoft C# Compiler. + +- Compile one or more C# files to a CIL executable: + +`csc {{path/to/input_file_a.cs}} {{path/to/input_file_b.cs}}` + +- Specify the output filename: + +`csc /out:{{path/to/filename}} {{path/to/input_file.cs}}` + +- Compile into a '.dll' library instead of an executable: + +`csc /target:library {{path/to/input_file.cs}}` + +- Reference another assembly: + +`csc /reference:{{path/to/library.dll}} {{path/to/input_file.cs}}` + +- Embed a resource: + +`csc /resource:{{path/to/target_file.cs}},{{namespace.string.name}} {{path/to/input_file.cs}}` + +- Automatically generate XML documentation: + +`csc /doc:{{path/to/output.xml}} {{path/to/input_file.cs}}` + +- Specify an icon: + +`csc /win32icon:{{path/to/icon.ico}} {{path/to/input_file.cs}}` + +- Strongly-name the resulting assembly with a keyfile: + +`csc /keyfile:{{path/to/keyfile}} {{path/to/input_file.cs}}` diff --git a/pages.cn/common/csslint.md b/pages.cn/common/csslint.md new file mode 100644 index 0000000000..574052608d --- /dev/null +++ b/pages.cn/common/csslint.md @@ -0,0 +1,27 @@ +# csslint + +> A linter for CSS code. + +- Lint a single CSS file: + +`csslint {{file.css}}` + +- Lint multiple CSS files: + +`csslint {{file1.css}} {{file2.css}} {{file3.css}}` + +- List all possible style rules: + +`csslint --list-rules` + +- Specify certain rules as errors (which result in a non-zero exit code): + +`csslint --errors={{errors,universal-selector,imports}} {{file.css}}` + +- Specify certain rules as warnings: + +`csslint --warnings={{box-sizing,selector-max,floats}} {{file.css}}` + +- Specify certain rules to completely ignore: + +`csslint --ignore={{ids,rules-count,shorthand}} {{file.css}}` diff --git a/pages.cn/common/csvclean.md b/pages.cn/common/csvclean.md new file mode 100644 index 0000000000..612748e3b1 --- /dev/null +++ b/pages.cn/common/csvclean.md @@ -0,0 +1,12 @@ +# csvclean + +> Finds and cleans common syntax errors in CSV files. +> Included in csvkit. + +- Clean a CSV file: + +`csvclean {{bad.csv}}` + +- List locations of syntax errors in a CSV file: + +`csvclean -n {{bad.csv}}` diff --git a/pages.cn/common/csvcut.md b/pages.cn/common/csvcut.md new file mode 100644 index 0000000000..03ad76f09f --- /dev/null +++ b/pages.cn/common/csvcut.md @@ -0,0 +1,20 @@ +# csvcut + +> Filter and truncate CSV files. Like Unix's `cut` command, but for tabular data. +> Included in csvkit. + +- Print indices and names of all columns: + +`csvcut -n {{data.csv}}` + +- Extract the first and third columns: + +`csvcut -c {{1,3}} {{data.csv}}` + +- Extract all columns **except** the fourth one: + +`csvcut -C {{4}} {{data.csv}}` + +- Extract the columns named "id" and "first name" (in that order): + +`csvcut -c {{id,"first name"}} {{data.csv}}` diff --git a/pages.cn/common/csvformat.md b/pages.cn/common/csvformat.md new file mode 100644 index 0000000000..16276fbb1b --- /dev/null +++ b/pages.cn/common/csvformat.md @@ -0,0 +1,24 @@ +# csvformat + +> Convert a CSV file to a custom output format. +> Included in csvkit. + +- Convert to a tab-delimited file (TSV): + +`csvformat -T {{data.csv}}` + +- Convert delimiters to a custom character: + +`csvformat -D "{{custom_character}}" {{data.csv}}` + +- Convert line endings to carriage return (^M) + line feed: + +`csvformat -M "{{\r\n}}" {{data.csv}}` + +- Minimize use of quote characters: + +`csvformat -U 0 {{data.csv}}` + +- Maximize use of quote characters: + +`csvformat -U 1 {{data.csv}}` diff --git a/pages.cn/common/csvgrep.md b/pages.cn/common/csvgrep.md new file mode 100644 index 0000000000..bc7458ebc1 --- /dev/null +++ b/pages.cn/common/csvgrep.md @@ -0,0 +1,16 @@ +# csvgrep + +> Filter CSV rows with string and pattern matching. +> Included in csvkit. + +- Find rows that have a certain string in column 1: + +`csvgrep -c {{1}} -m {{string_to_match}} {{data.csv}}` + +- Find rows in which columns 3 or 4 match a certain regex pattern: + +`csvgrep -c {{3,4}} -r {{regex_pattern}} {{data.csv}}` + +- Find rows in which the "name" column does NOT include the string "John Doe": + +`csvgrep -i -c {{name}} -m {{"John Doe"}} {{data.csv}}` diff --git a/pages.cn/common/csvlook.md b/pages.cn/common/csvlook.md new file mode 100644 index 0000000000..3abdb0e234 --- /dev/null +++ b/pages.cn/common/csvlook.md @@ -0,0 +1,8 @@ +# csvlook + +> Render a CSV file in the console as a fixed-width table. +> Included in csvkit. + +- View a CSV file: + +`csvlook {{data.csv}}` diff --git a/pages.cn/common/csvpy.md b/pages.cn/common/csvpy.md new file mode 100644 index 0000000000..c49bd1536f --- /dev/null +++ b/pages.cn/common/csvpy.md @@ -0,0 +1,12 @@ +# csvpy + +> Loads a CSV file into a Python shell. +> Included in csvkit. + +- Load a CSV file into a `CSVKitReader` object: + +`csvpy {{data.csv}}` + +- Load a CSV file into a `CSVKitDictReader` object: + +`csvpy --dict {{data.csv}}` diff --git a/pages.cn/common/csvsort.md b/pages.cn/common/csvsort.md new file mode 100644 index 0000000000..c4150ddce3 --- /dev/null +++ b/pages.cn/common/csvsort.md @@ -0,0 +1,20 @@ +# csvsort + +> Sorts CSV files. +> Included in csvkit. + +- Sort a CSV file by column 9: + +`csvsort -c {{9}} {{data.csv}}` + +- Sort a CSV file by the "name" column in descending order: + +`csvsort -r -c {{name}} {{data.csv}}` + +- Sort a CSV file by column 2, then by column 4: + +`csvsort -c {{2,4}} {{data.csv}}` + +- Sort a CSV file without inferring data types: + +`csvsort --no-inference -c {{columns}} {{data.csv}}` diff --git a/pages.cn/common/csvstat.md b/pages.cn/common/csvstat.md new file mode 100644 index 0000000000..36fcbb62cc --- /dev/null +++ b/pages.cn/common/csvstat.md @@ -0,0 +1,24 @@ +# csvstat + +> Print descriptive statistics for all columns in a CSV file. +> Included in csvkit. + +- Show all stats for all columns: + +`csvstat {{data.csv}}` + +- Show all stats for columns 2 and 4: + +`csvstat -c {{2,4}} {{data.csv}}` + +- Show sums for all columns: + +`csvstat --sum {{data.csv}}` + +- Show the max value length for column 3: + +`csvstat -c {{3}} --len {{data.csv}}` + +- Show the number of unique values in the "name" column: + +`csvstat -c {{name}} --unique {{data.csv}}` diff --git a/pages.cn/common/ctest.md b/pages.cn/common/ctest.md new file mode 100644 index 0000000000..ba426bfafa --- /dev/null +++ b/pages.cn/common/ctest.md @@ -0,0 +1,15 @@ +# ctest + +> CMake test driver program. + +- Run all tests defined in the CMake project, executing 4 jobs at a time in parallel: + +`ctest -j{{4}} --output-on-failure` + +- Show a list of available tests: + +`ctest -N` + +- Run a single test based on its name, or filter on a regular expression: + +`ctest --output-on-failure -R '^{{test_name}}$'` diff --git a/pages.cn/common/curl.md b/pages.cn/common/curl.md new file mode 100644 index 0000000000..59bd60b2cd --- /dev/null +++ b/pages.cn/common/curl.md @@ -0,0 +1,36 @@ +# curl + +> Transfers data from or to a server. +> Supports most protocols, including HTTP, FTP, and POP3. + +- Download the contents of an URL to a file: + +`curl {{http://example.com}} -o {{filename}}` + +- Download a file, saving the output under the filename indicated by the URL: + +`curl -O {{http://example.com/filename}}` + +- Download a file, following [L]ocation redirects, and automatically [C]ontinuing (resuming) a previous file transfer: + +`curl -O -L -C - {{http://example.com/filename}}` + +- Send form-encoded data (POST request of type `application/x-www-form-urlencoded`): + +`curl -d {{'name=bob'}} {{http://example.com/form}}` + +- Send a request with an extra header, using a custom HTTP method: + +`curl -H {{'X-My-Header: 123'}} -X {{PUT}} {{http://example.com}}` + +- Send data in JSON format, specifying the appropriate content-type header: + +`curl -d {{'{"name":"bob"}'}} -H {{'Content-Type: application/json'}} {{http://example.com/users/1234}}` + +- Pass a user name and password for server authentication: + +`curl -u myusername:mypassword {{http://example.com}}` + +- Pass client certificate and key for a resource, skipping certificate validation: + +`curl --cert {{client.pem}} --key {{key.pem}} --insecure {{https://example.com}}` diff --git a/pages.cn/common/cut.md b/pages.cn/common/cut.md new file mode 100644 index 0000000000..a2605507a2 --- /dev/null +++ b/pages.cn/common/cut.md @@ -0,0 +1,27 @@ +# cut + +> Cut out fields from STDIN or files. + +- Cut out the first sixteen characters of each line of STDIN: + +`cut -c {{1-16}}` + +- Cut out the first sixteen characters of each line of the given files: + +`cut -c {{1-16}} {{file}}` + +- Cut out everything from the 3rd character to the end of each line: + +`cut -c {{3-}}` + +- Cut out the fifth field of each line, using a colon as a field delimiter (default delimiter is tab): + +`cut -d'{{:}}' -f{{5}}` + +- Cut out the 2nd and 10th fields of each line, using a semicolon as a delimiter: + +`cut -d'{{;}}' -f{{2,10}}` + +- Cut out the fields 3 through to the end of each line, using a space as a delimiter: + +`cut -d'{{ }}' -f{{3-}}` diff --git a/pages.cn/common/darkhttpd.md b/pages.cn/common/darkhttpd.md new file mode 100644 index 0000000000..38121e4b5a --- /dev/null +++ b/pages.cn/common/darkhttpd.md @@ -0,0 +1,15 @@ +# darkhttpd + +> Darkhttpd web server. + +- Start server serving the specified document root: + +`darkhttpd {{path/to/docroot}}` + +- Start server on specified port (port 8080 by default if running as non-root user): + +`darkhttpd {{path/to/docroot}} --port {{port}}` + +- Listen only on specified IP address (by default, the server listens on all interfaces): + +`darkhttpd {{path/to/docroot}} --addr {{ip_address}}` diff --git a/pages.cn/common/date.md b/pages.cn/common/date.md new file mode 100644 index 0000000000..577450fc2a --- /dev/null +++ b/pages.cn/common/date.md @@ -0,0 +1,19 @@ +# date + +> Set or display the system date. + +- Display the current date using the default locale's format: + +`date +"%c"` + +- Display the current date in UTC and ISO 8601 format: + +`date -u +"%Y-%m-%dT%H:%M:%SZ"` + +- Display the current date as a Unix timestamp (seconds since the Unix epoch): + +`date +%s` + +- Display a specific date (represented as a Unix timestamp) using the default format: + +`date -d @1473305798` diff --git a/pages.cn/common/dc.md b/pages.cn/common/dc.md new file mode 100644 index 0000000000..b54fc14da8 --- /dev/null +++ b/pages.cn/common/dc.md @@ -0,0 +1,23 @@ +# dc + +> An arbitrary precision calculator. Uses reverse polish notation (RPN). + +- Run calculator in interactive mode: + +`dc` + +- Execute dc script in file: + +`dc -f {{file}}` + +- Calculate 4 times 5 [4 5 *], subtract 17 [17 -], and [p]rint the output (using echo): + +`echo "4 5 * 17 - p"| dc` + +- Set number of decimal places to 7 [7 k], calculate 5 divided by -3 [5 _3 /] and [p]rint (using dc -e): + +`dc -e "7 k 5 _3 / p"` + +- Calculate the golden ratio, phi: Set number of decimal places to 100 [100 k], square root of 5 [5 v] plus 1 [1 +], divided by 2 [2 /], and [p]rint result: + +`dc -e "100 k 5 v 1 + 2 / p"` diff --git a/pages.cn/common/dd.md b/pages.cn/common/dd.md new file mode 100644 index 0000000000..6ac1cd826a --- /dev/null +++ b/pages.cn/common/dd.md @@ -0,0 +1,23 @@ +# dd + +> Convert and copy a file. + +- Make a bootable usb drive from an isohybrid file (such like archlinux-xxx.iso) and show the progress: + +`dd if={{file.iso}} of=/dev/{{usb_drive}} status=progress` + +- Clone a drive to another drive with 4MB block, ignore error and show progress: + +`dd if=/dev/{{source_drive}} of=/dev/{{dest_drive}} bs=4M conv=noerror status=progress` + +- Generate a file of 100 random bytes by using kernel random driver: + +`dd if=/dev/urandom of={{random_file}} bs=100 count=1` + +- Benchmark the write performance of a disk: + +`dd if=/dev/zero of={{file_1GB}} bs=1024 count=1000000` + +- Check progress of an ongoing dd operation (Run this command from another shell): + +`kill -USR1 $(pgrep ^dd)` diff --git a/pages.cn/common/decaffeinate.md b/pages.cn/common/decaffeinate.md new file mode 100644 index 0000000000..bab77eff09 --- /dev/null +++ b/pages.cn/common/decaffeinate.md @@ -0,0 +1,19 @@ +# decaffeinate + +> Move your CoffeeScript source to modern JavaScript. + +- Convert a CoffeeScript file to JavaScript: + +`decaffeinate {{path/to/file.coffee}}` + +- Convert a CoffeeScript v2 file to JavaScript: + +`decaffeinate --use-cs2 {{path/to/file.coffee}}` + +- Convert require and module.exports to import and export: + +`decaffeinate --use-js-modules {{path/to/file.coffee}}` + +- Convert a CoffeeScript, allowing named exports: + +`decaffeinate --loose-js-modules {{path/to/file.coffee}}` diff --git a/pages.cn/common/deluser.md b/pages.cn/common/deluser.md new file mode 100644 index 0000000000..c9d67235fb --- /dev/null +++ b/pages.cn/common/deluser.md @@ -0,0 +1,15 @@ +# deluser + +> Remove a user account or remove a user from a group. + +- Remove a user: + +`deluser {{name}}` + +- Remove a user along with their home directory and mail spool: + +`deluser -r {{name}}` + +- Remove a user from a group: + +`deluser {{name}} {{group}}` diff --git a/pages.cn/common/dep.md b/pages.cn/common/dep.md new file mode 100644 index 0000000000..c49560cc7b --- /dev/null +++ b/pages.cn/common/dep.md @@ -0,0 +1,23 @@ +# dep + +> Tool for dependency management in Go projects. + +- Initialize the current directory as the root of a Go project: + +`dep init` + +- Install any missing dependencies (Scans Gopkg.toml and your .go files): + +`dep ensure` + +- Report the status of the project's dependencies: + +`dep status` + +- Add a dependency to the project: + +`dep ensure -add {{package_url}}` + +- Update the locked versions of all dependencies: + +`dep ensure -update` diff --git a/pages.cn/common/detox.md b/pages.cn/common/detox.md new file mode 100644 index 0000000000..320051d6e8 --- /dev/null +++ b/pages.cn/common/detox.md @@ -0,0 +1,16 @@ +# detox + +> Renames files to make them easier to work with. +> It removes spaces and other such annoyances like duplicate underline characters. + +- Remove spaces and other undesirable characters from a file's name: + +`detox {{file}}` + +- Show how detox would rename all of the files in a directory tree: + +`detox --dry-run -r {{directory}}` + +- Remove spaces and other undesirable characters from all files in a directory tree: + +`detox -r {{directory}}` diff --git a/pages.cn/common/df.md b/pages.cn/common/df.md new file mode 100644 index 0000000000..6d585b28e5 --- /dev/null +++ b/pages.cn/common/df.md @@ -0,0 +1,15 @@ +# df + +> Gives an overview of the file system disk space usage. + +- Display all file systems and their disk usage: + +`df` + +- Display all file systems and their disk usage in human readable form: + +`df -h` + +- Display the file system and its disk usage containing the given file or folder: + +`df {{path/to/file_or_folder}}` diff --git a/pages.cn/common/dhcpwn.md b/pages.cn/common/dhcpwn.md new file mode 100644 index 0000000000..378a006bd4 --- /dev/null +++ b/pages.cn/common/dhcpwn.md @@ -0,0 +1,11 @@ +# dhcpwn + +> Test DHCP IP exhaustion attacks and sniff local DHCP traffic. + +- Flood the network with IP requests: + +`dhcpwn --interface {{network_interface}} flood --count {{number_of_requests}}` + +- Sniff local DHCP traffic: + +`dhcpwn --interface {{network_interface}} sniff` diff --git a/pages.cn/common/diff.md b/pages.cn/common/diff.md new file mode 100644 index 0000000000..12f7d9ac61 --- /dev/null +++ b/pages.cn/common/diff.md @@ -0,0 +1,27 @@ +# diff + +> Compare files and directories. + +- Compare files: + +`diff {{file1}} {{file2}}` + +- Compare files, ignoring white spaces: + +`diff -w {{file1}} {{file2}}` + +- Compare files, showing the differences side by side: + +`diff -y {{file1}} {{file2}}` + +- Compare files, showing the differences in unified format (as used by `git diff`): + +`diff -u {{file1}} {{file2}}` + +- Compare directories recursively: + +`diff -r {{directory1}} {{directory2}}` + +- Compare directories, only showing the names of files that differ: + +`diff -rq {{directory1}} {{directory2}}` diff --git a/pages.cn/common/diffstat.md b/pages.cn/common/diffstat.md new file mode 100644 index 0000000000..65ee4db4bf --- /dev/null +++ b/pages.cn/common/diffstat.md @@ -0,0 +1,11 @@ +# diffstat + +> Create a histogram from the output of the `diff` command. + +- Display changes in a histogram: + +`diff {{file1}} {{file2}} | diffstat` + +- Display inserted, deleted and modified changes as a table: + +`diff {{file1}} {{file2}} | diffstat -t` diff --git a/pages.cn/common/dig.md b/pages.cn/common/dig.md new file mode 100644 index 0000000000..ce29aef261 --- /dev/null +++ b/pages.cn/common/dig.md @@ -0,0 +1,31 @@ +# dig + +> DNS Lookup utility. + +- Lookup the IP(s) associated with a hostname (A records): + +`dig +short {{hostname.com}}` + +- Lookup the mail server(s) associated with a given domain name (MX record): + +`dig +short {{hostname.com}} MX` + +- Get all types of records for a given domain name: + +`dig {{hostname.com}} ANY` + +- Specify an alternate DNS server to query: + +`dig @{{8.8.8.8}} {{hostname.com}}` + +- Perform a reverse DNS lookup on an IP address (PTR record): + +`dig -x {{8.8.8.8}}` + +- Find authoritative name servers for the zone and display SOA records: + +`dig +nssearch {{hostname.com}}` + +- Perform iterative queries and display the entire trace path to resolve a domain name: + +`dig +trace {{hostname.com}}` diff --git a/pages.cn/common/dircolors.md b/pages.cn/common/dircolors.md new file mode 100644 index 0000000000..2f48d073c8 --- /dev/null +++ b/pages.cn/common/dircolors.md @@ -0,0 +1,23 @@ +# dircolors + +> Output commands to set the LS_COLOR environment variable and style `ls`, `dir`, etc. + +- Output commands to set LS_COLOR using default colors: + +`dircolors` + +- Output commands to set LS_COLOR using colors from a file: + +`dircolors {{file}}` + +- Output commands for Bourne shell: + +`dircolors --bourne-shell` + +- Output commands for C shell: + +`dircolors --c-shell` + +- View the default colors for file types and extensions: + +`dircolors --print-data` diff --git a/pages.cn/common/dirname.md b/pages.cn/common/dirname.md new file mode 100644 index 0000000000..7aaa75fd61 --- /dev/null +++ b/pages.cn/common/dirname.md @@ -0,0 +1,15 @@ +# dirname + +> Calculates the parent directory of a given file or directory path. + +- Calculate the parent directory of a given path: + +`dirname {{path/to/file_or_directory}}` + +- Calculate the parent directory of multiple paths: + +`dirname {{path/to/file_a}} {{path/to/directory_b}}` + +- Delimit output with a NUL character instead of a newline (useful when combining with `xargs`): + +`dirname --zero {{path/to/directory_a}} {{path/to/file_b}}` diff --git a/pages.cn/common/dirs.md b/pages.cn/common/dirs.md new file mode 100644 index 0000000000..b2ca5a52b4 --- /dev/null +++ b/pages.cn/common/dirs.md @@ -0,0 +1,20 @@ +# dirs + +> Displays or manipulates the directory stack. +> The directory stack is a list of recently visited directories that can be manipulated with the `pushd` and `popd` commands. + +- Display the directory stack with a space between each entry: + +`dirs` + +- Display the directory stack with one entry per line: + +`dirs -p` + +- Display only the nth entry in the directory stack, starting at 0: + +`dirs +{{N}}` + +- Clear the directory stack: + +`dirs -c` diff --git a/pages.cn/common/dive.md b/pages.cn/common/dive.md new file mode 100644 index 0000000000..73ac73b2b4 --- /dev/null +++ b/pages.cn/common/dive.md @@ -0,0 +1,11 @@ +# dive + +> A tool for exploring a Docker image, layer contents, and discovering ways to shrink it. + +- Analyze a Docker image: + +`dive {{your_image_tag}}` + +- Build an image and start analyzing it: + +`dive build -t {{some_tag}}` diff --git a/pages.cn/common/docker-compose.md b/pages.cn/common/docker-compose.md new file mode 100644 index 0000000000..b3635bbc76 --- /dev/null +++ b/pages.cn/common/docker-compose.md @@ -0,0 +1,27 @@ +# docker-compose + +> Run and manage multi container docker applications. + +- Create and start all containers in the background using a `docker-compose.yml` file from the current directory: + +`docker-compose up -d` + +- Start all containers, rebuild if necessary: + +`docker-compose up --build` + +- Start all containers using an alternate compose file: + +`docker-compose --file {{path/to/file}} up` + +- Stop all running containers: + +`docker-compose stop` + +- Stop and remove all containers, networks, images, and volumes: + +`docker-compose down` + +- Follow logs for all containers: + +`docker-compose logs --follow` diff --git a/pages.cn/common/docker-machine.md b/pages.cn/common/docker-machine.md new file mode 100644 index 0000000000..1caf9d9616 --- /dev/null +++ b/pages.cn/common/docker-machine.md @@ -0,0 +1,27 @@ +# docker-machine + +> Create and manage machines running Docker. + +- List currently running docker machines: + +`docker-machine ls` + +- Create a new docker machine with specific name: + +`docker-machine create {{name}}` + +- Get the status of a machine: + +`docker-machine status {{name}}` + +- Start a machine: + +`docker-machine start {{name}}` + +- Stop a machine: + +`docker-machine stop {{name}}` + +- Inspect information about a machine: + +`docker-machine inspect {{name}}` diff --git a/pages.cn/common/docker.md b/pages.cn/common/docker.md new file mode 100644 index 0000000000..902576ae52 --- /dev/null +++ b/pages.cn/common/docker.md @@ -0,0 +1,35 @@ +# docker + +> Manage Docker containers and images. + +- List currently running docker containers: + +`docker ps` + +- List all docker containers (running and stopped): + +`docker ps -a` + +- Start a container from an image, with a custom name: + +`docker run --name {{container_name}} {{image}}` + +- Start or stop an existing container: + +`docker {{start|stop}} {{container_name}}` + +- Pull an image from a docker registry: + +`docker pull {{image}}` + +- Open a shell inside of an already running container: + +`docker exec -it {{container_name}} {{sh}}` + +- Remove a stopped container: + +`docker rm {{container_name}}` + +- Fetch and follow the logs of a container: + +`docker logs -f {{container_name}}` diff --git a/pages.cn/common/dokku.md b/pages.cn/common/dokku.md new file mode 100644 index 0000000000..fec46e75f8 --- /dev/null +++ b/pages.cn/common/dokku.md @@ -0,0 +1,24 @@ +# dokku + +> Docker powered mini-Heroku (PaaS). +> Easily deploy multiple apps to your server in different languages using a single `git-push` command. + +- List runinng apps: + +`dokku apps` + +- Create an app: + +`dokku apps:create {{app_name}}` + +- Remove an app: + +`dokku apps:destroy {{app_name}}` + +- Install plugin: + +`dokku plugin:install {{full_repo_url}}` + +- Link database to an app: + +`dokku {{db}}:link {{db_name}} {{app_name}}` diff --git a/pages.cn/common/dot.md b/pages.cn/common/dot.md new file mode 100644 index 0000000000..89329588df --- /dev/null +++ b/pages.cn/common/dot.md @@ -0,0 +1,11 @@ +# dot + +> A command-line tool to produce layered drawings of directed graphs. + +- Render an image file and determine output filename based on input filename and selected format: + +`dot -Tpng -O {{path/to/file.dot}}` + +- Create an SVG from DOT file: + +`dot -Tsvg -o {{path/to/out_file.svg}} {{path/to/file.dot}}` diff --git a/pages.cn/common/dotnet.md b/pages.cn/common/dotnet.md new file mode 100644 index 0000000000..d2a8a3cbdd --- /dev/null +++ b/pages.cn/common/dotnet.md @@ -0,0 +1,19 @@ +# dotnet + +> Cross platform .NET command line tools for .NET Core. + +- Initialize a new .NET project: + +`dotnet new {{template_short_name}}` + +- Restore nuget packages: + +`dotnet restore` + +- Build and execute the .NET project in the current directory: + +`dotnet run` + +- Run a packaged dotnet application (only needs the runtime, the rest of the commands require the .NET Core SDK installed): + +`dotnet {{path/to/application.dll}}` diff --git a/pages.cn/common/doxygen.md b/pages.cn/common/doxygen.md new file mode 100644 index 0000000000..e5b75ac57c --- /dev/null +++ b/pages.cn/common/doxygen.md @@ -0,0 +1,15 @@ +# doxygen + +> A documentation system for various programming languages. + +- Generate a default template configuration file "Doxyfile": + +`doxygen -g` + +- Generate a template configuration file: + +`doxygen -g {{path/to/config_file}}` + +- Generate documentation using an existing configuration file: + +`doxygen {{path/to/config_file}}` diff --git a/pages.cn/common/drill.md b/pages.cn/common/drill.md new file mode 100644 index 0000000000..e84b063240 --- /dev/null +++ b/pages.cn/common/drill.md @@ -0,0 +1,31 @@ +# drill + +> Perform various DNS queries. + +- Lookup the IP(s) associated with a hostname (A records): + +`drill {{hostname.com}}` + +- Lookup the mail server(s) associated with a given domain name (MX record): + +`drill mx {{hostname.com}}` + +- Get all types of records for a given domain name: + +`drill any {{hostname.com}}` + +- Specify an alternate DNS server to query: + +`drill {{hostname.com}} @{{8.8.8.8}}` + +- Perform a reverse DNS lookup on an IP address (PTR record): + +`drill -x {{8.8.8.8}}` + +- Perform DNSSEC trace from root servers down to a domain name: + +`drill -TD {{hostname.com}}` + +- Show DNSKEY record(s) for a domain name: + +`drill -s dnskey {{hostname.com}}` diff --git a/pages.cn/common/drush.md b/pages.cn/common/drush.md new file mode 100644 index 0000000000..047b470b60 --- /dev/null +++ b/pages.cn/common/drush.md @@ -0,0 +1,27 @@ +# drush + +> A command-line shell and scripting interface for Drupal. + +- Download module "foo": + +`drush dl {{foo}}` + +- Download version 7.x-2.1-beta1 of module "foo": + +`drush dl {{foo}}-7.x-2.1-beta1` + +- Enable module "foo": + +`drush en {{foo}}` + +- Disable module "foo": + +`drush dis {{foo}}` + +- Clear all caches: + +`drush cc all` + +- Clear CSS and JavaScript caches: + +`drush cc css-js` diff --git a/pages.cn/common/du.md b/pages.cn/common/du.md new file mode 100644 index 0000000000..55474e3273 --- /dev/null +++ b/pages.cn/common/du.md @@ -0,0 +1,27 @@ +# du + +> Disk usage: estimate and summarize file and folder space usage. + +- List the sizes of a folder and any subfolders, in the given unit (B/KB/MB): + +`du -{{b|k|m}} {{path/to/folder}}` + +- List the sizes of a folder and any subfolders, in human-readable form (i.e. auto-selecting the appropriate unit for each size): + +`du -h {{path/to/folder}}` + +- Show the size of a single folder, in human readable units: + +`du -sh {{path/to/folder}}` + +- List the human-readable sizes of a folder and of all the files and folders within it: + +`du -ah {{path/to/folder}}` + +- List the human-readable sizes of a folder and any subfolders, up to N levels deep: + +`du -h --max-depth=N {{path/to/folder}}` + +- List the human-readable size of all .jpg files in subfolders of the current folder, and show a cumulative total at the end: + +`du -ch */*.jpg` diff --git a/pages.cn/common/duplicity.md b/pages.cn/common/duplicity.md new file mode 100644 index 0000000000..74cbb52aed --- /dev/null +++ b/pages.cn/common/duplicity.md @@ -0,0 +1,28 @@ +# duplicity + +> Creates incremental, compressed, encrypted and versioned backups. +> Can also upload the backups to a variety of backend services. + +- Backup a folder via FTPS to a remote machine, encrypting it with a password: + +`FTP_PASSWORD={{ftp_login_password}} PASSPHRASE={{encryption_password}} duplicity {{path/to/source/directory}} {{ftps://user@hostname/target/directory/path/}}` + +- Backup a folder to Amazon S3, doing a full backup every month: + +`duplicity --full-if-older-than {{1M}} --use-new-style s3://{{bucket_name[/prefix]}}` + +- Delete versions older than 1 year from a backup stored on a WebDAV share: + +`FTP_PASSWORD={{webdav_login_password}} duplicity remove-older-than {{1Y}} --force {{webdav[s]://user@hostname[:port]/some_dir}}` + +- List the available backups: + +`duplicity collection-status "file://{{absolute/path/to/backup/folder}}"` + +- List the files in a backup stored on a remote machine, via ssh: + +`duplicity list-current-files --time {{YYYY-MM-DD}} scp://{{user@hostname}}/path/to/backup/dir` + +- Restore a subdirectory from a GnuPG-encrypted local backup to a given location: + +`PASSPHRASE={{gpg_key_password}} duplicity restore --encrypt-key {{gpg_key_id}} --file-to-restore {{relative/path/restorefolder}} file://{{absolute/path/to/backup/folder}} {{path/to/directory/to/restore/to}}` diff --git a/pages.cn/common/ebook-convert.md b/pages.cn/common/ebook-convert.md new file mode 100644 index 0000000000..9324718016 --- /dev/null +++ b/pages.cn/common/ebook-convert.md @@ -0,0 +1,8 @@ +# ebook-convert + +> Can be used to convert ebooks between common formats, e.g., pdf, epub and mobi. +> Part of the Calibre ebook library tool. + +- Convert an ebook into another format: + +`ebook-convert {{source}} {{destination}}` diff --git a/pages.cn/common/echo.md b/pages.cn/common/echo.md new file mode 100644 index 0000000000..dfce20af3e --- /dev/null +++ b/pages.cn/common/echo.md @@ -0,0 +1,19 @@ +# echo + +> Print given arguments. + +- Print a text message. Note: quotes are optional: + +`echo {{"Hello World"}}` + +- Print a message with environment variables: + +`echo {{"My path is $PATH"}}` + +- Print a message without the trailing newline: + +`echo -n {{"Hello World"}}` + +- Enable interpretation of backslash escapes (special characters): + +`echo -e {{"Column 1\tColumn 2"}}` diff --git a/pages.cn/common/ed.md b/pages.cn/common/ed.md new file mode 100644 index 0000000000..f5c14ac9b4 --- /dev/null +++ b/pages.cn/common/ed.md @@ -0,0 +1,35 @@ +# ed + +> The original Unix text editor. + +- Start ed, editing an empty document (which can be saved as a new file in the current directory): + +`ed` + +- Start ed, editing an empty document, with `:` as a command prompt indicator: + +`ed -p :` + +- Start ed editing an existing file (this shows the byte count of the loaded file): + +`ed -p : {{path/to/file}}` + +- Toggle the printing of error explanations. (By default, explanations are not printed and only a `?` appears): + +`H` + +- Add text to the current document. Mark completion by entering a period by itself in a new line: + +`a{{text_to_insert}}.` + +- Print the entire document (`,` is a shortcut to the range `1,$` which covers the start to the end of the document): + +`,p` + +- Write the current document to a new file (the filename can be omitted if `ed` was called with an existing file): + +`w {{filename}}` + +- Quit ed: + +`q` diff --git a/pages.cn/common/electrum.md b/pages.cn/common/electrum.md new file mode 100644 index 0000000000..19003fdacd --- /dev/null +++ b/pages.cn/common/electrum.md @@ -0,0 +1,31 @@ +# electrum + +> Ergonomic Bitcoin wallet and private key management. + +- Create a new wallet: + +`electrum -w {{new_wallet.dat}} create` + +- Restore an existing wallet from seed offline: + +`electrum -w {{recovery_wallet.dat}} restore -o` + +- Create a signed transaction offline: + +`electrum mktx {{recipient}} {{amount}} -f 0.0000001 -F {{from}} -o` + +- Display all wallet receiving addresses: + +`electrum listaddresses -a` + +- Sign a message: + +`electrum signmessage {{address}} {{message}}` + +- Verify a message: + +`electrum verifymessage {{address}} {{signature}} {{message}}` + +- Connect only to a specific electrum-server instance: + +`electrum -p socks5:{{127.0.0.1}}:9050 -s {{56ckl5obj37gypcu.onion}}:50001:t -1` diff --git a/pages.cn/common/elinks.md b/pages.cn/common/elinks.md new file mode 100644 index 0000000000..62b45a5157 --- /dev/null +++ b/pages.cn/common/elinks.md @@ -0,0 +1,15 @@ +# elinks + +> A text based browser similar to lynx. + +- Start elinks: + +`elinks` + +- Quit elinks: + +`Ctrl + C` + +- Dump output of webpage to console, colorizing the text with ANSI control codes: + +`elinks -dump -dump-color-mode {{1}} {{url}}` diff --git a/pages.cn/common/elm.md b/pages.cn/common/elm.md new file mode 100644 index 0000000000..417f3d5307 --- /dev/null +++ b/pages.cn/common/elm.md @@ -0,0 +1,15 @@ +# elm + +> Run and manage programs in Elm programming language. + +- Start an interactive Elm shell (REPL): + +`elm --repl` + +- Initialize an empty Elm project: + +`elm --init` + +- Compile the current project and serve it via the local web server: + +`elm --reactor` diff --git a/pages.cn/common/emacs.md b/pages.cn/common/emacs.md new file mode 100644 index 0000000000..30a3415f17 --- /dev/null +++ b/pages.cn/common/emacs.md @@ -0,0 +1,15 @@ +# emacs + +> The extensible, customizable, self-documenting, real-time display editor. + +- Open emacs in console mode (without X window): + +`emacs -nw` + +- Open a file in emacs: + +`emacs {{filename}}` + +- Exit emacs: + +`C-x C-c` diff --git a/pages.cn/common/emacsclient.md b/pages.cn/common/emacsclient.md new file mode 100644 index 0000000000..9f3e2ddc8c --- /dev/null +++ b/pages.cn/common/emacsclient.md @@ -0,0 +1,15 @@ +# emacsclient + +> Open files in an existing emacs server. + +- Open files in an existing Emacs server (using GUI if available): + +`emacsclient {{filename}}` + +- Open file in console mode (without X window): + +`emacsclient -nw {{filename}}` + +- Open a file in an existing emacs frame and return immediately: + +`emacsclient -n {{filename}}` diff --git a/pages.cn/common/ember.md b/pages.cn/common/ember.md new file mode 100644 index 0000000000..4e08f47eed --- /dev/null +++ b/pages.cn/common/ember.md @@ -0,0 +1,36 @@ +# ember + +> The Ember.js command line utility. +> Used for creating and maintaining Ember.js applications. + +- Create a new Ember application: + +`ember new {{my_new_app}}` + +- Create a new Ember addon: + +`ember addon {{my_new_addon}}` + +- Build the project: + +`ember build` + +- Build the project in production mode: + +`ember build -prod` + +- Run the development server: + +`ember serve` + +- Run the test suite: + +`ember test` + +- Run a blueprint to generate something like a route or component: + +`ember generate {{type}} {{name}}` + +- Install an ember-cli addon: + +`ember install {{name_of_addon}}` diff --git a/pages.cn/common/enca.md b/pages.cn/common/enca.md new file mode 100644 index 0000000000..eb63b7ab93 --- /dev/null +++ b/pages.cn/common/enca.md @@ -0,0 +1,19 @@ +# enca + +> Detect and convert encoding of text files. + +- Detect file(s) encoding according to your system's locale: + +`enca {{file(s)}}` + +- Detect file(s) encoding; -L option tells enca the current language; language is in the POSIX/C locale format, e.g. zh_CN, en_US etc: + +`enca -L {{language}} {{file(s)}}` + +- Convert file(s) to specified encoding: + +`enca -L {{language}} -x {{to_encoding}} {{file(s)}}` + +- Save original_file as new_file and convert new_file to specified encoding: + +`enca -L {{language}} -x {{to_encoding}} < {{original_file}} > {{new_file}}` diff --git a/pages.cn/common/enscript.md b/pages.cn/common/enscript.md new file mode 100644 index 0000000000..4a7b1f0a0a --- /dev/null +++ b/pages.cn/common/enscript.md @@ -0,0 +1,23 @@ +# enscript + +> A tool to convert text files to PostScript, HTML, RTF, ANSI, and overstrikes. + +- Generate PostScript from a file and output to another: + +`enscript {{path/to/input_file}} --output={{path/to/output_file}}` + +- Generate a certain output language (eg. "html") from a file and output to another: + +`enscript {{path/to/input_file}} --language={{language}} --output={{path/to/output_file}}` + +- Generate PostScript from a file and output to another with 1 to 9 column per page in landscape: + +`enscript {{path/to/input_file}} --columns={{num}} --landscape --output={{path/to/output_file}}` + +- Display available syntax highlighting: + +`enscript --help-highlight` + +- Generate PostScript from a file and output to another with syntax highlighting and color for a specified language: + +`enscript {{path/to/input_file}} --color=1 --highlight={{language}} --output={{path/to/output_file}}` diff --git a/pages.cn/common/env.md b/pages.cn/common/env.md new file mode 100644 index 0000000000..a6a8c66b57 --- /dev/null +++ b/pages.cn/common/env.md @@ -0,0 +1,23 @@ +# env + +> Show the environment or run a program in a modified environment. + +- Show the environment: + +`env` + +- Run a program. Often used in scripts after the shebang (#!) for looking up the path to the program: + +`env {{program}}` + +- Clear the environment and run a program: + +`env -i {{program}}` + +- Remove variable from the environment and run a program: + +`env -u {{variable}} {{program}}` + +- Set a variable and run a program: + +`env {{variable}}={{value}} {{program}}` diff --git a/pages.cn/common/erl.md b/pages.cn/common/erl.md new file mode 100644 index 0000000000..db629759b0 --- /dev/null +++ b/pages.cn/common/erl.md @@ -0,0 +1,15 @@ +# erl + +> Run and manage programs in the Erlang programming language. + +- Compile and run sequential Erlang program as a common script and then exit: + +`erlc {{files}} && erl -noshell '{{mymodule:myfunction(arguments)}}, init:stop().'` + +- Connect to a running Erlang node: + +`erl -remsh {{nodename}}@{{hostname}} -sname {{custom_shortname}} -hidden -setcookie {{cookie_of_remote_node}}` + +- Tell the Erlang shell to load modules from a directory: + +`erl -pa {{directory_with_beam_files}}` diff --git a/pages.cn/common/eslint.md b/pages.cn/common/eslint.md new file mode 100644 index 0000000000..b0bbe5a187 --- /dev/null +++ b/pages.cn/common/eslint.md @@ -0,0 +1,19 @@ +# eslint + +> A pluggable linting utility for JavaScript and JSX. + +- Create eslint config: + +`eslint --init` + +- Lint on a given set of files: + +`eslint {{filename}}.js {{filename1}}.js` + +- Fix lint issues: + +`eslint --fix` + +- Lint with config: + +`eslint -c {{path/to/config_file}} {{app/src}}` diff --git a/pages.cn/common/espeak.md b/pages.cn/common/espeak.md new file mode 100644 index 0000000000..b803f04818 --- /dev/null +++ b/pages.cn/common/espeak.md @@ -0,0 +1,19 @@ +# espeak + +> Uses text-to-speech to speak through the default sound device. + +- Speak a phrase aloud: + +`espeak "I like to ride my bike."` + +- Speak a file aloud: + +`espeak -f {{filename}}` + +- Save output to a WAV audio file, rather than speaking it directly: + +`espeak -w {{filename.wav}} "It's GNU plus Linux"` + +- Use a different voice: + +`espeak -v {{voice}}` diff --git a/pages.cn/common/exa.md b/pages.cn/common/exa.md new file mode 100644 index 0000000000..721d41c5f3 --- /dev/null +++ b/pages.cn/common/exa.md @@ -0,0 +1,27 @@ +# exa + +> A modern replacement for `ls` (List directory contents). + +- List files one per line: + +`exa --oneline` + +- List all files, including hidden files: + +`exa --all` + +- Long format list (permissions, ownership, size and modification date) of all files: + +`exa --long --all` + +- List files with the largest at the top: + +`exa --reverse --sort={{size}}` + +- Display a tree of files, three levels deep: + +`exa --long --tree --level={{3}}` + +- List files sorted by modification date (oldest first): + +`exa --long --sort={{modified}}` diff --git a/pages.cn/common/exiftool.md b/pages.cn/common/exiftool.md new file mode 100644 index 0000000000..d3ea225090 --- /dev/null +++ b/pages.cn/common/exiftool.md @@ -0,0 +1,23 @@ +# exiftool + +> Read and write meta information in files. + +- Remove all EXIF metadata from the given files: + +`exiftool -All= {{file}}` + +- Increase time photo taken by 1 hour in directory: + +`exiftool "-AllDates+=0:0:0 1:0:0" {{directory}}` + +- Decrease time photo taken by 1 day and 2 hours on JPEGs only: + +`exiftool "-AllDates-=0:0:1 2:0:0" -ext jpg` + +- Change only DateTimeOriginal by -1.5 hours & do not keep backups: + +`exiftool -DateTimeOriginal-=1.5 -overwrite_original` + +- Rename all JPEGs according to a DateTimeOriginal recursively: + +`exiftool '-filename Convert tabs to spaces. + +- Convert tabs in each file to spaces, writing to standard output: + +`expand {{file}}` + +- Convert tabs to spaces, reading from standard input: + +`expand` + +- Do not convert tabs after non blanks: + +`expand -i {{file}}` + +- Have tabs a certain number of characters apart, not 8: + +`expand -t={{number}} {{file}}` + +- Use comma separated list of explicit tab positions: + +`expand -t={{list}}` diff --git a/pages.cn/common/expr.md b/pages.cn/common/expr.md new file mode 100644 index 0000000000..14912e9ee8 --- /dev/null +++ b/pages.cn/common/expr.md @@ -0,0 +1,23 @@ +# expr + +> Evaluate expressions and manipulate strings. + +- Get string length: + +`expr length {{string}}` + +- Evaluate logical or math expression with an operator ('+', '-', '*', '&', '|', etc.). Special symbols should be escaped: + +`expr {{first_argument}} {{operator}} {{second_argument}}` + +- Get position of the first character in 'string' that matches 'substring': + +`echo $(expr index {{string}} {{substring}})` + +- Extract part of the string: + +`echo $(expr substr {{string}} {{position_to_start}} {{number_of_characters}}` + +- Extract part of the string which matches a regular expression: + +`echo $(expr {{string}} : '\({{regular_expression}}\)')` diff --git a/pages.cn/common/factor.md b/pages.cn/common/factor.md new file mode 100644 index 0000000000..80e04fdeba --- /dev/null +++ b/pages.cn/common/factor.md @@ -0,0 +1,11 @@ +# factor + +> Prints the prime factorization of a number. + +- Display the prime-factorization of a number: + +`factor {{number}}` + +- Take the input from stdin if no argument is specified: + +`echo {{number}} | factor` diff --git a/pages.cn/common/false.md b/pages.cn/common/false.md new file mode 100644 index 0000000000..8ec51fd834 --- /dev/null +++ b/pages.cn/common/false.md @@ -0,0 +1,7 @@ +# false + +> Returns an exit code of 1. + +- Return an exit code of 1: + +`false` diff --git a/pages.cn/common/fastboot.md b/pages.cn/common/fastboot.md new file mode 100644 index 0000000000..800476bb77 --- /dev/null +++ b/pages.cn/common/fastboot.md @@ -0,0 +1,27 @@ +# fastboot + +> Communicate with connected Android devices when in bootloader mode (the one place `adb` doesn't work). + +- Unlock the bootloader: + +`fastboot oem unlock` + +- Relock the bootloader: + +`fastboot oem lock` + +- Reboot the device from fastboot mode into fastboot mode again: + +`fastboot reboot bootloader` + +- Flash a given image: + +`fastboot flash {{file.zip}}` + +- Flash a custom recovery image: + +`fastboot flash recovery {{file.img}}` + +- Display connected devices: + +`fastboot devices` diff --git a/pages.cn/common/fd.md b/pages.cn/common/fd.md new file mode 100644 index 0000000000..a0eede896c --- /dev/null +++ b/pages.cn/common/fd.md @@ -0,0 +1,23 @@ +# fd + +> A simple, fast and user-friendly alternative to find. + +- Find files under current directory that match a pattern: + +`fd {{pattern}}` + +- Find files that begin with foo: + +`fd {{'^foo'}}` + +- Find files with a specific extension: + +`fd --extension {{.ext}} {{pattern}}` + +- Find files under a specific directory: + +`fd {{pattern}} {{path/to/dir}}` + +- Include ignored and hidden files in search: + +`fd --hidden --no-ignore {{pattern}}` diff --git a/pages.cn/common/fdupes.md b/pages.cn/common/fdupes.md new file mode 100644 index 0000000000..f36c033192 --- /dev/null +++ b/pages.cn/common/fdupes.md @@ -0,0 +1,19 @@ +# fdupes + +> Finds duplicate files in a given set of directories. + +- Search a single directory: + +`fdupes {{directory}}` + +- Search multiple directories: + +`fdupes {{directory1}} {{directory2}}` + +- Search all directories recursively: + +`fdupes -r {{directory}}` + +- Search multiple directories, one recursively: + +`fdupes {{directory1}} -R {{directory2}}` diff --git a/pages.cn/common/ffmpeg.md b/pages.cn/common/ffmpeg.md new file mode 100644 index 0000000000..24f98560c8 --- /dev/null +++ b/pages.cn/common/ffmpeg.md @@ -0,0 +1,35 @@ +# ffmpeg + +> Video conversion tool. + +- Extract the sound from a video and save it as MP3: + +`ffmpeg -i {{video.mp4}} -vn {{sound}}.mp3` + +- Convert frames from a video or GIF into individual numbered images: + +`ffmpeg -i {{video.mpg|video.gif}} {{frame_%d.png}}` + +- Combine numbered images (frame_1.jpg, frame_2.jpg, etc) into a video or GIF: + +`ffmpeg -i {{frame_%d.jpg}} -f image2 {{video.mpg|video.gif}}` + +- Quickly extract a single frame from a video at time mm:ss and save it as a 128x128 resolution image: + +`ffmpeg -ss {{mm:ss}} -i {{video.mp4}} -frames 1 -s {{128x128}} -f image2 {{image.png}}` + +- Trim a video from a given start time mm:ss to an end time mm2:ss2 (omit the -to flag to trim till the end): + +`ffmpeg -ss {{mm:ss}} -to {{mm2:ss2}} -i {{video.mp4}} -codec copy {{output.mp4}}` + +- Convert AVI video to MP4. AAC Audio @ 128kbit, h264 Video @ CRF 23: + +`ffmpeg -i {{input_video}}.avi -codec:audio aac -b:audio 128k -codec:video libx264 -crf 23 {{output_video}}.mp4` + +- Remux MKV video to MP4 without re-encoding audio or video streams: + +`ffmpeg -i {{input_video}}.mkv -codec copy {{output_video}}.mp4` + +- Convert MP4 video to VP9 codec. For the best quality, use a CRF value (recommended range 15-35) and -b:video MUST be 0: + +`ffmpeg -i {{input_video}}.mp4 -codec:video libvpx-vp9 -crf {{30}} -b:video 0 -codec:audio libopus -vbr on -threads {{number_of_threads}} {{output_video}}.webm` diff --git a/pages.cn/common/ffprobe.md b/pages.cn/common/ffprobe.md new file mode 100644 index 0000000000..dbc71bc98c --- /dev/null +++ b/pages.cn/common/ffprobe.md @@ -0,0 +1,23 @@ +# ffprobe + +> Multimedia stream analyzer. + +- Display all available stream info for a media file: + +`ffprobe -v error -show_entries {{input.mp4}}` + +- Display media duration: + +`ffprobe -v error -show_entries format=duration -of default=noprint_wrappers=1:nokey=1 {{input.mp4}}` + +- Display the frame rate of a video: + +`ffprobe -v error -select_streams v:0 -show_entries stream=avg_frame_rate -of default=noprint_wrappers=1:nokey=1 {{input.mp4}}` + +- Display the width or height of a video: + +`ffprobe -v error -select_streams v:0 -show_entries stream={{width|height}} -of default=noprint_wrappers=1:nokey=1 {{input.mp4}}` + +- Display the average bit rate of a video: + +`ffprobe -v error -select_streams v:0 -show_entries stream=bit_rate -of default=noprint_wrappers=1:nokey=1 {{input.mp4}}` diff --git a/pages.cn/common/fg.md b/pages.cn/common/fg.md new file mode 100644 index 0000000000..f4fbe6c4da --- /dev/null +++ b/pages.cn/common/fg.md @@ -0,0 +1,11 @@ +# fg + +> Run jobs in foreground. + +- Bring most recently suspended background job to foreground: + +`fg` + +- Bring a specific job to foreground: + +`fg {{job_id}}` diff --git a/pages.cn/common/find.md b/pages.cn/common/find.md new file mode 100644 index 0000000000..25aa5b4541 --- /dev/null +++ b/pages.cn/common/find.md @@ -0,0 +1,39 @@ +# find + +> Find files or directories under the given directory tree, recursively. + +- Find files by extension: + +`find {{root_path}} -name '{{*.ext}}'` + +- Find files by matching multiple patterns: + +`find {{root_path}} -name '{{*pattern_1*}}' -or -name '{{*pattern_2*}}'` + +- Find directories matching a given name: + +`find {{root_path}} -type d -name {{*lib*}}` + +- Find files matching path pattern: + +`find {{root_path}} -path '{{**/lib/**/*.ext}}'` + +- Run a command for each file, use {} within the command to access the filename: + +`find {{root_path}} -name '{{*.ext}}' -exec {{wc -l {} }}\;` + +- Find files modified in the last 24-hour period: + +`find {{root_path}} -mtime {{-1}}` + +- Find files using case insensitive name matching, of a certain size: + +`find {{root_path}} -size {{+500k}} -size {{-10M}} -iname '{{*.TaR.gZ}}'` + +- Delete files by name, older than 180 days: + +`find {{root_path}} -name '{{*.ext}}' -mtime {{+180}} -delete` + +- Find files matching a given pattern, while excluding specific paths: + +`find {{root_path}} -name '{{*.py}}' -not -path '{{*/site-packages/*}}'` diff --git a/pages.cn/common/finger.md b/pages.cn/common/finger.md new file mode 100644 index 0000000000..18eb7d00e3 --- /dev/null +++ b/pages.cn/common/finger.md @@ -0,0 +1,23 @@ +# finger + +> User information lookup program. + +- Display information about currently logged in users: + +`finger` + +- Display information about a specific user: + +`finger {{username}}` + +- Display the user's login name, real name, terminal name, and other information: + +`finger -s` + +- Produce multi-line output format displaying same information as `-s` as well as user's home directory, home phone number, login shell, mail status, etc.: + +`finger -l` + +- Prevent matching against user's names and only use login names: + +`finger -m` diff --git a/pages.cn/common/fish.md b/pages.cn/common/fish.md new file mode 100644 index 0000000000..bd2a053c5c --- /dev/null +++ b/pages.cn/common/fish.md @@ -0,0 +1,24 @@ +# fish + +> The Friendly Interactive SHell. +> A command-line interpreter designed to be user friendly. + +- Start interactive shell: + +`fish` + +- Execute a command: + +`fish -c "{{command}}"` + +- Run commands from a file: + +`fish {{file.fish}}` + +- Check a file for syntax errors: + +`fish --no-execute {{file.fish}}` + +- Display version information and exit: + +`fish --version` diff --git a/pages.cn/common/fisher.md b/pages.cn/common/fisher.md new file mode 100644 index 0000000000..2d97e0c6c5 --- /dev/null +++ b/pages.cn/common/fisher.md @@ -0,0 +1,32 @@ +# fisher + +> Fisher, a fish-shell plugin manager. +> Install plugins by name or from a managed 'fishfile' for bundled installs. + +- Install one or more plugins: + +`fisher {{plugin1}} {{plugin2}}` + +- Install a plugin from a GitHub gist: + +`fisher {{gist_url}}` + +- Edit 'fishfile' by hand with your favorite editor and install multiple plugins: + +`{{editor}} ~/.config/fish/fishfile; fisher` + +- List installed plugins: + +`fisher ls` + +- Show available plugins: + +`fisher ls-remote` + +- Update plugins: + +`fisher up` + +- Remove one or more plugins: + +`fisher rm {{plugin1}} {{plugin2}}` diff --git a/pages.cn/common/fkill.md b/pages.cn/common/fkill.md new file mode 100644 index 0000000000..5089b60083 --- /dev/null +++ b/pages.cn/common/fkill.md @@ -0,0 +1,11 @@ +# fkill + +> Fabulously kill processes. Cross-platform. + +- Run without arguments to use the interactive interface: + +`fkill` + +- Kill the process by pid, name or port: + +`fkill {{pid|name|:port}}` diff --git a/pages.cn/common/flac.md b/pages.cn/common/flac.md new file mode 100644 index 0000000000..9c6c99e754 --- /dev/null +++ b/pages.cn/common/flac.md @@ -0,0 +1,19 @@ +# flac + +> Encodes, decodes and tests flac files. + +- Encode a wav file to flac (this will create a flac file in the same location as the wav file): + +`flac {{path/to/file.wav}}` + +- Encode a wav file to flac, specifying the output file: + +`flac -o {{path/to/output.flac}} {{path/to/file.wav}}` + +- Decode a flac file to wav, specifying the output file: + +`flac -d -o {{path/to/output.wav}} {{path/to/file.flac}}` + +- Test a flac file for the correct encoding: + +`flac -t {{path/to/file.flac}}` diff --git a/pages.cn/common/flex.md b/pages.cn/common/flex.md new file mode 100644 index 0000000000..8c67c07c09 --- /dev/null +++ b/pages.cn/common/flex.md @@ -0,0 +1,16 @@ +# flex + +> Lexical analyser generator. Based on `lex`. +> Given the specification for a lexical analyser, generates C code implementing it. + +- Generate an analyser from a flex file: + +`flex {{analyser.l}}` + +- Specify the output file: + +`flex {{analyser.l}} --outfile {{analyser.c}}` + +- Compile a C file generated by flex: + +`cc {{path/to/lex.yy.c}} --output {{executable}}` diff --git a/pages.cn/common/flutter.md b/pages.cn/common/flutter.md new file mode 100644 index 0000000000..aba8126ea4 --- /dev/null +++ b/pages.cn/common/flutter.md @@ -0,0 +1,23 @@ +# flutter + +> Google’s free, open source, and cross-platform mobile app SDK. + +- Check the Flutter version: + +`flutter --version` + +- Display general help: + +`flutter help` + +- Display help about a specific command: + +`flutter help {{command}}` + +- Execute a Flutter command: + +`flutter {{command}}` + +- Show information about the installed tooling: + +`flutter doctor` diff --git a/pages.cn/common/fly.md b/pages.cn/common/fly.md new file mode 100644 index 0000000000..9f4324742b --- /dev/null +++ b/pages.cn/common/fly.md @@ -0,0 +1,35 @@ +# fly + +> Command line tool for concourse-ci. + +- Authenticate with and save concourse target: + +`fly --target {{target_name}} login --team-name {{team_name}} -c {{https://ci.example.com}}` + +- List targets: + +`fly targets` + +- List pipelines: + +`fly -t {{target_name}} pipelines` + +- Upload or update a pipeline: + +`fly -t {{target_name}} set-pipeline --config {{pipeline.yml}} --pipeline {{pipeline_name}}` + +- Unpause pipeline: + +`fly -t {{target_name}} unpause-pipeline --pipeline {{pipeline_name}}` + +- Show pipeline configuration: + +`fly -t {{target_name}} get-pipeline --pipeline {{pipeline_name}}` + +- Update local copy of fly: + +`fly -t {{target_name}} sync` + +- Destroy pipeline: + +`fly -t {{target_name}} destroy-pipeline --pipeline {{pipeline_name}}` diff --git a/pages.cn/common/fold.md b/pages.cn/common/fold.md new file mode 100644 index 0000000000..74af0493ea --- /dev/null +++ b/pages.cn/common/fold.md @@ -0,0 +1,15 @@ +# fold + +> Wraps each line in an input file to fit a specified width and prints it to the standard output. + +- Wrap each line to default width (80 characters): + +`fold {{file}}` + +- Wrap each line to width "30": + +`fold -w30 {{file}}` + +- Wrap each line to width "5" and break the line at spaces (puts each space separated word in a new line, words with length > 5 are wrapped): + +`fold -w5 -s {{file}}` diff --git a/pages.cn/common/for.md b/pages.cn/common/for.md new file mode 100644 index 0000000000..81523ec48d --- /dev/null +++ b/pages.cn/common/for.md @@ -0,0 +1,11 @@ +# for + +> Shell loop over parameters. + +- Perform a command with different arguments: + +`for argument in 1 2 3; do {{command $argument}}; done` + +- Perform a command in every directory: + +`for d in *; do (cd $d; {{command}}); done` diff --git a/pages.cn/common/forever.md b/pages.cn/common/forever.md new file mode 100644 index 0000000000..b220b36749 --- /dev/null +++ b/pages.cn/common/forever.md @@ -0,0 +1,15 @@ +# forever + +> Server-side JavaScript application that makes sure Node.js applications run indefinitely (restarts after exit). + +- Start running a file forever (as a daemon): + +`forever {{script}}` + +- List running "forever" processes (along with IDs and other details of "forever" processes): + +`forever list` + +- Stop a running "forever" process: + +`forever stop {{ID|pid|script}}` diff --git a/pages.cn/common/fortune.md b/pages.cn/common/fortune.md new file mode 100644 index 0000000000..5ede85fa78 --- /dev/null +++ b/pages.cn/common/fortune.md @@ -0,0 +1,27 @@ +# fortune + +> Print a random quotation (fortune-cookie style). + +- Print a quotation: + +`fortune` + +- Print an offensive quotation: + +`fortune -o` + +- Print a long quotation: + +`fortune -l` + +- Print a short quotation: + +`fortune -s` + +- List the available quotation database files: + +`fortune -f` + +- Print a quotation from one of the database files listed by `fortune -f`: + +`fortune {{filename}}` diff --git a/pages.cn/common/fping.md b/pages.cn/common/fping.md new file mode 100644 index 0000000000..74549135c7 --- /dev/null +++ b/pages.cn/common/fping.md @@ -0,0 +1,15 @@ +# fping + +> A more powerful ping which can ping multiple hosts. + +- List alive hosts within a subnet generated from a netmask: + +`fping -a -g 192.168.1.0/24` + +- List alive hosts within a subnet generated from an IP range: + +`fping -a -g 192.168.1.1 192.168.1.254` + +- List unreachable hosts within a subnet generated from a netmask: + +`fping -u -g 192.168.1.0/24` diff --git a/pages.cn/common/fswatch.md b/pages.cn/common/fswatch.md new file mode 100644 index 0000000000..49140353ef --- /dev/null +++ b/pages.cn/common/fswatch.md @@ -0,0 +1,19 @@ +# fswatch + +> A cross-platform file change monitor. + +- Run a bash command on file creation, update or deletion: + +`fswatch {{path/to/file}} | xargs -n 1 {{bash_command}}` + +- Watch one or more files and/or directories: + +`fswatch {{path/to/file}} {{path/to/directory}} {{path/to/another_directory/**/*.js}} | xargs -n 1 {{bash_command}}` + +- Print the absolute paths of the changed files: + +`fswatch {{path/to/directory}} | xargs -n 1 -I {} echo {}` + +- Filter by event type, eg. Updated, Deleted or Created: + +`fswatch --event {{Updated}} {{path/to/directory}} | xargs -n 1 {{bash_command}}` diff --git a/pages.cn/common/fswebcam.md b/pages.cn/common/fswebcam.md new file mode 100644 index 0000000000..c2884e49e0 --- /dev/null +++ b/pages.cn/common/fswebcam.md @@ -0,0 +1,19 @@ +# fswebcam + +> Small and simple webcam for *nix. + +- Take a picture: + +`fswebcam {{filename}}` + +- Take a picture with custom resolution: + +`fswebcam -r {{width}}x{{height}} {{filename}}` + +- Take a picture from selected device(Default is /dev/video0): + +`fswebcam -d {{device}} {{filename}}` + +- Take a picture with timestamp(timestamp string is formatted by strftime): + +`fswebcam --timestamp {{timestamp}} {{filename}}` diff --git a/pages.cn/common/ftp.md b/pages.cn/common/ftp.md new file mode 100644 index 0000000000..b159400099 --- /dev/null +++ b/pages.cn/common/ftp.md @@ -0,0 +1,31 @@ +# ftp + +> Tools to interact with a server via File Transfer Protocol. + +- Connect to an FTP server: + +`ftp {{ftp.example.com}}` + +- Switch to binary transfer mode (graphics, compressed files, etc): + +`binary` + +- Transfer multiple files without prompting for confirmation on every file: + +`prompt off` + +- Download multiple files (glob expression): + +`mget {{*.png}}` + +- Upload multiple files (glob expression): + +`mput {{*.zip}}` + +- Delete multiple files on the remote server: + +`mdelete {{*.txt}}` + +- Rename a file on the remote server: + +`rename {{original_filename}} {{new_filename}}` diff --git a/pages.cn/common/fuck.md b/pages.cn/common/fuck.md new file mode 100644 index 0000000000..76e7e5f1d1 --- /dev/null +++ b/pages.cn/common/fuck.md @@ -0,0 +1,11 @@ +# fuck + +> Corrects your previous console command. + +- Set the `fuck` alias to `thefuck` tool: + +`eval "$(thefuck --alias)"` + +- Try to match a rule for the previous command: + +`fuck` diff --git a/pages.cn/common/fzf.md b/pages.cn/common/fzf.md new file mode 100644 index 0000000000..2b7541435e --- /dev/null +++ b/pages.cn/common/fzf.md @@ -0,0 +1,27 @@ +# fzf + +> Command line fuzzy finder. + +- Start finder on all files from arbitrary locations: + +`find {{path/to/search}} -type f | fzf` + +- Start finder on running processes: + +`ps aux | fzf` + +- Select multiple files with `Shift + Tab` and write to a file: + +`find {{path/to/search_files}} -type f | fzf -m > {{filename}}` + +- Start finder with a given query: + +`fzf -q "{{query}}"` + +- Start finder on entries that start with core and end with either go, rb, or py: + +`fzf -q "^core go$ | rb$ | py$"` + +- Start finder on entries that not match pyc and match exactly travis: + +`fzf -q "!pyc 'travis"` diff --git a/pages.cn/common/g++.md b/pages.cn/common/g++.md new file mode 100644 index 0000000000..ff840e278a --- /dev/null +++ b/pages.cn/common/g++.md @@ -0,0 +1,20 @@ +# gplusplus + +> Compiles C++ source files. +> Part of GCC (GNU Compiler Collection). + +- Compile a source code file into an executable binary: + +`g++ {{source.cpp}} -o {{output_executable}}` + +- Display (almost) all errors and warnings: + +`g++ {{source.cpp}} -Wall -o {{output_executable}}` + +- Choose a language standard to compile for(C++98/C++11/C++14/C++17): + +`g++ {{source.cpp}} -std={{language_standard}} -o {{output_executable}}` + +- Include libraries located at a different path than the source file: + +`g++ {{source.cpp}} -o {{output_executable}} -I{{header_path}} -L{{library_path}} -l{{library_name}}` diff --git a/pages.cn/common/gatsby.md b/pages.cn/common/gatsby.md new file mode 100644 index 0000000000..d450eb49be --- /dev/null +++ b/pages.cn/common/gatsby.md @@ -0,0 +1,23 @@ +# gatsby + +> Static site generator for React. + +- Create a new site: + +`gatsby new {{site_name}}` + +- Create a new site with a Gatsby 'starter': + +`gatsby new {{site_name}} {{url_of_starter_github_repo}}` + +- Start a live-reloading local development server: + +`gatsby develop` + +- Perform a production build and generate static HTML: + +`gatsby build` + +- Start a local server which serves the production build: + +`gatsby serve` diff --git a/pages.cn/common/gcal.md b/pages.cn/common/gcal.md new file mode 100644 index 0000000000..e0a39e89b6 --- /dev/null +++ b/pages.cn/common/gcal.md @@ -0,0 +1,23 @@ +# gcal + +> Displays calendar. + +- Display calendar for the current month: + +`gcal` + +- Display calendar for the month of February of the year 2010: + +`gcal {{2}} {{2010}}` + +- Provide calendar sheet with week numbers: + +`gcal --with-week-number` + +- Change starting day of week to 1st day of the week (Monday): + +`gcal --starting-day={{1}}` + +- Display the previous, current and next month surrounding today: + +`gcal .` diff --git a/pages.cn/common/gcc.md b/pages.cn/common/gcc.md new file mode 100644 index 0000000000..e9e56c4727 --- /dev/null +++ b/pages.cn/common/gcc.md @@ -0,0 +1,23 @@ +# gcc + +> Preprocesses and compiles C and C++ source files, then assembles and links them together. + +- Compile multiple source files into executable: + +`gcc {{source1.c}} {{source2.c}} -o {{executable}}` + +- Allow warnings, debug symbols in output: + +`gcc {{source.c}} -Wall -Og -o {{executable}}` + +- Include libraries from a different path: + +`gcc {{source.c}} -o {{executable}} -I{{header_path}} -L{{library_path}} -l{{library_name}}` + +- Compile source code into Assembler instructions: + +`gcc -S {{source.c}}` + +- Compile source code without linking: + +`gcc -c {{source.c}}` diff --git a/pages.cn/common/gcloud.md b/pages.cn/common/gcloud.md new file mode 100644 index 0000000000..1b29ab191d --- /dev/null +++ b/pages.cn/common/gcloud.md @@ -0,0 +1,31 @@ +# gcloud + +> The official CLI tool for Google Cloud Platform. + +- List all properties in one's active configuration: + +`gcloud config list` + +- Set the active project: + +`gcloud config set project {{project_name}}` + +- SSH into a virtual machine instance: + +`gcloud compute ssh {{user}}@{{instance}} ` + +- Display all Google Compute Engine instances in a project. Instances from all zones are listed by default: + +`gcloud compute instances list` + +- Update a kubeconfig file with the appropriate credentials to point kubectl to a specific cluster in Google Kubernetes Engine: + +`gcloud container clusters get-credentials {{cluster_name}}` + +- Update all gcloud CLI components: + +`gcloud components update` + +- Show help for a given command: + +`gcloud help {{command}}` diff --git a/pages.cn/common/gdb.md b/pages.cn/common/gdb.md new file mode 100644 index 0000000000..37e8696226 --- /dev/null +++ b/pages.cn/common/gdb.md @@ -0,0 +1,19 @@ +# gdb + +> The GNU Debugger. + +- Debug an executable: + +`gdb {{executable}}` + +- Attach a process to gdb: + +`gdb -p {{procID}}` + +- Execute given GDB commands upon start: + +`gdb -ex "{{commands}}" {{executable}}` + +- Start gdb and pass arguments: + +`gdb --args {{executable}} {{argument1}} {{argument2}}` diff --git a/pages.cn/common/gdrive.md b/pages.cn/common/gdrive.md new file mode 100644 index 0000000000..3c433b4486 --- /dev/null +++ b/pages.cn/common/gdrive.md @@ -0,0 +1,20 @@ +# gdrive + +> Command line tool to interact with Google Drive. +> Folder/file id can be obtained from the Google Drive folder or id url. + +- Upload a local path to the parent folder with the specified id: + +`gdrive upload -p {{id}} {{path/to/file_or_folder}}` + +- Download file or directory by id to current directory: + +`gdrive download {{id}}` + +- Download to a given local path by its id: + +`gdrive download --path {{path/to/folder}} {{id}}` + +- Create a new revision of an id using a given file or folder: + +`gdrive update {{id}} {{path/to/file_or_folder}}` diff --git a/pages.cn/common/gem.md b/pages.cn/common/gem.md new file mode 100644 index 0000000000..ddf829b4f6 --- /dev/null +++ b/pages.cn/common/gem.md @@ -0,0 +1,23 @@ +# gem + +> Interact with the package manager for the Ruby programming language. + +- Install latest version of a gem: + +`gem install {{gemname}}` + +- Install specific version of a gem: + +`gem install {{gemname}} -v {{1.0.0}}` + +- Update a gem: + +`gem update {{gemname}}` + +- List all gems: + +`gem list` + +- Uninstall a gem: + +`gem uninstall {{gemname}}` diff --git a/pages.cn/common/geth.md b/pages.cn/common/geth.md new file mode 100644 index 0000000000..a653ee665e --- /dev/null +++ b/pages.cn/common/geth.md @@ -0,0 +1,19 @@ +# geth + +> The go-ethereum command line interface. + +- Connect to the main Ethereum network and automatically download the full node: + +`geth` + +- Connect to the Ropsten test network: + +`geth --testnet` + +- Create a new account: + +`geth account new` + +- Enable mining: + +`geth --mine` diff --git a/pages.cn/common/ghc.md b/pages.cn/common/ghc.md new file mode 100644 index 0000000000..0b6a40f946 --- /dev/null +++ b/pages.cn/common/ghc.md @@ -0,0 +1,28 @@ +# ghc + +> The Glasgow Haskell Compiler. +> Compiles and links Haskell source files. + +- Find and compile all modules in the current directory: + +`ghc Main` + +- Compile a single file: + +`ghc {{file.hs}}` + +- Compile using extra optimization: + +`ghc -O {{file.hs}}` + +- Stop compilation after generating object files (.o): + +`ghc -c {{file.hs}}` + +- Run Haskell interactive interpreter (REPL): + +`ghci` + +- Evaluate a single expression: + +`ghc -e {{expression}}` diff --git a/pages.cn/common/gibo.md b/pages.cn/common/gibo.md new file mode 100644 index 0000000000..fc56518fb6 --- /dev/null +++ b/pages.cn/common/gibo.md @@ -0,0 +1,23 @@ +# gibo + +> Fetch gitignore boilerplates. + +- List available boilerplates: + +`gibo list` + +- Write a boilerplate to stdout: + +`gibo dump {{boilerplate}}` + +- Write a boilerplate to .gitignore: + +`gibo dump {{boilerplate}} >>{{.gitignore}}` + +- Search for boilerplates containing a given string: + +`gibo search {{string}}` + +- Update available local boilerplates: + +`gibo update` diff --git a/pages.cn/common/gifsicle.md b/pages.cn/common/gifsicle.md new file mode 100644 index 0000000000..83e011cb81 --- /dev/null +++ b/pages.cn/common/gifsicle.md @@ -0,0 +1,19 @@ +# gifsicle + +> Create GIFs. + +- Optimise a GIF: + +`gifsicle --batch --optimize=3 {{amin.gif}}` + +- Make a GIF animation with gifsicle: + +`gifsicle --delay={{10}} --loop *.gif > {{anim.gif}}` + +- Extract frames from an animation: + +`gifsicle {{anim.gif}} '#0' > {{firstframe.gif}}` + +- You can also edit animations by replacing, deleting, or inserting frames: + +`gifsicle -b {{anim.gif}} --replace '#0' {{new.gif}}` diff --git a/pages.cn/common/gist.md b/pages.cn/common/gist.md new file mode 100644 index 0000000000..b812c1bd39 --- /dev/null +++ b/pages.cn/common/gist.md @@ -0,0 +1,31 @@ +# gist + +> Upload code to https://gist.github.com. + +- Login in gist on this computer: + +`gist --login` + +- Create a gist from any number of text files: + +`gist {{file.txt}} {{file2.txt}}` + +- Create a private gist with a description: + +`gist -p -d {{"A meaningful description"}} {{file.txt}} ` + +- Read contents from STDIN and create a gist from it: + +`{{echo "hello world"}} | gist` + +- List your public and private gists: + +`gist -l` + +- List all gists for the currently logged in user: + +`gist -l {{user_name}}` + +- Use the id from the gist URL to modify or include a file: + +`gist -u {{GIST_ID}} {{file.txt}}` diff --git a/pages.cn/common/git-add.md b/pages.cn/common/git-add.md new file mode 100644 index 0000000000..031c2fce4a --- /dev/null +++ b/pages.cn/common/git-add.md @@ -0,0 +1,23 @@ +# git add + +> Adds changed files to the index. + +- Add a file to the index: + +`git add {{path/to/file}}` + +- Add all files (tracked and untracked): + +`git add -A` + +- Only add already tracked files: + +`git add -u` + +- Also add ignored files: + +`git add -f` + +- Add parts of a file interactively: + +`git add -p {{path/to/file}}` diff --git a/pages.cn/common/git-am.md b/pages.cn/common/git-am.md new file mode 100644 index 0000000000..db7eb2a418 --- /dev/null +++ b/pages.cn/common/git-am.md @@ -0,0 +1,16 @@ +# git am + +> Apply patch files. Useful when receiving commits via email. +> See also `git format-patch`, which can generate patch files. + +- Apply a patch file: + +`git am {{path/to/file.patch}}` + +- Abort the process of applying a patch file: + +`git am --abort` + +- Apply as much of a patch file as possible, saving failed hunks to reject files: + +`git am --reject {{path/to/file.patch}}` diff --git a/pages.cn/common/git-bisect.md b/pages.cn/common/git-bisect.md new file mode 100644 index 0000000000..4f22514b3d --- /dev/null +++ b/pages.cn/common/git-bisect.md @@ -0,0 +1,20 @@ +# git bisect + +> Use binary search to find the commit that introduced a bug. +> Git automatically jumps back and forth in the commit graph to progressively narrow down the faulty commit. + +- Start a bisect session on a commit range bounded by a known buggy commit, and a known clean (typically older) one: + +`git bisect start {{bad_commit}} {{good_commit}}` + +- For each commit that `git bisect` selects, mark it as "bad" or "good" after testing it for the issue: + +`git bisect {{good|bad}}` + +- After `git bisect` pinpoints the faulty commit, end the bisect session and return to the previous branch: + +`git bisect reset` + +- Skip a commit during a bisect (e.g. one that fails the tests due to a different issue): + +`git bisect skip` diff --git a/pages.cn/common/git-blame.md b/pages.cn/common/git-blame.md new file mode 100644 index 0000000000..9b28abf602 --- /dev/null +++ b/pages.cn/common/git-blame.md @@ -0,0 +1,11 @@ +# git blame + +> Show commit hash and last author on each line of a file. + +- Print file with author name and commit hash on each line: + +`git blame {{file}}` + +- Print file with author email and commit hash on each line: + +`git blame -e {{file}}` diff --git a/pages.cn/common/git-branch.md b/pages.cn/common/git-branch.md new file mode 100644 index 0000000000..b4afa23d53 --- /dev/null +++ b/pages.cn/common/git-branch.md @@ -0,0 +1,27 @@ +# git branch + +> Main git command for working with branches. + +- List local branches. The current branch is highlighted by `*`: + +`git branch` + +- List all branches (local and remote): + +`git branch -a` + +- Create new branch based on the current commit: + +`git branch {{branch_name}}` + +- Create new branch based on a specific commit: + +`git branch {{branch_name}} {{commit_hash}}` + +- Rename a branch (must not have it checked out to do this): + +`git branch -m {{old_branch_name}} {{new_branch_name}}` + +- Delete a local branch (must not have it checked out to do this): + +`git branch -d {{branch_name}}` diff --git a/pages.cn/common/git-checkout.md b/pages.cn/common/git-checkout.md new file mode 100644 index 0000000000..d546e746e5 --- /dev/null +++ b/pages.cn/common/git-checkout.md @@ -0,0 +1,31 @@ +# git checkout + +> Checkout a branch or paths to the working tree. + +- Create and switch to a new branch: + +`git checkout -b {{branch_name}}` + +- Create and switch to a new branch based on a specific reference (branch, remote/branch, tag are examples of valid references): + +`git checkout -b {{branch_name}} {{reference}}` + +- Switch to an existing local branch: + +`git checkout {{branch_name}}` + +- Switch to an existing remote branch: + +`git checkout --track {{remote_name}}/{{branch_name}}` + +- Discard all unstaged changes in the current folder (see `git reset` for more undo-like commands): + +`git checkout .` + +- Discard unstaged changes to a given file: + +`git checkout {{file_name}}` + +- Replace a file in the current folder with the version of it committed in a given branch: + +`git checkout {{branch_name}} -- {{file_name}}` diff --git a/pages.cn/common/git-cherry-pick.md b/pages.cn/common/git-cherry-pick.md new file mode 100644 index 0000000000..298be57c6d --- /dev/null +++ b/pages.cn/common/git-cherry-pick.md @@ -0,0 +1,16 @@ +# git cherry-pick + +> Apply the changes introduced by existing commits to the current branch. +> To apply changes to another branch, first use git-checkout to switch to the desired branch. + +- Apply a commit to the current branch: + +`git cherry-pick {{commit}}` + +- Apply a range of commits to the current branch (see also `git rebase --onto`): + +`git cherry-pick {{start_commit}}~..{{end_commit}}` + +- Apply multiple (non-sequential) commits to the current branch: + +`git cherry-pick {{commit_1}} {{commit_2}}` diff --git a/pages.cn/common/git-clean.md b/pages.cn/common/git-clean.md new file mode 100644 index 0000000000..6a8d2ccd83 --- /dev/null +++ b/pages.cn/common/git-clean.md @@ -0,0 +1,27 @@ +# git clean + +> Remove untracked files from the working tree. + +- Delete files that are not tracked by git: + +`git clean` + +- Interactively delete files that are not tracked by git: + +`git clean -i` + +- Show what files would be deleted without actually deleting them: + +`git clean --dry-run` + +- Forcefully delete files that are not tracked by git: + +`git clean -f` + +- Forcefully delete directories that are not tracked by git: + +`git clean -fd` + +- Delete untracked files, including ignored files in `.gitignore` and `.git/info/exclude`: + +`git clean -x` diff --git a/pages.cn/common/git-clone.md b/pages.cn/common/git-clone.md new file mode 100644 index 0000000000..2d1f9e3d9b --- /dev/null +++ b/pages.cn/common/git-clone.md @@ -0,0 +1,23 @@ +# git clone + +> Clone an existing repository. + +- Clone an existing repository: + +`git clone {{remote_repository_location}}` + +- Clone an existing repository and its submodules: + +`git clone --recursive {{remote_repository_location}}` + +- For cloning from the local machine: + +`git clone -l` + +- Do it quietly: + +`git clone -q` + +- Clone an existing repository, and truncate to the specified number of revisions, save your time mostly: + +`git clone --depth {{10}} {{remote_repository_location}}` diff --git a/pages.cn/common/git-commit.md b/pages.cn/common/git-commit.md new file mode 100644 index 0000000000..4bf129dd81 --- /dev/null +++ b/pages.cn/common/git-commit.md @@ -0,0 +1,15 @@ +# git commit + +> Commit files to the repository. + +- Commit staged files to the repository with a message: + +`git commit -m {{message}}` + +- Auto stage all modified files and commit with a message: + +`git commit -a -m {{message}}` + +- Replace the last commit with currently staged changes: + +`git commit --amend` diff --git a/pages.cn/common/git-config.md b/pages.cn/common/git-config.md new file mode 100644 index 0000000000..0a6f2eb061 --- /dev/null +++ b/pages.cn/common/git-config.md @@ -0,0 +1,28 @@ +# git config + +> Manage custom configuration options for git repositories. +> These configurations can be local (for the current repository) or global (for the current user). + +- List only local configuration entries (stored in `.git/config` in the current repository): + +`git config --list --local` + +- List only global configuration entries (stored in `~/.gitconfig`): + +`git config --list --global` + +- List all configuration entries that have been defined either locally or globally: + +`git config --list` + +- Get the value of a given configuration entry: + +`git config alias.unstage` + +- Set the global value of a given configuration entry: + +`git config --global alias.unstage "reset HEAD --"` + +- Revert a global configuration entry to its default value: + +`git config --global --unset alias.unstage` diff --git a/pages.cn/common/git-diff.md b/pages.cn/common/git-diff.md new file mode 100644 index 0000000000..e9f69d78f1 --- /dev/null +++ b/pages.cn/common/git-diff.md @@ -0,0 +1,39 @@ +# git diff + +> Show changes to tracked files. + +- Show unstaged, uncommitted changes: + +`git diff` + +- Show all uncommitted changes (including staged ones): + +`git diff HEAD` + +- Show only staged (added, but not yet committed) changes: + +`git diff --staged` + +- Show changes from all commits since a given date/time (a date expression, e.g. "1 week 2 days" or an ISO date): + +`git diff 'HEAD@{3 months|weeks|days|hours|seconds ago}'` + +- Show only names of changed files since a given commit: + +`git diff --name-only {{commit}}` + +- Output a summary of file creations, renames and mode changes since a given commit: + +`git diff --summary {{commit}}` + +- Create a patch file: + +`git diff > {{target_file}}.patch` + +- Compare a single file between two branches or commits: + +`git diff {{branch_1}}..{{branch_2}} [--] {{path/to/file}}` + +- Compare different files from the current branch to other branch: + +`git diff {{branch}}:{{path/to/file2}} {{path/to/file}}` diff --git a/pages.cn/common/git-fetch.md b/pages.cn/common/git-fetch.md new file mode 100644 index 0000000000..a4d33ba842 --- /dev/null +++ b/pages.cn/common/git-fetch.md @@ -0,0 +1,23 @@ +# git fetch + +> Download objects and refs from a remote repository. + +- Fetch the latest changes from the default remote upstream repository (if set): + +`git fetch` + +- Fetch new branches from a specific remote upstream repository: + +`git fetch {{remote_name}}` + +- Fetch the latest changes from all remote upstream repositories: + +`git fetch --all` + +- Also fetch tags from the remote upstream repository: + +`git fetch --tags` + +- Delete local references to remote branches that have been deleted upstream: + +`git fetch --prune` diff --git a/pages.cn/common/git-format-patch.md b/pages.cn/common/git-format-patch.md new file mode 100644 index 0000000000..8cba68c3af --- /dev/null +++ b/pages.cn/common/git-format-patch.md @@ -0,0 +1,16 @@ +# git format-patch + +> Prepare .patch files. Useful when emailing commits elsewhere. +> See also `git am`, which can apply generated .patch files. + +- Create an auto-named .patch file for all the unpushed commits: + +`git format-patch {{origin}}` + +- Write a .patch file for all the commits between 2 revisions to stdout: + +`git format-patch {{revision_1}}..{{revision_2}}` + +- Write a .patch file for the 3 latest commits: + +`git format-patch -{{3}}` diff --git a/pages.cn/common/git-gc.md b/pages.cn/common/git-gc.md new file mode 100644 index 0000000000..470675cbff --- /dev/null +++ b/pages.cn/common/git-gc.md @@ -0,0 +1,23 @@ +# git gc + +> Optimise the local repository by cleaning unnecessary files. + +- Optimise the repository: + +`git gc` + +- Aggressively optimise, takes more time: + +`git gc --aggressive` + +- Do not prune loose objects (prunes by default): + +`git gc --no-prune` + +- Suppress all output: + +`git gc --quiet` + +- View full usage: + +`git gc --help` diff --git a/pages.cn/common/git-imerge.md b/pages.cn/common/git-imerge.md new file mode 100644 index 0000000000..4e50d900a1 --- /dev/null +++ b/pages.cn/common/git-imerge.md @@ -0,0 +1,28 @@ +# git-imerge + +> Perform a merge or rebase between two git branches incrementally. +> Conflicts between branches are tracked down to pairs of individual commits, to simplify conflict resolution. + +- Start imerge-based rebase (checkout the branch to be rebased, first): + +`git imerge rebase {{branch_to_rebase_onto}}` + +- Start imerge-based merge (checkout the branch to merge into, first): + +`git imerge merge {{branch_to_be_merged}}` + +- Show ASCII diagram of in-progress merge or rebase: + +`git imerge diagram` + +- Continue imerge operation after resolving conflicts (`git add` the conflicted files, first): + +`git imerge continue --no-edit` + +- Wrap up imerge operation, after all conflicts are resolved: + +`git imerge finish` + +- Abort imerge operation, and return to the previous branch: + +`git-imerge remove && git checkout {{previous_branch}}` diff --git a/pages.cn/common/git-init.md b/pages.cn/common/git-init.md new file mode 100644 index 0000000000..374debae02 --- /dev/null +++ b/pages.cn/common/git-init.md @@ -0,0 +1,11 @@ +# git init + +> Initializes a new local Git repository. + +- Initialize a new local repository: + +`git init` + +- Initialize a barebones repository, suitable for use as a remote over ssh: + +`git init --bare` diff --git a/pages.cn/common/git-log.md b/pages.cn/common/git-log.md new file mode 100644 index 0000000000..19c5c3d3b5 --- /dev/null +++ b/pages.cn/common/git-log.md @@ -0,0 +1,31 @@ +# git log + +> Show a history of commits. + +- Show the sequence of commits starting from the current one, in reverse chronological order: + +`git log` + +- Show the history of a particular file or directory, including differences: + +`git log -p {{path}}` + +- Show only the first line of each commit message: + +`git log --oneline` + +- Show an overview of which file(s) changed in each commit: + +`git log --stat` + +- Show a graph of commits in the current branch: + +`git log --graph` + +- Show a graph of all commits, tags and branches in the entire repo: + +`git log --oneline --decorate --all --graph` + +- Show only commits whose messages include a given string (case-insensitively): + +`git log -i --grep {{search_string}}` diff --git a/pages.cn/common/git-merge.md b/pages.cn/common/git-merge.md new file mode 100644 index 0000000000..ad1f212f48 --- /dev/null +++ b/pages.cn/common/git-merge.md @@ -0,0 +1,19 @@ +# git merge + +> Merge branches. + +- Merge a branch with your current branch: + +`git merge {{branch_name}}` + +- Edit the merge message: + +`git merge -e {{branch_name}}` + +- Merge a branch and create a merge commit: + +`git merge --no-ff {{branch_name}}` + +- Abort a merge in case of conflicts: + +`git merge --abort` diff --git a/pages.cn/common/git-mv.md b/pages.cn/common/git-mv.md new file mode 100644 index 0000000000..12e7243582 --- /dev/null +++ b/pages.cn/common/git-mv.md @@ -0,0 +1,15 @@ +# git mv + +> Move or rename files and update the git index. + +- Move file inside the repo and add the movement to the next commit: + +`git mv {{path/to/file}} {{new/path/to/file}}` + +- Rename file and add renaming to the next commit: + +`git mv {{filename}} {{new_filename}}` + +- Overwrite the file in the target path if it exists: + +`git mv --force {{file}} {{target}}` diff --git a/pages.cn/common/git-pull.md b/pages.cn/common/git-pull.md new file mode 100644 index 0000000000..27e4dd1115 --- /dev/null +++ b/pages.cn/common/git-pull.md @@ -0,0 +1,15 @@ +# git pull + +> Fetch branch from a remote repository and merge it to local repository. + +- Download changes from default remote repository and merge it: + +`git pull` + +- Download changes from default remote repository and use fast forward: + +`git pull --rebase` + +- Download changes from given remote repository and branch, then merge them into HEAD: + +`git pull {{remote_name}} {{branch}}` diff --git a/pages.cn/common/git-push.md b/pages.cn/common/git-push.md new file mode 100644 index 0000000000..350f67b60d --- /dev/null +++ b/pages.cn/common/git-push.md @@ -0,0 +1,31 @@ +# git push + +> Push commits to a remote repository. + +- Send local changes in the current branch to its remote counterpart: + +`git push` + +- Send local changes in a given branch to its remote counterpart: + +`git push {{remote_name}} {{local_branch}}` + +- Publish the current branch to a remote repository, setting the remote branch name: + +`git push {{remote_name}} -u {{remote_branch}}` + +- Send changes on all local branches to their counterparts in a given remote repository: + +`git push --all {{remote_name}}` + +- Delete a branch in a remote repository: + +`git push {{remote_name}} --delete {{remote_branch}}` + +- Remove remote branches that don't have a local counterpart: + +`git push --prune {{remote_name}}` + +- Publish tags that aren't yet in the remote repository: + +`git push --tags` diff --git a/pages.cn/common/git-rebase.md b/pages.cn/common/git-rebase.md new file mode 100644 index 0000000000..8bc4086294 --- /dev/null +++ b/pages.cn/common/git-rebase.md @@ -0,0 +1,28 @@ +# git rebase + +> Reapply commits from one branch on top of another branch. +> Commonly used to "move" an entire branch to another base, creating copies of the commits in the new location. + +- Rebase the current branch on top of the master branch: + +`git rebase {{master}}` + +- Start an interactive rebase, which allows the commits to be reordered, omitted, combined or modified: + +`git rebase -i {{target_base_branch_or_commit_hash}}` + +- Continue a rebase that was interrupted by a merge failure, after editing conflicting files: + +`git rebase --continue` + +- Abort a rebase in progress (e.g. if it is interrupted by a merge conflict): + +`git rebase --abort` + +- Move part of the current branch onto a new base, providing the old base to start from: + +`git rebase --onto {{new_base}} {{old_base}}` + +- Reapply the last 5 commits in-place, stopping to allow them to be reordered, omitted, combined or modified: + +`git rebase -i {{HEAD~5}}` diff --git a/pages.cn/common/git-reflog.md b/pages.cn/common/git-reflog.md new file mode 100644 index 0000000000..ece246637f --- /dev/null +++ b/pages.cn/common/git-reflog.md @@ -0,0 +1,11 @@ +# git reflog + +> Show when the reference logs were updated in local repository. + +- View reflog: + +`git reflog` + +- View 5 latest entries in reflog: + +`git reflog -n {{5}}` diff --git a/pages.cn/common/git-remote.md b/pages.cn/common/git-remote.md new file mode 100644 index 0000000000..850d4be663 --- /dev/null +++ b/pages.cn/common/git-remote.md @@ -0,0 +1,23 @@ +# git remote + +> Manage set of tracked repositories ("remotes"). + +- Show a list of existing remotes, their names and URL: + +`git remote -v` + +- Add a remote: + +`git remote add {{remote_name}} {{remote_url}}` + +- Change the URL of a remote: + +`git remote set-url {{remote_name}} {{new_url}}` + +- Remove a remote: + +`git remote remove {{remote_name}}` + +- Rename a remote: + +`git remote rename {{old_name}} {{new_name}}` diff --git a/pages.cn/common/git-reset.md b/pages.cn/common/git-reset.md new file mode 100644 index 0000000000..84d760ec33 --- /dev/null +++ b/pages.cn/common/git-reset.md @@ -0,0 +1,32 @@ +# git reset + +> Undo commits or unstage changes, by resetting the current git HEAD to the specified state. +> If a path is passed, it works as "unstage"; if a commit hash or branch is passed, it works as "uncommit". + +- Unstage everything: + +`git reset` + +- Unstage specific file(s): + +`git reset {{path/to/file(s)}}` + +- Unstage portions of a file: + +`git reset -p {{path/to/file}}` + +- Undo the last commit, keeping its changes (and any further uncommitted changes) in the filesystem: + +`git reset HEAD~` + +- Undo the last two commits, adding their changes to the index, i.e. staged for commit: + +`git reset --soft HEAD~2` + +- Discard any uncommitted changes, staged or not (for only unstaged changes, use `git checkout`): + +`git reset --hard` + +- Reset the repository to a given commit, discarding committed, staged and uncommitted changes since then: + +`git reset --hard {{commit}}` diff --git a/pages.cn/common/git-rm.md b/pages.cn/common/git-rm.md new file mode 100644 index 0000000000..8ea20f88c0 --- /dev/null +++ b/pages.cn/common/git-rm.md @@ -0,0 +1,15 @@ +# git rm + +> Remove files from repository index and local filesystem. + +- Remove file from repository index and filesystem: + +`git rm {{file}}` + +- Remove directory: + +`git rm -r {{directory}}` + +- Remove file from repository index but keep it untouched locally: + +`git rm --cached {{file}}` diff --git a/pages.cn/common/git-shortlog.md b/pages.cn/common/git-shortlog.md new file mode 100644 index 0000000000..3c074b77f2 --- /dev/null +++ b/pages.cn/common/git-shortlog.md @@ -0,0 +1,19 @@ +# git shortlog + +> Summarizes the `git log` output. + +- View a summary of all the commits made, grouped alphabetically by author name: + +`git shortlog` + +- View a summary of all the commits made, sorted by the number of commits made: + +`git shortlog -n` + +- View a summary of all the commits made, grouped by the commiter identities (name and email): + +`git shortlog -c` + +- View a summary of the last 5 commits (i.e. specify a revision range): + +`git shortlog HEAD~{{5}}..HEAD` diff --git a/pages.cn/common/git-show.md b/pages.cn/common/git-show.md new file mode 100644 index 0000000000..8e402a8ffe --- /dev/null +++ b/pages.cn/common/git-show.md @@ -0,0 +1,23 @@ +# git show + +> Show various types of git objects (commits, tags, etc.). + +- Show information about the latest commit (message, changes, and other metadata): + +`git show` + +- Show information about a given commit: + +`git show {{commit}}` + +- Show information about the commit associated with a given tag: + +`git show {{tag}}` + +- Show information about the 3rd commit from the tip of a branch: + +`git show {{branch}}~{{3}}` + +- Show a commit's hash and message in a single line, suppressing the diff output: + +`git show --oneline -s {{commit}}` diff --git a/pages.cn/common/git-sizer.md b/pages.cn/common/git-sizer.md new file mode 100644 index 0000000000..e9774529ce --- /dev/null +++ b/pages.cn/common/git-sizer.md @@ -0,0 +1,15 @@ +# git sizer + +> Computes various Git repository size metrics and alerts you to any that might cause problems or inconvenience. + +- Report only statistics that have a level of concern greater than 0: + +`git sizer` + +- Report all statistics: + +`git sizer -v` + +- See additional options: + +`git sizer -h` diff --git a/pages.cn/common/git-stash.md b/pages.cn/common/git-stash.md new file mode 100644 index 0000000000..194c78a985 --- /dev/null +++ b/pages.cn/common/git-stash.md @@ -0,0 +1,35 @@ +# git stash + +> Stash local Git changes in a temporary area. + +- Stash current changes, except new (untracked) files: + +`git stash [save {{optional_stash_message}}]` + +- Stash current changes, including new (untracked) files: + +`git stash -u` + +- Interactively select parts of changed files for stashing: + +`git stash -p` + +- List all stashes (shows stash name, related branch and message): + +`git stash list` + +- Apply a stash (default is the latest, named stash@{0}): + +`git stash apply {{optional_stash_name_or_commit}}` + +- Apply a stash (default is stash@{0}), and remove it from the stash list if applying doesn't cause conflicts: + +`git stash pop {{optional_stash_name}}` + +- Drop a stash (default is stash@{0}): + +`git stash drop {{optional_stash_name}}` + +- Drop all stashes: + +`git stash clear` diff --git a/pages.cn/common/git-status.md b/pages.cn/common/git-status.md new file mode 100644 index 0000000000..c91750a970 --- /dev/null +++ b/pages.cn/common/git-status.md @@ -0,0 +1,11 @@ +# git status + +> Show the index (changed files). + +- Show changed files which are not yet added for commit: + +`git status` + +- Give output in short format: + +`git status -s` diff --git a/pages.cn/common/git-submodule.md b/pages.cn/common/git-submodule.md new file mode 100644 index 0000000000..181feaf74d --- /dev/null +++ b/pages.cn/common/git-submodule.md @@ -0,0 +1,19 @@ +# git submodule + +> Inspects, updates and manages submodules. + +- Install a repository's specified submodules: + +`git submodule update --init --recursive` + +- Add a git repository as a submodule: + +`git submodule add {{repository_url}}` + +- Add a git repository as a submodule at the specified directory: + +`git submodule add {{repository_url}} {{path/to/directory}}` + +- Update every submodule to its latest commit: + +`git submodule foreach git pull` diff --git a/pages.cn/common/git-svn.md b/pages.cn/common/git-svn.md new file mode 100644 index 0000000000..8104af9b0c --- /dev/null +++ b/pages.cn/common/git-svn.md @@ -0,0 +1,23 @@ +# git svn + +> Bidirectional operation between a Subversion repository and Git. + +- Clone an SVN repository: + +`git svn clone {{https://example.com/subversion_repo}} {{local_dir}}` + +- Clone a SVN repository starting at a given revision number: + +`git svn clone -r{{1234}}:HEAD {{https://svn.example.net/subversion/repo}} {{local_dir}}` + +- Update local clone from the remote SVN repository: + +`git svn rebase` + +- Fetch updates from the remote SVN repository without changing the git HEAD: + +`git svn fetch` + +- Commit back to the SVN repository: + +`git svn dcommit` diff --git a/pages.cn/common/git-tag.md b/pages.cn/common/git-tag.md new file mode 100644 index 0000000000..73e0984ebd --- /dev/null +++ b/pages.cn/common/git-tag.md @@ -0,0 +1,32 @@ +# git tag + +> Create, list, delete or verify tags. +> A tag is a static reference to a specific commit. + +- List all tags: + +`git tag` + +- Create a tag with the given name pointing to the current commit: + +`git tag {{tag_name}}` + +- Create a tag with the given name pointing to a given commit: + +`git tag {{tag_name}} {{commit}}` + +- Create an annotated tag with the given message: + +`git tag {{tag_name}} -m {{tag_message}}` + +- Delete the tag with the given name: + +`git tag -d {{tag_name}}` + +- Get updated tags from upstream: + +`git fetch --tags` + +- List all tags whose ancestors include a given commit: + +`git tag --contains {{commit}}` diff --git a/pages.cn/common/git-worktree.md b/pages.cn/common/git-worktree.md new file mode 100644 index 0000000000..016eed97c8 --- /dev/null +++ b/pages.cn/common/git-worktree.md @@ -0,0 +1,19 @@ +# git worktree + +> Manage multiple working trees attached to the same repository. + +- Create a new folder with the specified branch checked out into it: + +`git worktree add {{path/to/folder}} {{branch}}` + +- Create a new folder with a new branch checked out into it: + +`git worktree add {{path/to/folder}} -b {{new_branch}}` + +- List all the working directories attached to this repository: + +`git worktree list` + +- Remove a worktree (after deleting worktree folder): + +`git worktree prune` diff --git a/pages.cn/common/git.md b/pages.cn/common/git.md new file mode 100644 index 0000000000..67ac1fb636 --- /dev/null +++ b/pages.cn/common/git.md @@ -0,0 +1,19 @@ +# git + +> Distributed version control system. + +- Check the Git version: + +`git --version` + +- Call general help: + +`git --help` + +- Call help on a command: + +`git help {{command}}` + +- Execute Git command: + +`git {{command}}` diff --git a/pages.cn/common/gitk.md b/pages.cn/common/gitk.md new file mode 100644 index 0000000000..ddcd2b6e9d --- /dev/null +++ b/pages.cn/common/gitk.md @@ -0,0 +1,23 @@ +# gitk + +> A graphical git repository browser. + +- Show the repository browser for the current git repository: + +`gitk` + +- Show repository browser for a specific file or folder: + +`gitk {{path/to/file_or_folder}}` + +- Show commits made since 1 week ago: + +`gitk --since={{"1 week ago"}}` + +- Show commits older than 1/1/2016: + +`gitk --until={{"1/1/2015"}}` + +- Show at most 100 changes in all branches: + +` gitk --max-count={{100}} --all` diff --git a/pages.cn/common/gitsome.md b/pages.cn/common/gitsome.md new file mode 100644 index 0000000000..cb95088935 --- /dev/null +++ b/pages.cn/common/gitsome.md @@ -0,0 +1,28 @@ +# gitsome + +> A terminal-based interface for GitHub, accessed via the `gh` command. +> It also provides menu-style autocomplete suggestions for `git` commands. + +- Enter the gitsome shell (optional), to enable autocompletion and interactive help for git (and gh) commands: + +`gitsome` + +- Setup GitHub integration with the current account: + +`gh configure` + +- List notifications for the current account (as would be seen in https://github.com/notifications): + +`gh notifications` + +- List the current account's starred repos, filtered by a given search string: + +`gh starred "{{python 3}}"` + +- View the recent activity feed of a given GitHub repository: + +`gh feed {{tldr-pages/tldr}}` + +- View the recent activity feed for a given GitHub user, using the default pager (e.g. `less`): + +`gh feed {{torvalds}} -p` diff --git a/pages.cn/common/glances.md b/pages.cn/common/glances.md new file mode 100644 index 0000000000..e4c2bab4a8 --- /dev/null +++ b/pages.cn/common/glances.md @@ -0,0 +1,23 @@ +# glances + +> A cross-platform system monitoring tool. + +- Run in terminal: + +`glances` + +- Run in web server mode to show results in browser: + +`glances -w` + +- Run in server mode to allow connections from other Glances clients: + +`glances -s` + +- Connect to a Glances server: + +`glances -c {{hostname}}` + +- Require a password in (web) server mode: + +`glances -s --password` diff --git a/pages.cn/common/gnomon.md b/pages.cn/common/gnomon.md new file mode 100644 index 0000000000..d3d54136de --- /dev/null +++ b/pages.cn/common/gnomon.md @@ -0,0 +1,23 @@ +# gnomon + +> Utility to annotate console logging statements with timestamps and find slow processes. + +- Use UNIX (or DOS) pipes to pipe the stdout of any command through gnomon: + +`{{npm test}} | gnomon` + +- Show number of seconds since the start of the process: + +`{{npm test}} | gnomon --type=elapsed-total` + +- Show an absolute timestamp in UTC: + +`{{npm test}} | gnomon --type=absolute` + +- Set a high threshold of 0.5 seconds for the elapsed time; exceeding which the timestamp will be colored bright red: + +`{{npm test}} | gnomon --high {{0.5}}` + +- Set a medium threshold of 0.2 seconds (Timestamp will be colored bright yellow): + +`{{npm test}} | gnomon --medium {{0.2}}` diff --git a/pages.cn/common/gnuplot.md b/pages.cn/common/gnuplot.md new file mode 100644 index 0000000000..8dad15642c --- /dev/null +++ b/pages.cn/common/gnuplot.md @@ -0,0 +1,19 @@ +# gnuplot + +> A graph plotter that outputs in several formats. + +- Start the interactive graph plotting shell: + +`gnuplot` + +- Plot the graph for the specified graph definition file: + +`gnuplot {{path/to/definition.plt}}` + +- Set the output format by executing a command before loading the definition file: + +`gnuplot -e "{{set output "path/to/filename.png" size 1024,768}}" {{path/to/definition.plt}}` + +- Persist the graph plot preview window after gnuplot exits: + +`gnuplot --persist {{path/to/definition.plt}}` diff --git a/pages.cn/common/go.md b/pages.cn/common/go.md new file mode 100644 index 0000000000..ed2260814d --- /dev/null +++ b/pages.cn/common/go.md @@ -0,0 +1,27 @@ +# go + +> Tool for managing go source code. + +- Download and install a package, specified by its import path: + +`go get {{package_path}}` + +- Compile and run a source file (it has to contain a `main` package): + +`go run {{file}}.go` + +- Compile a source file into a named executable: + +`go build -o {{executable}} {{file}}.go` + +- Compile the package present in the current directory: + +`go build` + +- Execute all test cases of the current package (files have to end with `_test.go`): + +`go test` + +- Compile and install the current package: + +`go install` diff --git a/pages.cn/common/gocryptfs.md b/pages.cn/common/gocryptfs.md new file mode 100644 index 0000000000..dd638fd29c --- /dev/null +++ b/pages.cn/common/gocryptfs.md @@ -0,0 +1,23 @@ +# gocryptfs + +> Encrypted overlay filesystem written in Go. + +- Initialize an encrypted filesystem: + +`gocryptfs -init {{path/to/cipher_dir}}` + +- Mount an encrypted filesystem: + +`gocryptfs {{path/to/cipher_dir}} {{path/to/mount_point}}` + +- Mount with the explicit master key instead of password: + +`gocryptfs --masterkey {{path/to/cipher_dir}} {{path/to/mount_point}}` + +- Change the password: + +`gocryptfs --passwd {{path/to/cipher_dir}}` + +- Make an encrypted snapshot of a plain directory: + +`gocryptfs --reverse {{path/to/plain_dir}} {{path/to/cipher_dir}}` diff --git a/pages.cn/common/godoc.md b/pages.cn/common/godoc.md new file mode 100644 index 0000000000..f51b691565 --- /dev/null +++ b/pages.cn/common/godoc.md @@ -0,0 +1,23 @@ +# godoc + +> Show documentation for go packages. + +- Display help for package "fmt": + +`godoc {{fmt}}` + +- Display help for the function "Printf" of "fmt" package: + +`godoc {{fmt}} {{Printf}}` + +- Serve documentation as a web server on port "6060": + +`godoc -http=:{{6060}}` + +- Create an index file: + +`godoc -write_index -index_files={{path/to/file}}` + +- Use the given index file to search the docs: + +`godoc -http=:{{6060}} -index -index_files={{path/to/file}}` diff --git a/pages.cn/common/godot.md b/pages.cn/common/godot.md new file mode 100644 index 0000000000..852ac2ab38 --- /dev/null +++ b/pages.cn/common/godot.md @@ -0,0 +1,23 @@ +# godot + +> An open source 2D and 3D game engine. + +- Run a project if the current directory contains a `project.godot` file, otherwise open the project manager: + +`godot` + +- Edit a project (the current directory must contain a `project.godot` file): + +`godot -e` + +- Open the project manager even if the current directory contains a `project.godot` file: + +`godot -p` + +- Export a project for a given target (the target must be defined in the project): + +`godot --export {{target}}` + +- Execute a standalone GDScript file: + +`godot -s {{script.gd}}` diff --git a/pages.cn/common/gofmt.md b/pages.cn/common/gofmt.md new file mode 100644 index 0000000000..7c7dadafc8 --- /dev/null +++ b/pages.cn/common/gofmt.md @@ -0,0 +1,19 @@ +# gofmt + +> Tool for formatting Go source code. + +- Format a file and display the result to the console: + +`gofmt {{source.go}}` + +- Format a file, overwriting the original file in-place: + +`gofmt -w {{source.go}}` + +- Format a file, and then simplify the code, overwriting the original file: + +`gofmt -s -w {{source.go}}` + +- Print all (including spurious) errors: + +`gofmt -e {{source.go}}` diff --git a/pages.cn/common/gource.md b/pages.cn/common/gource.md new file mode 100644 index 0000000000..8304fcc169 --- /dev/null +++ b/pages.cn/common/gource.md @@ -0,0 +1,28 @@ +# gource + +> Renders an animated tree diagram of Git, SVN, Mercurial and Bazaar repositories. +> It shows files and folders being created, modified or removed over time. + +- Run gource in a directory (if it isn't the repository's root directory, the root is seeked up from there): + +`gource {{path/to/repository}}` + +- Run gource in the current directory, with a custom output resolution: + +`gource -{{width}}x{{height}}` + +- Set a custom time scale for the animation: + +`gource -c {{time_scale_multiplier}}` + +- Set how long each day should be in the animation (this combines with -c, if provided): + +`gource -s {{seconds}}` + +- Set fullscreen mode and a custom background color: + +`gource -f -b {{hex_color_code}}` + +- Set a title for the animation: + +`gource --title {{title}}` diff --git a/pages.cn/common/gpg-zip.md b/pages.cn/common/gpg-zip.md new file mode 100644 index 0000000000..4a024bc02c --- /dev/null +++ b/pages.cn/common/gpg-zip.md @@ -0,0 +1,15 @@ +# gpg-zip + +> Encrypt files and directories in an archive using GPG. + +- Encrypt a directory into archive.gpg using a passphrase: + +`gpg-zip --symmetric --output {{archive.gpg}} {{path/to/directory}}` + +- Decrypt archive.gpg into a directory of the same name: + +`gpg-zip --decrypt {{path/to/archive.gpg}}` + +- List the contents of the encrypted archive.gpg: + +`gpg-zip --list-archive {{path/to/archive.gpg}}` diff --git a/pages.cn/common/gpg.md b/pages.cn/common/gpg.md new file mode 100644 index 0000000000..99ede58984 --- /dev/null +++ b/pages.cn/common/gpg.md @@ -0,0 +1,31 @@ +# gpg + +> GNU Privacy Guard. + +- Sign doc.txt without encryption (writes output to doc.txt.asc): + +`gpg --clearsign {{doc.txt}}` + +- Encrypt doc.txt for alice@example.com (output to doc.txt.gpg): + +`gpg --encrypt --recipient {{alice@example.com}} {{doc.txt}}` + +- Encrypt doc.txt with only a passphrase (output to doc.txt.gpg): + +`gpg --symmetric {{doc.txt}}` + +- Decrypt doc.txt.gpg (output to STDOUT): + +`gpg --decrypt {{doc.txt.gpg}}` + +- Import a public key: + +`gpg --import {{public.gpg}}` + +- Export public key for alice@example.com (output to STDOUT): + +`gpg --export --armor {{alice@example.com}}` + +- Export private key for alice@example.com (output to STDOUT): + +`gpg --export-secret-keys --armor {{alice@example.com}}` diff --git a/pages.cn/common/gradle.md b/pages.cn/common/gradle.md new file mode 100644 index 0000000000..9dc466d476 --- /dev/null +++ b/pages.cn/common/gradle.md @@ -0,0 +1,23 @@ +# gradle + +> Gradle is an advanced open source build automation system. + +- Compile a package: + +`gradle build` + +- Exclude test task: + +`gradle build -x {{test}}` + +- Run in offline mode to prevent gradle from accessing the network during builds: + +`gradle build --offline` + +- Clear the build folder: + +`gradle clean` + +- Compile and Release package: + +`gradle assembleRelease` diff --git a/pages.cn/common/grep.md b/pages.cn/common/grep.md new file mode 100644 index 0000000000..4a67fcb5ca --- /dev/null +++ b/pages.cn/common/grep.md @@ -0,0 +1,36 @@ +# grep + +> Matches patterns in input text. +> Supports simple patterns and regular expressions. + +- Search for an exact string: + +`grep {{search_string}} {{path/to/file}}` + +- Search in case-insensitive mode: + +`grep -i {{search_string}} {{path/to/file}}` + +- Search recursively (ignoring non-text files) in current directory for an exact string: + +`grep -RI {{search_string}} .` + +- Use extended regular expressions (supporting `?`, `+`, `{}`, `()` and `|`): + +`grep -E {{^regex$}} {{path/to/file}}` + +- Print 3 lines of [C]ontext around, [B]efore, or [A]fter each match: + +`grep -{{C|B|A}} 3 {{search_string}} {{path/to/file}}` + +- Print file name with the corresponding line number for each match: + +`grep -Hn {{search_string}} {{path/to/file}}` + +- Use the standard input instead of a file: + +`cat {{path/to/file}} | grep {{search_string}}` + +- Invert match for excluding specific strings: + +`grep -v {{search_string}}` diff --git a/pages.cn/common/groff.md b/pages.cn/common/groff.md new file mode 100644 index 0000000000..5abfae2890 --- /dev/null +++ b/pages.cn/common/groff.md @@ -0,0 +1,24 @@ +# groff + +> Typesetting program that reads plain text mixed with formatting commands and produces formatted output. +> It is the GNU replacement for the `troff` and `nroff` Unix commands for text formatting. + +- Render a man page as plain text, and display the result: + +`groff -man -T utf8 {{manpage.1}}` + +- Render a man page using the ASCII output device, and display it using a pager: + +`groff -man -T ascii {{manpage.1}} | less` + +- Render a man page into an HTML file: + +`groff -man -T html {{manpage.1}} > {{page.html}}` + +- Process a roff file using the `tbl` and `pic` preprocessors, and the `me` macro set: + +`groff -t -p -me -T utf8 {{foo.me}}` + +- Run a `groff` command with preprocessor and macro options guessed by the `grog` utility: + +`eval "$(grog -T utf8 {{foo.me}})"` diff --git a/pages.cn/common/groups.md b/pages.cn/common/groups.md new file mode 100644 index 0000000000..e570409872 --- /dev/null +++ b/pages.cn/common/groups.md @@ -0,0 +1,15 @@ +# groups + +> Print group memberships for a user. + +- Print group memberships for the current user: + +`groups` + +- Print group memberships for a specific user: + +`groups {{username}}` + +- Print group memberships for a list of users: + +`groups {{username1}} {{username2}} {{username3}}` diff --git a/pages.cn/common/grunt.md b/pages.cn/common/grunt.md new file mode 100644 index 0000000000..23efca85fc --- /dev/null +++ b/pages.cn/common/grunt.md @@ -0,0 +1,31 @@ +# grunt + +> A JavaScript task runner for automating processes. + +- Run the default task process: + +`grunt` + +- Run one or more specific space-separated task(s): + +`grunt {{task_name}}` + +- Specify an alternative configuration file: + +`grunt --gruntfile {{path/to/file}}` + +- Specify an alternative base path for relative files: + +`grunt --base {{path/to/directory}}` + +- Specify an additional directory to scan for tasks in: + +`grunt --tasks {{path/to/directory}}` + +- Perform a dry-run without writing any files: + +`grunt --no-write` + +- List all available options: + +`grunt --help` diff --git a/pages.cn/common/gtop.md b/pages.cn/common/gtop.md new file mode 100644 index 0000000000..69a44bd555 --- /dev/null +++ b/pages.cn/common/gtop.md @@ -0,0 +1,15 @@ +# gtop + +> System monitoring dashboard for the terminal. + +- Show the system stats dashboard: + +`gtop` + +- Sort by CPU usage: + +`c` + +- Sort by memory usage: + +`m` diff --git a/pages.cn/common/guetzli.md b/pages.cn/common/guetzli.md new file mode 100644 index 0000000000..b4eb3b37db --- /dev/null +++ b/pages.cn/common/guetzli.md @@ -0,0 +1,15 @@ +# guetzli + +> JPEG image compression utility. + +- Compress a JPEG image: + +`guetzli {{input.jpg}} {{output.jpg}}` + +- Create compressed JPEG image from PNG image: + +`guetzli {{input.png}} {{output.jpg}}` + +- Compress a JPEG image with desired visual quality (84-100): + +`guetzli --quality {{quality_value}} {{input.jpg}} {{output.jpg}}` diff --git a/pages.cn/common/guile.md b/pages.cn/common/guile.md new file mode 100644 index 0000000000..86d1cca122 --- /dev/null +++ b/pages.cn/common/guile.md @@ -0,0 +1,19 @@ +# guile + +> Guile Scheme interpreter. + +- Start the Guile Scheme REPL: + +`guile` + +- Execute the script in a given Scheme file: + +`guile {{script.scm}}` + +- Execute a Scheme expression: + +`guile -c "{{expression}}"` + +- Listen on a port or a Unix domain socket (the default is port 37146) for remote REPL connections: + +`guile --listen={{port_or_socket}}` diff --git a/pages.cn/common/gulp.md b/pages.cn/common/gulp.md new file mode 100644 index 0000000000..a93ac39c3c --- /dev/null +++ b/pages.cn/common/gulp.md @@ -0,0 +1,12 @@ +# gulp + +> JavaScript task runner and streaming build system. +> Tasks are defined within gulpfile.js at the project root. + +- Run the default task: + +`gulp` + +- Run individual tasks: + +`gulp {{task}} {{othertask}}` diff --git a/pages.cn/common/gunzip.md b/pages.cn/common/gunzip.md new file mode 100644 index 0000000000..94fa8b600f --- /dev/null +++ b/pages.cn/common/gunzip.md @@ -0,0 +1,15 @@ +# gunzip + +> Extract file(s) from a gzip (.gz) archive. + +- Extract a file from an archive, replacing the original file if it exists: + +`gunzip {{archive.tar.gz}}` + +- Extract a file to a target destination: + +`gunzip -c {{archive.tar.gz}} > {{archive.tar}}` + +- List the contents of a compressed file: + +`gunzip -l {{file.txt.gz}}` diff --git a/pages.cn/common/gzip.md b/pages.cn/common/gzip.md new file mode 100644 index 0000000000..dc64d18b38 --- /dev/null +++ b/pages.cn/common/gzip.md @@ -0,0 +1,23 @@ +# gzip + +> Compress/uncompress files with gzip compression (LZ77). + +- Compress a file, replacing it with a gzipped compressed version: + +`gzip {{file.ext}}` + +- Decompress a file, replacing it with the original uncompressed version: + +`gzip -d {{file.ext}}.gz` + +- Compress a file specifying the output filename: + +`gzip -c {{file.ext}} > {{compressed_file.ext.gz}}` + +- Uncompress a gzipped file specifying the output filename: + +`gzip -c -d {{file.ext}}.gz > {{uncompressed_file.ext}}` + +- Specify the compression level. 1=Fastest (Worst), 9=Slowest (Best), Default level is 6: + +`gzip -9 -c {{file.ext}} > {{compressed_file.ext.gz}}` diff --git a/pages.cn/common/handbrakecli.md b/pages.cn/common/handbrakecli.md new file mode 100644 index 0000000000..4148b4dca0 --- /dev/null +++ b/pages.cn/common/handbrakecli.md @@ -0,0 +1,19 @@ +# handbrakecli + +> Command-line interface to the HandBrake video conversion tool. + +- Convert a video file to MKV (AAC 160kbit audio and x264 CRF20 video): + +`handbrakecli -i {{input.avi}} -o {{output.mkv}} -e x264 -q 20 -B 160` + +- Resize a video file to 320x240: + +`handbrakecli -i {{input.mp4}} -o {{output.mp4} -w 320 -l 240` + +- List available presets: + +`handbrakecli --preset-list` + +- Convert an AVI video to MP4 using the Android preset: + +`handbrakecli --preset="Android" -i {{input.ext}} -o {{output.mp4}}` diff --git a/pages.cn/common/hangups.md b/pages.cn/common/hangups.md new file mode 100644 index 0000000000..fcbaf9c166 --- /dev/null +++ b/pages.cn/common/hangups.md @@ -0,0 +1,15 @@ +# hangups + +> Third party command line client for Google Hangouts. + +- Start hangups: + +`hangups` + +- View troubeshooting information and help: + +`hangups -h` + +- Set a refresh token for hangups: + +`hangups --token-path {{/path/to/token}}` diff --git a/pages.cn/common/haxelib.md b/pages.cn/common/haxelib.md new file mode 100644 index 0000000000..0a85170b8d --- /dev/null +++ b/pages.cn/common/haxelib.md @@ -0,0 +1,19 @@ +# haxelib + +> Haxe Library Manager. + +- Search for a Haxe library: + +`haxelib search {{keyword}}` + +- Install a Haxe library: + +`haxelib install {{libname}}` + +- Upgrade all installed Haxe libraries: + +`haxelib upgrade` + +- Install the development version of a library from a Git repository: + +`haxelib git {{libname}} {{git_url}}` diff --git a/pages.cn/common/head.md b/pages.cn/common/head.md new file mode 100644 index 0000000000..e0351ae70a --- /dev/null +++ b/pages.cn/common/head.md @@ -0,0 +1,19 @@ +# head + +> Output the first part of files. + +- Output the first few lines of a file: + +`head -n {{count_of_lines}} {{filename}}` + +- Output the first few bytes of a file: + +`head -c {{size_in_bytes}} {{filename}}` + +- Output everything but the last few lines of a file: + +`head -n -{{count_of_lines}} {{filename}}` + +- Output everything but the last few bytes of a file: + +`head -c -{{size_in_bytes}} {{filename}}` diff --git a/pages.cn/common/helm.md b/pages.cn/common/helm.md new file mode 100644 index 0000000000..65b460405c --- /dev/null +++ b/pages.cn/common/helm.md @@ -0,0 +1,35 @@ +# helm + +> Helm is a package manager for Kubernetes. + +- Create a helm chart: + +`helm create {{chart_name}}` + +- Add a new helm repository: + +`helm repo add {{repo_name}}` + +- List helm repositories: + +`helm repo list` + +- Update helm repositories: + +`helm repo update` + +- Delete a helm repository: + +`helm repo remove {{repo_name}}` + +- Install a helm chart: + +`helm install {{repo_name}}/{{chart_name}}` + +- Download helm chart as a tar archive: + +`helm get {{chart_release_name}}` + +- Update helm dependencies: + +`helm dependency update` diff --git a/pages.cn/common/help2man.md b/pages.cn/common/help2man.md new file mode 100644 index 0000000000..3dfc70d05a --- /dev/null +++ b/pages.cn/common/help2man.md @@ -0,0 +1,23 @@ +# help2man + +> Produce simple man pages from an executable's `--help` and `--version` output. + +- Generate a man page for an executable: + +`help2man {{executable}}` + +- Specify the "name" paragraph in the man page: + +`help2man {{executable}} --name {{name}}` + +- Specify the section for the man page (defaults to 1): + +`help2man {{executable}} --section {{section}}` + +- Output to a file instead of stdout: + +`help2man {{executable}} --output {{path/to/file}}` + +- Display detailed help: + +`help2man --help` diff --git a/pages.cn/common/heroku.md b/pages.cn/common/heroku.md new file mode 100644 index 0000000000..539571ee1b --- /dev/null +++ b/pages.cn/common/heroku.md @@ -0,0 +1,27 @@ +# heroku + +> Create and manage Heroku apps from the command line. + +- Login to your heroku account: + +`heroku login` + +- Create a heroku app: + +`heroku create` + +- Show logs for an app: + +`heroku logs --app {{app_name}}` + +- Run a one-off process inside a dyno (Heroku virtual machine): + +`heroku run {{process_name}} --app {{app_name}}` + +- List dynos (Heroku virtual machines) for an app: + +`heroku ps --app {{app_name}}` + +- Permanently destroy an app: + +`heroku destroy --app {{app_name}}` diff --git a/pages.cn/common/hg-add.md b/pages.cn/common/hg-add.md new file mode 100644 index 0000000000..28d643d0f2 --- /dev/null +++ b/pages.cn/common/hg-add.md @@ -0,0 +1,23 @@ +# hg add + +> Adds specified files to the staging area for the next commit in Mercurial. + +- Add files or directories to the staging area: + +`hg add {{path/to/file}}` + +- Add all unstaged files matching a specified pattern: + +`hg add --include {{pattern}}` + +- Add all unstaged files, excluding those that match a specified pattern: + +`hg add --exclude {{pattern}}` + +- Recursively add sub-repositories: + +`hg add --subrepos` + +- Perform a test-run without performing any actions: + +`hg add --dry-run` diff --git a/pages.cn/common/hg-branch.md b/pages.cn/common/hg-branch.md new file mode 100644 index 0000000000..106b949216 --- /dev/null +++ b/pages.cn/common/hg-branch.md @@ -0,0 +1,11 @@ +# hg branch + +> Create or show a branch name. + +- Show the name of the currently active branch: + +`hg branch` + +- Create a new branch for the next commit: + +`hg branch {{branch_name}}` diff --git a/pages.cn/common/hg-clone.md b/pages.cn/common/hg-clone.md new file mode 100644 index 0000000000..aa8131fa09 --- /dev/null +++ b/pages.cn/common/hg-clone.md @@ -0,0 +1,23 @@ +# hg clone + +> Create a copy of an existing repository in a new directory. + +- Clone a repository to a specified directory: + +`hg clone {{remote_repository_source}} {{destination_path}}` + +- Clone a repository to the head of a specific branch, ignoring later commits: + +`hg clone --branch {{branch}} {{remote_repository_source}}` + +- Clone a repository with only the ".hg" directory, without checking out files: + +`hg clone --noupdate {{remote_repository_source}}` + +- Clone a repository to a specific revision, tag or branch, keeping the entire history: + +`hg clone --updaterev {{revision}} {{remote_repository_source}}` + +- Clone a repository up to a specific revision without any newer history: + +`hg clone --rev {{revision}} {{remote_repository_source}}` diff --git a/pages.cn/common/hg-commit.md b/pages.cn/common/hg-commit.md new file mode 100644 index 0000000000..3faf5ba998 --- /dev/null +++ b/pages.cn/common/hg-commit.md @@ -0,0 +1,27 @@ +# hg commit + +> Commit all staged or specified files to the repository. + +- Commit staged files to the repository: + +`hg commit` + +- Commit a specific file or directory: + +`hg commit {{path/to/file}}` + +- Commit with a specific message: + +`hg commit --message {{message}}` + +- Commit all files matching a specified pattern: + +`hg commit --include {{pattern}}` + +- Commit all files, excluding those that match a specified pattern: + +`hg commit --exclude {{pattern}}` + +- Commit using the interactive mode: + +`hg commit --interactive` diff --git a/pages.cn/common/hg-init.md b/pages.cn/common/hg-init.md new file mode 100644 index 0000000000..70d1babf5a --- /dev/null +++ b/pages.cn/common/hg-init.md @@ -0,0 +1,11 @@ +# hg init + +> Create a new repository in the specified directory. + +- Initialise a new repository in the current directory: + +`hg init` + +- Initialise a new repository in the specified directory: + +`hg init {{path/to/directory}}` diff --git a/pages.cn/common/hg-log.md b/pages.cn/common/hg-log.md new file mode 100644 index 0000000000..70dae7c744 --- /dev/null +++ b/pages.cn/common/hg-log.md @@ -0,0 +1,35 @@ +# hg log + +> Display the revision history of the repository. + +- Display the entire revision history of the repository: + +`hg log` + +- Display the revision history with an ASCII graph: + +`hg log --graph` + +- Display the revision history with file names matching a specified pattern: + +`hg log --include {{pattern}}` + +- Display the revision history, excluding file names that match a specified pattern: + +`hg log --exclude {{pattern}}` + +- Display the log information for a specific revision: + +`hg log --rev {{revision}}` + +- Display the revision history for a specific branch: + +`hg log --branch {{branch}}` + +- Display the revision history for a specific date: + +`hg log --date {{date}}` + +- Display revisions committed by a specific user: + +`hg log --user {{user}}` diff --git a/pages.cn/common/hg-pull.md b/pages.cn/common/hg-pull.md new file mode 100644 index 0000000000..91e58ff119 --- /dev/null +++ b/pages.cn/common/hg-pull.md @@ -0,0 +1,31 @@ +# hg pull + +> Pull changes from a specified repository to the local repository. + +- Pull from the "default" source path: + +`hg pull` + +- Pull from a specified source repository: + +`hg pull {{path/to/source_repository}}` + +- Update the local repository to the head of the remote: + +`hg pull --update` + +- Pull changes even when the remote repository is unrelated: + +`hg pull --force` + +- Specify a specific revision changeset to pull up to: + +`hg pull --rev {{revision}}` + +- Specify a specific branch to pull: + +`hg pull --branch {{branch}}` + +- Specify a specific bookmark to pull: + +`hg pull --bookmark {{bookmark}}` diff --git a/pages.cn/common/hg-push.md b/pages.cn/common/hg-push.md new file mode 100644 index 0000000000..124d1454de --- /dev/null +++ b/pages.cn/common/hg-push.md @@ -0,0 +1,27 @@ +# hg push + +> Push changes from the local repository to a specified destination. + +- Push changes to the "default" remote path: + +`hg push` + +- Push changes to a specified remote repository: + +`hg push {{path/to/destination_repository}}` + +- Push a new branch if it does not exist (disabled by default): + +`hg push --new-branch` + +- Specify a specific revision changeset to push: + +`hg push --rev {{revision}}` + +- Specify a specific branch to push: + +`hg push --branch {{branch}}` + +- Specify a specific bookmark to push: + +`hg push --bookmark {{bookmark}}` diff --git a/pages.cn/common/hg-remove.md b/pages.cn/common/hg-remove.md new file mode 100644 index 0000000000..8cf65363ec --- /dev/null +++ b/pages.cn/common/hg-remove.md @@ -0,0 +1,23 @@ +# hg remove + +> Remove specified files from the staging area. + +- Remove files or directories from the staging area: + +`hg remove {{path/to/file}}` + +- Remove all staged files matching a specified pattern: + +`hg remove --include {{pattern}}` + +- Remove all staged files, excluding those that match a specified pattern: + +`hg remove --exclude {{pattern}}` + +- Recursively remove sub-repositories: + +`hg remove --subrepos` + +- Remove files from the repository that have been physically removed: + +`hg remove --after` diff --git a/pages.cn/common/hg-serve.md b/pages.cn/common/hg-serve.md new file mode 100644 index 0000000000..0f1b27d84b --- /dev/null +++ b/pages.cn/common/hg-serve.md @@ -0,0 +1,27 @@ +# hg serve + +> Start a standalone Mercurial web server for browsing repositories. + +- Start a web server instance: + +`hg serve` + +- Start a web server instance on the specified port: + +`hg serve --port {{port}}` + +- Start a web server instance on the specified listening address: + +`hg serve --address {{address}}` + +- Start a web server instance with a specific identifier: + +`hg serve --name {{name}}` + +- Start a web server instance using the specified theme (see the templates directory): + +`hg serve --style {{style}}` + +- Start a web server instance using the specified SSL certificate bundle: + +`hg serve --certificate {{path/to/certificate}}` diff --git a/pages.cn/common/hg-update.md b/pages.cn/common/hg-update.md new file mode 100644 index 0000000000..9570171562 --- /dev/null +++ b/pages.cn/common/hg-update.md @@ -0,0 +1,19 @@ +# hg update + +> Update the working directory to a specified changeset. + +- Update to the tip of the current branch: + +`hg update` + +- Update to the specified revision: + +`hg update --rev {{revision}}` + +- Update and discard uncommitted changes: + +`hg update --clean` + +- Update to the last commit matching a specified date: + +`hg update --date {{dd-mm-yyyy}}` diff --git a/pages.cn/common/hg.md b/pages.cn/common/hg.md new file mode 100644 index 0000000000..b85b1de811 --- /dev/null +++ b/pages.cn/common/hg.md @@ -0,0 +1,20 @@ +# hg + +> A command line interface for Mercurial, a distributed source control management system. +> See `hg-add`, `hg-commit` and other pages for additional information. + +- Execute Mercurial command: + +`hg {{command}}` + +- Call general help: + +`hg help` + +- Call help on a command: + +`hg help {{command}}` + +- Check the Mercurial version: + +`hg --version` diff --git a/pages.cn/common/history.md b/pages.cn/common/history.md new file mode 100644 index 0000000000..8e7acaadc7 --- /dev/null +++ b/pages.cn/common/history.md @@ -0,0 +1,15 @@ +# history + +> Command Line history. + +- Display the commands history list with line numbers: + +`history` + +- Clear the commands history list (only for current `bash` shell): + +`history -c` + +- Overwrite history file with history of current `bash` shell (often combined with `history -c` to purge history): + +`history -w` diff --git a/pages.cn/common/hn.md b/pages.cn/common/hn.md new file mode 100644 index 0000000000..2b1044958a --- /dev/null +++ b/pages.cn/common/hn.md @@ -0,0 +1,19 @@ +# hn + +> Command-line interface for Hacker News. + +- View stories on Hacker News: + +`hn` + +- View _number_ of stories on Hacker News: + +`hn --limit {{number}}` + +- View stories on Hacker News, and keep the list open after selecting a link: + +`hn --keep-open` + +- View stories on Hacker News sorted by submission date: + +`hn --latest` diff --git a/pages.cn/common/host.md b/pages.cn/common/host.md new file mode 100644 index 0000000000..ecd88fc2f4 --- /dev/null +++ b/pages.cn/common/host.md @@ -0,0 +1,19 @@ +# host + +> Lookup Domain Name Server. + +- Lookup A, AAAA, and MX records of a domain: + +`host {{domain}}` + +- Lookup a field (CNAME, TXT,...) of a domain: + +`host -t {{field}} {{domain}}` + +- Reverse lookup an IP: + +`host {{ip_address}}` + +- Specify an alternate DNS server to query: + +`host {{domain}} {{8.8.8.8}}` diff --git a/pages.cn/common/hostess.md b/pages.cn/common/hostess.md new file mode 100644 index 0000000000..998f6787d7 --- /dev/null +++ b/pages.cn/common/hostess.md @@ -0,0 +1,19 @@ +# hostess + +> An idempotent command-line utility for managing your /etc/hosts file. + +- List domains, target ips and on/off status: + +`hostess list` + +- Add a domain pointing to your machine to your hosts file: + +`hostess add {{local.example.com}} {{127.0.0.1}}` + +- Remove a domain from your hosts file: + +`hostess del {{local.example.com}}` + +- Disable a domain (but don't remove it completely): + +`hostess off {{local.example.com}}` diff --git a/pages.cn/common/hostid.md b/pages.cn/common/hostid.md new file mode 100644 index 0000000000..9aff83b58e --- /dev/null +++ b/pages.cn/common/hostid.md @@ -0,0 +1,7 @@ +# hostid + +> Prints the numeric identifier for the current host (not necessarily the IP address). + +- Display the numeric identifier for the current host in hexadecimal: + +`hostid` diff --git a/pages.cn/common/hr.md b/pages.cn/common/hr.md new file mode 100644 index 0000000000..52e5fedd19 --- /dev/null +++ b/pages.cn/common/hr.md @@ -0,0 +1,15 @@ +# hr + +> Print a horizontal rule in the terminal. + +- Print a horizontal rule: + +`hr` + +- Print a horizontal rule with a custom string: + +`hr {{string}}` + +- Print a multiline horizontal rule: + +`hr {{string_a}} {{string_b}} {{string_c}}` diff --git a/pages.cn/common/htpasswd.md b/pages.cn/common/htpasswd.md new file mode 100644 index 0000000000..4f9b72b614 --- /dev/null +++ b/pages.cn/common/htpasswd.md @@ -0,0 +1,23 @@ +# htpasswd + +> Create and manage htpasswd files to protect web server directories using basic authentication. + +- Create/overwrite htpasswd file: + +`htpasswd -c {{path/to/file}} {{user_name}}` + +- Add user to htpasswd file or update existing user: + +`htpasswd {{path/to/file}} {{user_name}}` + +- Add user to htpasswd file in batch mode without an interactive password prompt (for script usage): + +`htpasswd -b {{path/to/file}} {{user_name}} {{password}}` + +- Delete user from htpasswd file: + +`htpasswd -D {{path/to/file}} {{user_name}}` + +- Verify user password: + +`htpasswd -v {{path/to/file}} {{user_name}}` diff --git a/pages.cn/common/http.md b/pages.cn/common/http.md new file mode 100644 index 0000000000..87f02da3ec --- /dev/null +++ b/pages.cn/common/http.md @@ -0,0 +1,31 @@ +# http + +> HTTPie: HTTP client, a user-friendly cURL replacement. + +- Download a URL to a file: + +`http -d {{example.org}}` + +- Send form-encoded data: + +`http -f {{example.org}} {{name='bob'}} {{profile_picture@'bob.png'}}` + +- Send JSON object: + +`http {{example.org}} {{name='bob'}}` + +- Specify an HTTP method: + +`http {{HEAD}} {{example.org}}` + +- Include an extra header: + +`http {{example.org}} {{X-MyHeader:123}}` + +- Pass a user name and password for server authentication: + +`http -a {{username:password}} {{example.org}}` + +- Specify raw request body via stdin: + +`cat {{data.txt}} | http PUT {{example.org}}` diff --git a/pages.cn/common/hub.md b/pages.cn/common/hub.md new file mode 100644 index 0000000000..97b682ec56 --- /dev/null +++ b/pages.cn/common/hub.md @@ -0,0 +1,24 @@ +# hub + +> A wrapper for git that adds commands for working with github-based projects. +> The commands can also be used using "git" instead of "hub". + +- Clone a repository you own, using just the repository name rather than the full URL: + +`hub clone {{repo_name}}` + +- Clone another user's repository, using their github username and the repository name: + +`hub clone {{username}}/{{repo_name}}` + +- Create a fork of the current repository (cloned from another user) under your github profile: + +`hub fork` + +- Create a PR of the current branch in the original repository (after pushing the branch to github): + +`hub pull-request` + +- Upload the current (local-only) repository to your github account: + +`hub create` diff --git a/pages.cn/common/hugo.md b/pages.cn/common/hugo.md new file mode 100644 index 0000000000..5aa06fa371 --- /dev/null +++ b/pages.cn/common/hugo.md @@ -0,0 +1,31 @@ +# hugo + +> Hugo is a fast and flexible static site generator. + +- Create a new Hugo site: + +`hugo new site {{path/to/site}}` + +- Create a new Hugo theme (themes may also be downloaded from https://themes.gohugo.io/): + +`hugo new theme {{theme_name}}` + +- Create a new page: + +`hugo new {{section_name}}/{{filename}}` + +- Build a site to the `./public/` directory: + +`hugo` + +- Build a site including pages that are marked as a "draft": + +`hugo --buildDrafts` + +- Build a site to a given directory: + +`hugo --destination {{path/to/destination}}` + +- Build a site, start up a webserver to serve it, and automatically reload when pages are edited: + +`hugo server` diff --git a/pages.cn/common/hyperfine.md b/pages.cn/common/hyperfine.md new file mode 100644 index 0000000000..d99e959d4a --- /dev/null +++ b/pages.cn/common/hyperfine.md @@ -0,0 +1,27 @@ +# hyperfine + +> A command-line benchmarking tool. + +- Run a basic benchmark, performing at least 10 runs: + +`hyperfine '{{make}}'` + +- Run a comparative benchmark: + +`hyperfine '{{make target1}}' '{{make target2}}'` + +- Change minimum number of benchmarking runs: + +`hyperfine --min-runs {{7}} '{{make}}'` + +- Perform benchmark with warmup: + +`hyperfine --warmup {{5}} '{{make}}'` + +- Run a command before each benchmark run (to clear caches, etc.): + +`hyperfine --prepare '{{make clean}}' '{{make}}'` + +- Run a benchmark where a single parameter changes for each run: + +`hyperfine --prepare '{{make clean}}' --parameter-scan num_threads {{1}} {{10}} '{{make -j {num_threads}}}'` diff --git a/pages.cn/common/iconv.md b/pages.cn/common/iconv.md new file mode 100644 index 0000000000..40baed855b --- /dev/null +++ b/pages.cn/common/iconv.md @@ -0,0 +1,15 @@ +# iconv + +> Converts text from one encoding to another. + +- Convert file to a specific encoding, and print to stdout: + +`iconv -f {{from_encoding}} -t {{to_encoding}} {{input_file}}` + +- Convert file to the current locale's encoding, and output to a file: + +`iconv -f {{from_encoding}} {{input_file}} > {{output_file}}` + +- List supported encodings: + +`iconv -l` diff --git a/pages.cn/common/id.md b/pages.cn/common/id.md new file mode 100644 index 0000000000..2aa5331ba5 --- /dev/null +++ b/pages.cn/common/id.md @@ -0,0 +1,11 @@ +# id + +> Display current user and group identity. + +- Display the current user identity as a number: + +`id -u` + +- Display the current group identity as a number: + +`id -g` diff --git a/pages.cn/common/id3tag.md b/pages.cn/common/id3tag.md new file mode 100644 index 0000000000..7494dc75ba --- /dev/null +++ b/pages.cn/common/id3tag.md @@ -0,0 +1,15 @@ +# id3tag + +> Tool for reading, writing, and manipulating ID3v1 and ID3v2 tags of MP3 files. + +- Set artist and title tag of an MP3 file: + +`id3tag --artist={{artist}} --title={{title}} {{path/to/file.mp3}}` + +- Set album title of all MP3 files in the current directory: + +`id3tag --album={{album}} {{*.mp3}}` + +- Get more help: + +`id3tag --help` diff --git a/pages.cn/common/if.md b/pages.cn/common/if.md new file mode 100644 index 0000000000..25e6252dfa --- /dev/null +++ b/pages.cn/common/if.md @@ -0,0 +1,11 @@ +# if + +> Simple shell conditional. + +- Echo a different thing depending on a command's success: + +`{{command}} && echo "success" || echo "failure"` + +- Full if syntax: + +`if {{condition}}; then echo "true"; else echo "false"; fi` diff --git a/pages.cn/common/ifconfig.md b/pages.cn/common/ifconfig.md new file mode 100644 index 0000000000..3655228457 --- /dev/null +++ b/pages.cn/common/ifconfig.md @@ -0,0 +1,23 @@ +# ifconfig + +> Network Interface Configurator. + +- View network settings of an ethernet adapter: + +`ifconfig eth0` + +- Display details of all interfaces, including disabled interfaces: + +`ifconfig -a` + +- Disable eth0 interface: + +`ifconfig eth0 down` + +- Enable eth0 interface: + +`ifconfig eth0 up` + +- Assign IP address to eth0 interface: + +`ifconfig eth0 {{ip_address}}` diff --git a/pages.cn/common/ignite.md b/pages.cn/common/ignite.md new file mode 100644 index 0000000000..943c585f13 --- /dev/null +++ b/pages.cn/common/ignite.md @@ -0,0 +1,19 @@ +# ignite + +> A CLI for React Native boilerplates, plugins, generators, and more. + +- Create a new React Native project: + +`ignite new {{project_name}}` + +- Generate file from a plugin: + +`ignite generate {{plugin_name}} {{file_name}}` + +- Add an Ignite plugin to the project: + +`ignite add {{plugin_name}}` + +- Remove an Ignite plugin from the project: + +`ignite remove {{plugin_name}}` diff --git a/pages.cn/common/imapsync.md b/pages.cn/common/imapsync.md new file mode 100644 index 0000000000..5d02f52955 --- /dev/null +++ b/pages.cn/common/imapsync.md @@ -0,0 +1,7 @@ +# imapsync + +> Email IMAP tool for syncing, copying and migrating email mailboxes between two imap servers, one way, and without duplicates. + +- Synchronize imap account between host1 and host2: + +`imapsync --host1 {{host1}} --user1 {{user1}} --password1 {{secret1}} --host2 {{host2}} --user2 {{user2}} --password2 {{secret2}}` diff --git a/pages.cn/common/import.md b/pages.cn/common/import.md new file mode 100644 index 0000000000..a59c41e95f --- /dev/null +++ b/pages.cn/common/import.md @@ -0,0 +1,16 @@ +# import + +> Capture some or all of an X server screen, and save the image to a file. +> Part of the ImageMagick library. + +- Capture the entire X server screen in the PostScript image format: + +`import -window root {{output.postscript}}` + +- Capture contents of a remote X server screen in the PNG image format: + +`import -window root -display {{remote_host}}:{screen}.{display} {{output.png}}` + +- Capture a specific window, given its ID as displayed by `xwininfo`, into the JPEG format: + +`import -window {{window_id}} {{output.jpg}}` diff --git a/pages.cn/common/in2csv.md b/pages.cn/common/in2csv.md new file mode 100644 index 0000000000..6342fe081a --- /dev/null +++ b/pages.cn/common/in2csv.md @@ -0,0 +1,20 @@ +# in2csv + +> Converts various tabular data formats into CSV. +> Included in csvkit. + +- Convert an XLS file to CSV: + +`in2csv {{data.xls}}` + +- Convert a DBF file to a CSV file: + +`in2csv {{data.dbf}} > {{data.csv}}` + +- Convert a specific sheet from an XLSX file to CSV: + +`in2csv --sheet={{sheet_name}} {{data.xlsx}}` + +- Pipe a JSON file to in2csv: + +`cat {{data.json}} | in2csv -f json > {{data.csv}}` diff --git a/pages.cn/common/inkscape.md b/pages.cn/common/inkscape.md new file mode 100644 index 0000000000..dfa30dce40 --- /dev/null +++ b/pages.cn/common/inkscape.md @@ -0,0 +1,28 @@ +# inkscape + +> An SVG (Scalable Vector Graphics) editing program. +> Use -z to not open the GUI and only process files in the console. + +- Open an SVG file in the Inkscape GUI: + +`inkscape {{filename.svg}}` + +- Export an SVG file into a bitmap with the default format (PNG) and the default resolution (90 DPI): + +`inkscape {{filename.svg}} -e {{filename.png}}` + +- Export an SVG file into a bitmap of 600x400 pixels (aspect ratio distortion may occur): + +`inkscape {{filename.svg}} -e {{filename.png}} -w {{600}} -h {{400}}` + +- Export a single object, given its ID, into a bitmap: + +`inkscape {{filename.svg}} -i {{id}} -e {{object.png}}` + +- Export an SVG document to PDF, converting all texts to paths: + +`inkscape {{filename.svg}} --export-pdf={{filename.pdf}} --export-text-to-path` + +- Duplicate the object with id="path123", rotate the duplicate 90 degrees, save the file, and quit Inkscape: + +`inkscape {{filename.svg}} --select=path123 --verb=EditDuplicate --verb=ObjectRotate90 --verb=FileSave --verb=FileQuit` diff --git a/pages.cn/common/install.md b/pages.cn/common/install.md new file mode 100644 index 0000000000..0059a913d3 --- /dev/null +++ b/pages.cn/common/install.md @@ -0,0 +1,24 @@ +# install + +> Copy files and set attributes. +> Copy files (often executable) to a system location like `/usr/local/bin`, give them the appropriate permissions/ownership. + +- Copy files to destination: + +`install {{path/to/source}} {{path/to/destination}}` + +- Copy files to destination, setting their ownership: + +`install -o {{user}} {{path/to/source}} {{path/to/destination}}` + +- Copy files to destination, setting their group ownership: + +`install -g {{user}} {{path/to/source}} {{path/to/destination}}` + +- Copy files to destination, setting their `mode`: + +`install -m {{+x}} {{path/to/source}} {{path/to/destination}}` + +- Copy files and apply access/modification times of source to destination: + +`install -p {{path/to/source}} {{path/to/destination}}` diff --git a/pages.cn/common/ionic.md b/pages.cn/common/ionic.md new file mode 100644 index 0000000000..f6abe27de5 --- /dev/null +++ b/pages.cn/common/ionic.md @@ -0,0 +1,27 @@ +# ionic + +> A framework to build hybrid mobile apps. + +- Create a new project: + +`ionic start` + +- Start a local dev server for app dev/testing: + +`ionic serve` + +- Generate new app component, directive, page, pipe, provider or tabs: + +`ionic g {{page}}` + +- Show versions of ionic, cordova, environment, etc.: + +`ionic info` + +- Run app on an android/ios device: + +`ionic cordova run {{android|ios}} --device` + +- Check the health of a ionic app: + +`ionic doctor {{check}}` diff --git a/pages.cn/common/ionice.md b/pages.cn/common/ionice.md new file mode 100644 index 0000000000..2b0115a03d --- /dev/null +++ b/pages.cn/common/ionice.md @@ -0,0 +1,17 @@ +# ionice + +> Get or set program I/O scheduling class and priority. +> Scheduling classes: 1 (realtime), 2 (best-effort), 3 (idle). +> Priority levels: 0 (the highest) - 7 (the lowest). + +- Set I/O scheduling class of a running process: + +`ionice -c {{scheduling_class}} -p {{pid}}` + +- Run a command with custom I/O scheduling class and priority: + +`ionice -c {{scheduling_class}} -n {{priority}} {{command}}` + +- Print the I/O scheduling class and priority of a running process: + +`ionice -p {{pid}}` diff --git a/pages.cn/common/ioping.md b/pages.cn/common/ioping.md new file mode 100644 index 0000000000..03b2eb9659 --- /dev/null +++ b/pages.cn/common/ioping.md @@ -0,0 +1,19 @@ +# ioping + +> Monitor I/O latency in real time. + +- Show disk I/O latency using the default values and the current directory: + +`ioping .` + +- Measure latency on /tmp using 10 requests of 1 megabyte each: + +`ioping -c 10 -s 1M /tmp` + +- Measure disk seek rate on /dev/sda: + +`ioping -R /dev/sda` + +- Measure disk sequential speed on /dev/sda: + +`ioping -RL /dev/sda` diff --git a/pages.cn/common/ipcs.md b/pages.cn/common/ipcs.md new file mode 100644 index 0000000000..d35fa4a167 --- /dev/null +++ b/pages.cn/common/ipcs.md @@ -0,0 +1,11 @@ +# ipcs + +> Display information about resources used in IPC (Inter-process Communication). + +- Specific information about the Message Queue which has the id 32768: + +`ipcs -qi 32768` + +- General information about all the IPC: + +`ipcs -a` diff --git a/pages.cn/common/iperf.md b/pages.cn/common/iperf.md new file mode 100644 index 0000000000..c2237a0ff7 --- /dev/null +++ b/pages.cn/common/iperf.md @@ -0,0 +1,15 @@ +# iperf + +> Measure network bandwidth between computers. + +- Run on server: + +`iperf -s` + +- Run on client: + +`iperf -c {{server_address}}` + +- Run on client with 5 parallel threads: + +`iperf -c {{server_address}} -P {{5}}` diff --git a/pages.cn/common/iperf3.md b/pages.cn/common/iperf3.md new file mode 100644 index 0000000000..23d94d107f --- /dev/null +++ b/pages.cn/common/iperf3.md @@ -0,0 +1,23 @@ +# iperf3 + +> Traffic generator for testing network bandwidth. + +- Run iperf3 as a server: + +`iperf3 -s` + +- Run an iperf3 server on a specific port: + +`iperf3 -s -p {{port}}` + +- Start bandwidth test: + +`iperf3 -c {{server}}` + +- Run iperf3 in multiple parallel streams: + +`iperf3 -c {{server}} -P {{streams}}` + +- Reverse direction of the test. Server sends data to the client: + +`iperf3 -c {{server}} -R` diff --git a/pages.cn/common/ipfs.md b/pages.cn/common/ipfs.md new file mode 100644 index 0000000000..1c434d0991 --- /dev/null +++ b/pages.cn/common/ipfs.md @@ -0,0 +1,32 @@ +# ipfs + +> Inter Planetary File System. +> A peer-to-peer hypermedia protocol to make the web faster, safer, and more open. + +- Add a file from local to the file system, pin it and print the relative hash: + +`ipfs add {{filename}}` + +- Add a folder and its files recursively from local to the file system and print the relative hash: + +`ipfs add -r {{folder}}` + +- Save a remote file and give it a name but not pin it: + +`ipfs get {{hash}} -o {{filename}}` + +- Pin a remote file locally: + +`ipfs pin add {{hash}}` + +- Display pinned files: + +`ipfs pin ls` + +- Unpin a file from the local storage: + +`ipfs pin rm {{hash}}` + +- Remove unpinned files from local storage: + +`ipfs repo gc` diff --git a/pages.cn/common/irssi.md b/pages.cn/common/irssi.md new file mode 100644 index 0000000000..cdea60bc76 --- /dev/null +++ b/pages.cn/common/irssi.md @@ -0,0 +1,27 @@ +# irssi + +> Text based IRC client. + +- Open irssi and connect to a server with a nickname: + +`irssi -n {{nickname}} -c {{server.name.com}}` + +- Open irssi and connect with a specific server on a given port: + +`irssi -c {{server.name.com}} -p {{port}}` + +- View the help: + +`irssi --help` + +- Join a channel: + +`/join {{#channelname}}` + +- Change active window (starts at 1): + +`/win {{window_number}}` + +- Exit the application cleanly and quitting any server(s): + +`/quit` diff --git a/pages.cn/common/jar.md b/pages.cn/common/jar.md new file mode 100644 index 0000000000..5bc83a8e8e --- /dev/null +++ b/pages.cn/common/jar.md @@ -0,0 +1,15 @@ +# jar + +> Java Applications/Libraries Packager. + +- Unzip .jar/.war file to the current directory: + +`jar -xvf {{file.jar}}` + +- List a .jar/.war file content: + +`jar tf {{path/to/file.jar}}` + +- List a .jar/.war file content with verbose output: + +`jar tvf {{path/to/file.jar}}` diff --git a/pages.cn/common/java.md b/pages.cn/common/java.md new file mode 100644 index 0000000000..ca800763bc --- /dev/null +++ b/pages.cn/common/java.md @@ -0,0 +1,15 @@ +# java + +> Java Application Launcher. + +- Execute a java .class file that contains a main method by using just the class name: + +`java {{classname}}` + +- Execute a .jar program: + +`java -jar {{filename.jar}}` + +- Display JDK, JRE and HotSpot versions: + +`java -version` diff --git a/pages.cn/common/javac.md b/pages.cn/common/javac.md new file mode 100644 index 0000000000..5d04e04dd3 --- /dev/null +++ b/pages.cn/common/javac.md @@ -0,0 +1,19 @@ +# javac + +> Java Application Compiler. + +- Compile a .java file: + +`javac {{file.java}}` + +- Compile several .java files: + +`javac {{file1.java}} {{file2.java}} {{file3.java}}` + +- Compile all .java files in current directory: + +`javac {{*.java}}` + +- Compile a .java file and place the resulting class file in a specific directory: + +`javac -d {{path/to/some/directory}} {{file.java}}` diff --git a/pages.cn/common/jekyll.md b/pages.cn/common/jekyll.md new file mode 100644 index 0000000000..ca1c98b3d5 --- /dev/null +++ b/pages.cn/common/jekyll.md @@ -0,0 +1,15 @@ +# jekyll + +> A simple, blog-aware, static site generator. + +- Generate a development server that will run at http://localhost:4000/: + +`jekyll serve` + +- Enable incremental regeneration: + +`jekyll serve --incremental` + +- Generate the current folder into "./_site": + +`jekyll build` diff --git a/pages.cn/common/jest.md b/pages.cn/common/jest.md new file mode 100644 index 0000000000..691cab7b47 --- /dev/null +++ b/pages.cn/common/jest.md @@ -0,0 +1,23 @@ +# jest + +> A zero-configuration JavaScript testing platform. + +- Run all tests: + +`jest` + +- Run only tests with a name that matches the regex pattern: + +`jest -t {{spec_name}}` + +- Run only tests relating to uncommitted files: + +`jest --onlyChanged` + +- Watch files for changes and rerun related tests: + +`jest --watch` + +- Show help: + +`jest --help` diff --git a/pages.cn/common/jhat.md b/pages.cn/common/jhat.md new file mode 100644 index 0000000000..4cc4c71960 --- /dev/null +++ b/pages.cn/common/jhat.md @@ -0,0 +1,15 @@ +# jhat + +> Java Heap Analysis Tool. + +- Analyze a heap dump (from jmap), view via http on port 7000: + +`jhat {{dump_file.bin}}` + +- Analyze a heap dump, specifying an alternate port for the http server: + +`jhat -p {{port}} {{dump_file.bin}}` + +- Analyze a dump letting jhat use up to 8GB RAM (2-4x dump size recommended): + +`jhat -J-mx8G {{dump_file.bin}}` diff --git a/pages.cn/common/jmap.md b/pages.cn/common/jmap.md new file mode 100644 index 0000000000..b6d819cc03 --- /dev/null +++ b/pages.cn/common/jmap.md @@ -0,0 +1,19 @@ +# jmap + +> Java Memory Map Tool. + +- Print shared object mappings for a java process (output like pmap): + +`jmap {{java_pid}}` + +- Print heap summary information: + +`jmap -heap {{filename.jar}} {{java_pid}}` + +- Print histogram of heap usage by type: + +`jmap -histo {{java_pid}}` + +- Dump contents of the heap into a binary file for analysis with jhat: + +`jmap -dump:format=b,file={{filename}} {{java_pid}}` diff --git a/pages.cn/common/jobs.md b/pages.cn/common/jobs.md new file mode 100644 index 0000000000..30c2c0fcdd --- /dev/null +++ b/pages.cn/common/jobs.md @@ -0,0 +1,19 @@ +# jobs + +> Display status of jobs in the current session. + +- Show status of all jobs: + +`jobs` + +- Show status of a particular job: + +`jobs {{job_id}}` + +- Show status and process IDs of all jobs: + +`jobs -l` + +- Show process IDs of all jobs: + +`jobs -p` diff --git a/pages.cn/common/join.md b/pages.cn/common/join.md new file mode 100644 index 0000000000..1af8b9e987 --- /dev/null +++ b/pages.cn/common/join.md @@ -0,0 +1,15 @@ +# join + +> Join lines of two sorted files on a common field. + +- Join two files on the first (default) field: + +`join {{file1}} {{file2}}` + +- Join field3 of file1 with field1 of file2: + +`join -1 3 -2 1 {{file1}} {{file2}}` + +- Produce a line for each unpairable line for file1: + +`join -a 1 {{file1}} {{file2}}` diff --git a/pages.cn/common/jpegoptim.md b/pages.cn/common/jpegoptim.md new file mode 100644 index 0000000000..724ece1411 --- /dev/null +++ b/pages.cn/common/jpegoptim.md @@ -0,0 +1,19 @@ +# jpegoptim + +> Optimise JPEG images. + +- Optimise a set of JPEG images, retaining all associated data: + +`jpegoptim {{image1.jpeg}} {{image2.jpeg}} {{imageN.jpeg}}` + +- Optimise JPEG images, stripping all non-essential data: + +`jpegoptim --strip-all {{image1.jpeg}} {{image2.jpeg}} {{imageN.jpeg}}` + +- Force the output images to be progressive: + +`jpegoptim --all-progressive {{image1.jpeg}} {{image2.jpeg}} {{imageN.jpeg}}` + +- Force the output images to have a fixed maximum filesize: + +`jpegoptim --size={{250k}} {{image1.jpeg}} {{image2.jpeg}} {{imageN.jpeg}}` diff --git a/pages.cn/common/jps.md b/pages.cn/common/jps.md new file mode 100644 index 0000000000..82a91c29c3 --- /dev/null +++ b/pages.cn/common/jps.md @@ -0,0 +1,23 @@ +# jps + +> Show JVM Process Status of current user. + +- List all JVM processes: + +`jps` + +- List all JVM processes with only PID: + +`jps -q` + +- Display the arguments passed to the processes: + +`jps -m` + +- Display the full package name of all processes: + +`jps -l` + +- Display the arguments passed to the JVM: + +`jps -v` diff --git a/pages.cn/common/jq.md b/pages.cn/common/jq.md new file mode 100644 index 0000000000..5b8116140f --- /dev/null +++ b/pages.cn/common/jq.md @@ -0,0 +1,27 @@ +# jq + +> A lightweight and flexible command-line JSON processor. + +- Output a JSON file, in pretty-print format: + +`jq . {{file.json}}` + +- Output all elements from arrays (or all key-value pairs from objects) in a JSON file: + +`jq .[] {{file.json}}` + +- Read JSON objects from a file into an array, and output it (inverse of `jq .[]`): + +`jq --slurp . {{file.json}}` + +- Output the first element in a JSON file: + +`jq .[0] {{file.json}}` + +- Output the value of a given key of the first element in a JSON text from stdin: + +`cat {{file.json}} | jq .[0].{{key_name}}` + +- Output the value of a given key of each element in a JSON text from stdin: + +`cat {{file.json}} | jq 'map(.{{key_name}})'` diff --git a/pages.cn/common/jrnl.md b/pages.cn/common/jrnl.md new file mode 100644 index 0000000000..6373120c45 --- /dev/null +++ b/pages.cn/common/jrnl.md @@ -0,0 +1,23 @@ +# jrnl + +> A simple journal application for your command line. + +- Insert a new entry with your editor: + +`jrnl` + +- Quickly insert a new entry: + +`jrnl {{today at 3am}}: {{title}}. {{content}}` + +- View the last ten entries: + +`jrnl -n {{10}}` + +- View everything that happened from the start of last year to the start of last march: + +`jrnl -from {{"last year"}} -until {{march}}` + +- Edit all entries tagged with "texas" and "history": + +`jrnl {{@texas}} -and {{@history}} --edit` diff --git a/pages.cn/common/json5.md b/pages.cn/common/json5.md new file mode 100644 index 0000000000..4fd6b273ca --- /dev/null +++ b/pages.cn/common/json5.md @@ -0,0 +1,27 @@ +# json5 + +> A command-line tool for converting JSON5 files to JSON. + +- Convert JSON5 stdin to JSON stdout: + +`echo {{input}} | json5` + +- Convert a JSON5 file to JSON and output to stdout: + +`json5 {{path/to/input_file.json5}}` + +- Convert a JSON5 file to the specified JSON file: + +`json5 {{path/to/input_file.json5}} --out-file {{path/to/output_file.json}}` + +- Validate a JSON5 file: + +`json5 {{path/to/input_file.json5}} --validate` + +- Specify the number of spaces to indent by (or "t" for tabs): + +`json5 --space {{indent_amount}}` + +- View available options: + +`json5 --help` diff --git a/pages.cn/common/jstack.md b/pages.cn/common/jstack.md new file mode 100644 index 0000000000..93687df2ff --- /dev/null +++ b/pages.cn/common/jstack.md @@ -0,0 +1,15 @@ +# jstack + +> Java Stack Trace Tool. + +- Print java stack traces for all threads in a java process: + +`jstack {{java_pid}}` + +- Print mixed mode (java/c++) stack traces for all threads in a java process: + +`jstack -m {{java_pid}}` + +- Print stack traces from java core dump: + +`jstack {{/usr/bin/java}} {{file.core}}` diff --git a/pages.cn/common/julia.md b/pages.cn/common/julia.md new file mode 100644 index 0000000000..29ccb678f3 --- /dev/null +++ b/pages.cn/common/julia.md @@ -0,0 +1,27 @@ +# julia + +> A high-level, high-performance dynamic programming language for technical computing. + +- Start a Julia REPL session: + +`julia` + +- Execute a Julia program and exit: + +`julia {{program.jl}}` + +- Execute a Julia program that takes arguments: + +`julia {{program.jl}} {{arguments}}` + +- Evaluate a string containing Julia code: + +`julia -e '{{julia_code}}'` + +- Evaluate a string of Julia code, passing arguments to it: + +`julia -e '{{for x in ARGS; println(x); end}}' {{arguments}}` + +- Start Julia in parallel mode, using N worker processes: + +`julia -p {{N}}` diff --git a/pages.cn/common/jupyter.md b/pages.cn/common/jupyter.md new file mode 100644 index 0000000000..3ee18191f0 --- /dev/null +++ b/pages.cn/common/jupyter.md @@ -0,0 +1,28 @@ +# jupyter + +> Web application to create and share documents that contain code, visualizations and notes. +> Primarily used for data analysis, scientific computing and machine learning. + +- Start a Jupyter notebook server in the current directory: + +`jupyter notebook` + +- Open a specific Jupyter notebook: + +`jupyter notebook {{example.ipynb}}` + +- Start a server on a specific port: + +`jupyter notebook --port={{port}}` + +- List currently running notebook servers: + +`jupyter notebook list` + +- Stop the currently running server: + +`jupyter notebook stop` + +- Start JupyterLab, if installed, in the current directory: + +`jupyter lab` diff --git a/pages.cn/common/k6.md b/pages.cn/common/k6.md new file mode 100644 index 0000000000..9ffcc6f6a0 --- /dev/null +++ b/pages.cn/common/k6.md @@ -0,0 +1,27 @@ +# k6 + +> A modern load testing tool, using Go and JavaScript. + +- Run load test locally: + +`k6 run {{script.js}}` + +- Run load test locally with a given number of virtual users and duration: + +`k6 run --vus {{10}} --duration {{30s}} {{script.js}}` + +- Run load test locally with a given environment variable: + +`k6 run -e {{HOSTNAME=example.com}} {{script.js}}` + +- Run load test locally using InfluxDB to store results: + +`k6 run --out influxdb={{http://localhost:8086/k6db}} {{script.js}}` + +- Login to cloud service using secret token: + +`k6 login cloud --token {{secret}}` + +- Run load test on cloud infrastructure: + +`k6 cloud {{script.js}}` diff --git a/pages.cn/common/kafkacat.md b/pages.cn/common/kafkacat.md new file mode 100644 index 0000000000..72af844264 --- /dev/null +++ b/pages.cn/common/kafkacat.md @@ -0,0 +1,35 @@ +# kafkacat + +> Apache Kafka producer and consumer tool. + +- Consume messages starting with the newest offset: + +`kafkacat -C -t {{topic}} -b {{brokers}}` + +- Consume messages starting with the oldest offset and exit after the last message is received: + +`kafkacat -C -t {{topic}} -b {{brokers}} -o beginning -e` + +- Consume messages as a Kafka consumer group: + +`kafkacat -G {{group_id}} {{topic}} -b {{brokers}}` + +- Publish message by reading from stdin: + +` echo {{message}} | kafkacat -P -t {{topic}} -b {{brokers}}` + +- Publish messages by reading from a file: + +`kafkacat -P -t {{topic}} -b {{brokers}} {{path/to/file}}` + +- List metadata for all topics and brokers: + +`kafkacat -L -b {{brokers}}` + +- List metadata for a specific topic: + +`kafkacat -L -t {{topic}} -b {{brokers}}` + +- Get offset for a topic/partition for a specific point in time: + +`kafkacat -Q -t {{topic}:{{partition}}:{{unix_timestamp}} -b {{brokers}}` diff --git a/pages.cn/common/kak.md b/pages.cn/common/kak.md new file mode 100644 index 0000000000..9da41b0d70 --- /dev/null +++ b/pages.cn/common/kak.md @@ -0,0 +1,36 @@ +# kak + +> Kakoune is a mode-based code editor implementing the "multiple selections" paradigm. +> Data can be selected and simultaneously edited in different locations, using multiple selections; users can also connect to the same session for collaborative editing. + +- Open a file and enter normal mode, to execute commands: + +`kak {{path/to/file}}` + +- Enter insert mode from normal mode, to write text into the file: + +`i` + +- Escape insert mode, to go back to normal mode: + +`` + +- Replace all instances of "foo" in the current file with "bar": + +`%s{{foo}}c{{bar}}` + +- Un-select all secondary selections, and keep only the main one: + +`` + +- Search for numbers and select the first two: + +`/\d+N` + +- Insert the contents of a file: + +`!cat {{path/to/file}}` + +- Save the current file: + +`:w` diff --git a/pages.cn/common/keepass2.md b/pages.cn/common/keepass2.md new file mode 100644 index 0000000000..ec81c2d12d --- /dev/null +++ b/pages.cn/common/keepass2.md @@ -0,0 +1,15 @@ +# keepass2 + +> A light-weight password manager. + +- Start KeePass 2, opening the most recently-opened password database: + +`keepass2` + +- Start KeePass 2, opening a specific password database: + +`keepass2 {{path/to/database.kbdx}}` + +- Use a specific key file to open a password database: + +`keepass2 {{path/to/database.kbdx}} -keyfile:{{path/to/key/file.key}}` diff --git a/pages.cn/common/keybase.md b/pages.cn/common/keybase.md new file mode 100644 index 0000000000..b848421a30 --- /dev/null +++ b/pages.cn/common/keybase.md @@ -0,0 +1,31 @@ +# keybase + +> Key directory that maps social media identities to encryption keys in a publicly auditable manner. + +- Follow another user: + +`keybase follow {{username}}` + +- Add a new proof: + +`keybase prove {{service}} {{service_username}}` + +- Sign a file: + +`keybase sign --infile {{input_file}} --outfile {{output_file}}` + +- Verify a signed file: + +`keybase verify --infile {{input_file}} --outfile {{output_file}}` + +- Encrypt a file: + +`keybase encrypt --infile {{input_file}} --outfile {{output_file}} {{receiver}}` + +- Decrypt a file: + +`keybase decrypt --infile {{input_file}} --outfile {{output_file}}` + +- Revoke current device, log out, and delete local data: + +`keybase deprovision` diff --git a/pages.cn/common/kill.md b/pages.cn/common/kill.md new file mode 100644 index 0000000000..bd729e8c24 --- /dev/null +++ b/pages.cn/common/kill.md @@ -0,0 +1,28 @@ +# kill + +> Sends a signal to a process, usually related to stopping the process. +> All signals except for SIGKILL and SIGSTOP can be intercepted by the process to perform a clean exit. + +- Terminate a program using the default SIGTERM (terminate) signal: + +`kill {{process_id}}` + +- List available signal names (to be used without the `SIG` prefix): + +`kill -l` + +- Terminate a program using the SIGHUP (hang up) signal. Many daemons will reload instead of terminating: + +`kill -{{1|HUP}} {{process_id}}` + +- Terminate a program using the SIGINT (interrupt) signal. This is typically initiated by the user pressing `Ctrl + C`: + +`kill -{{2|INT}} {{process_id}}` + +- Signal the operating system to immediately terminate a program (which gets no chance to capture the signal): + +`kill -{{9|KILL}} {{process_id}}` + +- Signal the operating system to pause a program, it until a SIGCONT ("continue") signal is received: + +`kill -{{17|STOP}} {{process_id}}` diff --git a/pages.cn/common/killall.md b/pages.cn/common/killall.md new file mode 100644 index 0000000000..359efab900 --- /dev/null +++ b/pages.cn/common/killall.md @@ -0,0 +1,24 @@ +# killall + +> Send kill signal to all instances of a process by name (must be exact name). +> All signals except SIGKILL and SIGSTOP can be intercepted by the process, allowing a clean exit. + +- Terminate a process using the default SIGTERM (terminate) signal: + +`killall {{process_name}}` + +- List available signal names (to be used without the 'SIG' prefix): + +`killall --list` + +- Interactively ask for confirmation before termination: + +`killall -i {{process_name}}` + +- Terminate a process using the SIGINT (interrupt) signal, which is the same signal sent by pressing `Ctrl + C`: + +`killall -INT {{process_name}}` + +- Force kill a process: + +`killall -KILL {{process_name}}` diff --git a/pages.cn/common/knife.md b/pages.cn/common/knife.md new file mode 100644 index 0000000000..71c743b855 --- /dev/null +++ b/pages.cn/common/knife.md @@ -0,0 +1,31 @@ +# knife + +> CLI for interacting with a Chef server from a local Chef repo. + +- Bootstrap a new node: + +`knife bootstrap {{fqdn_or_ip}}` + +- List all registered nodes: + +`knife node list` + +- Show a node: + +`knife node show {{node_name}}` + +- Edit a node: + +`knife node edit {{node_name}}` + +- Edit a role: + +`knife role edit {{role_name}}` + +- View a data bag: + +`knife data bag show {{data_bag_name}} {{data_bag_item}}` + +- Upload a local cookbook to the Chef server: + +`knife cookbook upload {{cookbook_name}}` diff --git a/pages.cn/common/kompose.md b/pages.cn/common/kompose.md new file mode 100644 index 0000000000..b6769547b8 --- /dev/null +++ b/pages.cn/common/kompose.md @@ -0,0 +1,15 @@ +# kompose + +> A tool to convert docker-compose applications to Kubernetes. + +- Deploy a dockerized application to Kubernetes: + +`kompose up -f {{docker-compose.yml}}` + +- Delete instantiated services/deployments from Kubernetes: + +`kompose down -f {{docker-compose.yml}}` + +- Convert a docker-compose file into Kubernetes resources file: + +`kompose convert -f {{docker-compose.yml}}` diff --git a/pages.cn/common/kube-fzf.md b/pages.cn/common/kube-fzf.md new file mode 100644 index 0000000000..9c07e821ef --- /dev/null +++ b/pages.cn/common/kube-fzf.md @@ -0,0 +1,28 @@ +# kube-fzf + +> Shell commands for command line fuzzy searching of Kubernetes Pods. +> See also `kubectl` for related commands. + +- Get pod details (from current namespace): + +`findpod` + +- Get pod details (from all namespaces): + +`findpod -a` + +- Describe a pod: + +`describepod` + +- Tail pod logs: + +`tailpod` + +- Exec into a pod's container: + +`execpod {{shell_command}}` + +- Port-forward a pod: + +`pfpod {{port_number}}` diff --git a/pages.cn/common/kubeadm.md b/pages.cn/common/kubeadm.md new file mode 100644 index 0000000000..3c8a11829c --- /dev/null +++ b/pages.cn/common/kubeadm.md @@ -0,0 +1,31 @@ +# kubeadm + +> Command line interface for creating and managing Kubernetes clusters. + +- Create a Kubernetes master node: + +`kubeadm init` + +- Bootstrap a Kubernetes worker node and join it to a cluster: + +`kubeadm join --token {{token}}` + +- Create a new bootstrap token with a TTL of 12 hours: + +`kubeadm token create --ttl {{12h0m0s}}` + +- Check if the Kubernetes cluster is upgradeable and which versions are available: + +`kubeadm upgrade plan` + +- Upgrade Kubernetes cluster to a specified version: + +`kubeadm upgrade apply {{version}}` + +- View the kubeadm ConfigMap containing the cluster's configuration: + +`kubeadm config view` + +- Revert changes made to the host by 'kubeadm init' or 'kubeadm join': + +`kubeadm reset` diff --git a/pages.cn/common/kubectl.md b/pages.cn/common/kubectl.md new file mode 100644 index 0000000000..3599fee471 --- /dev/null +++ b/pages.cn/common/kubectl.md @@ -0,0 +1,31 @@ +# kubectl + +> Command line interface for running commands against Kubernetes clusters. + +- List all pods in all namespaces: + +`kubectl get pods --all-namespaces` + +- List all pods with more information (such as node name): + +`kubectl get pods -o wide` + +- Update specified pod with the label 'unhealthy' and the value 'true': + +`kubectl label pods {{name}} unhealthy=true` + +- List all resources with different types: + +`kubectl get all` + +- Show metrics for all nodes: + +`kubectl top node` + +- Show metrics for all pods in the default namespace: + +`kubectl top pod` + +- Print the address of the master and cluster services: + +`kubectl cluster-info` diff --git a/pages.cn/common/kubectx.md b/pages.cn/common/kubectx.md new file mode 100644 index 0000000000..5aeab36397 --- /dev/null +++ b/pages.cn/common/kubectx.md @@ -0,0 +1,19 @@ +# kubectx + +> Utility to manage and switch between `kubectl` contexts. + +- List the contexts: + +`kubectx` + +- Switch to a named context: + +`kubectx {{name}}` + +- Switch to the previous context: + +`kubectx -` + +- Delete a named context: + +`kubectx -d {{name}}` diff --git a/pages.cn/common/kubens.md b/pages.cn/common/kubens.md new file mode 100644 index 0000000000..57c641c589 --- /dev/null +++ b/pages.cn/common/kubens.md @@ -0,0 +1,15 @@ +# kubens + +> Utility to switch between Kubernetes namespaces. + +- List the namespaces: + +`kubens` + +- Change the active namespace: + +`kubens {{name}}` + +- Switch to the previous namespace: + +`kubens -` diff --git a/pages.cn/common/kubetail.md b/pages.cn/common/kubetail.md new file mode 100644 index 0000000000..7d026922ee --- /dev/null +++ b/pages.cn/common/kubetail.md @@ -0,0 +1,19 @@ +# kubetail + +> Utility to tail multiple Kubernetes pod logs at the same time. + +- Tail the logs of multiple pods (whose name starts with "my_app") in one go: + +`kubetail {{my_app}}` + +- Tail only a specific container from multiple pods: + +`kubetail {{my_app}} -c {{my_container}}` + +- To tail multiple containers from multiple pods: + +`kubetail {{my_app}} -c {{my_container_1}} -c {{my_container_2}}` + +- To tail multiple applications at the same time seperate them by comma: + +`kubetail {{my_app_1}},{{my_app_2}}` diff --git a/pages.cn/common/laravel.md b/pages.cn/common/laravel.md new file mode 100644 index 0000000000..c944d90db6 --- /dev/null +++ b/pages.cn/common/laravel.md @@ -0,0 +1,19 @@ +# laravel + +> A command line installer for the Laravel framework. + +- Create a new Laravel application: + +`laravel new {{name}}` + +- Use the latest development release: + +`laravel new {{name}} --dev` + +- Overwrite if the directory already exists: + +`laravel new {{name}} --force` + +- List the available installer commands: + +`laravel list` diff --git a/pages.cn/common/last.md b/pages.cn/common/last.md new file mode 100644 index 0000000000..b03e1054ca --- /dev/null +++ b/pages.cn/common/last.md @@ -0,0 +1,27 @@ +# last + +> View the last logged in users. + +- View last logins, their duration and other information as read from /var/log/wtmp: + +`last` + +- Specify how many of the last logins to show: + +`last -n {{login_count}}` + +- Print the full date and time for entries and then display the hostname column last to prevent truncation: + +`last -F -a` + +- View all logins by a specific user and show the ip address instead of the hostname: + +`last {{user_name}} -i` + +- View all recorded reboots (i.e., the last logins of the pseudo user "reboot"): + +`last reboot` + +- View all recorded shutdowns (i.e., the last logins of the pseudo user "shutdown"): + +`last shutdown` diff --git a/pages.cn/common/latexmk.md b/pages.cn/common/latexmk.md new file mode 100644 index 0000000000..fe235f4aa5 --- /dev/null +++ b/pages.cn/common/latexmk.md @@ -0,0 +1,28 @@ +# latexmk + +> Compile LaTeX source files into finished documents. +> Automatically does multiple runs when needed. + +- Compile a dvi (DeVice Independent file) document from every source: + +`latexmk` + +- Compile a dvi document from a specific source file: + +`latexmk {{source.tex}}` + +- Compile a pdf document: + +`latexmk -pdf {{source.tex}}` + +- Force the generation of a document even if there are errors: + +`latexmk -f {{source.tex}}` + +- Clean up temporary tex files created for a specific tex file: + +`latexmk -c {{source.tex}}` + +- Clean up all temporary tex files in the current directory: + +`latexmk -c` diff --git a/pages.cn/common/leave.md b/pages.cn/common/leave.md new file mode 100644 index 0000000000..101db80ca7 --- /dev/null +++ b/pages.cn/common/leave.md @@ -0,0 +1,20 @@ +# leave + +> Remind when it's time to leave. +> To remove reminders use `kill $(pidof leave)`. + +- Set a reminder at a given time: + +`leave {{time_to_leave}}` + +- Remind to leave at noon: + +`leave {{1200}}` + +- Set a reminder in a specific amount of time: + +`leave +{{amount_of_time}}` + +- Remind to leave in 4 hours and 4 minutes: + +`leave +{{0404}}` diff --git a/pages.cn/common/lebab.md b/pages.cn/common/lebab.md new file mode 100644 index 0000000000..63d859b46a --- /dev/null +++ b/pages.cn/common/lebab.md @@ -0,0 +1,24 @@ +# lebab + +> A JavaScript modernizer for transpiling code to ES6/ES7. +> Transformations must be provided for all examples. + +- Display a list of the available transformations: + +`lebab --help` + +- Transpile using one or more comma-separated transformations: + +`lebab --transform {{transformation}}` + +- Transpile a file to stdout: + +`lebab {{path/to/input_file}}` + +- Transpile a file to the specified output file: + +`lebab {{path/to/input_file}} --out-file {{path/to/output_file}}` + +- Replace all `.js` files in-place in the specified directory, glob or file: + +`lebab --replace {{directory|glob|file}}` diff --git a/pages.cn/common/lein.md b/pages.cn/common/lein.md new file mode 100644 index 0000000000..a20818d981 --- /dev/null +++ b/pages.cn/common/lein.md @@ -0,0 +1,23 @@ +# lein + +> Manage clojure projects with declarative configuration. + +- Generate scaffolding for a new project based on a template: + +`lein new {{template_name}} {{project_name}}` + +- Start a REPL session either with the project or standalone: + +`lein repl` + +- Run the project's "-main" function with optional args: + +`lein run {{args}}` + +- Run the project's tests: + +`lein test` + +- Package up the project files and all its dependencies into a jar file: + +`lein uberjar` diff --git a/pages.cn/common/less.md b/pages.cn/common/less.md new file mode 100644 index 0000000000..ea36019257 --- /dev/null +++ b/pages.cn/common/less.md @@ -0,0 +1,35 @@ +# less + +> Open a file for interactive reading, allowing scrolling and search. + +- Open a file: + +`less {{source_file}}` + +- Page down / up: + +` (down), b (up)` + +- Go to end / start of file: + +`G (end), g (start)` + +- Forward search for a string (press `n`/`N` to go to next/previous match): + +`/{{something}}` + +- Backward search for a string (press `n`/`N` to go to next/previous match): + +`?{{something}}` + +- Follow the output of the currently opened file: + +`F` + +- Open the current file in an editor: + +`v` + +- Exit: + +`q` diff --git a/pages.cn/common/lex.md b/pages.cn/common/lex.md new file mode 100644 index 0000000000..7b5d95c848 --- /dev/null +++ b/pages.cn/common/lex.md @@ -0,0 +1,16 @@ +# lex + +> Lexical analyser generator. +> Given the specification for a lexical analyser, generates C code implementing it. + +- Generate an analyser from a Lex file: + +`lex {{analyser.l}}` + +- Specify the output file: + +`lex {{analyser.l}} --outfile {{analyser.c}}` + +- Compile a C file generated by Lex: + +`cc {{path/to/lex.yy.c}} --output {{executable}}` diff --git a/pages.cn/common/license.md b/pages.cn/common/license.md new file mode 100644 index 0000000000..e947f96e9d --- /dev/null +++ b/pages.cn/common/license.md @@ -0,0 +1,19 @@ +# license + +> Create license files for open-source projects. + +- Print a license to stdout, using the defaults (auto-detected author name, and current year): + +`license {{license_name}}` + +- Generate a license and save it to a file: + +`license -o {{filename}} {{license_name}}` + +- List all available licenses: + +`license ls` + +- Generate a license with custom author name and year: + +`license --name {{author}} --year {{release_year}} {{license_name}}` diff --git a/pages.cn/common/light-arionum-cli.md b/pages.cn/common/light-arionum-cli.md new file mode 100644 index 0000000000..cbf7086ac0 --- /dev/null +++ b/pages.cn/common/light-arionum-cli.md @@ -0,0 +1,35 @@ +# light-arionum-cli + +> The PHP light wallet for the Arionum cryptocurrency. + +- Generate a new public/private key pair: + +`light-arionum-cli` + +- Display the balance of the current address: + +`light-arionum-cli balance` + +- Display the balance of the specified address: + +`light-arionum-cli balance {{address}}` + +- Send a transaction with an optional message: + +`light-arionum-cli send {{address}} {{value}} {{optional_message}}` + +- Export the current wallet information: + +`light-arionum-cli export` + +- Display information about the current block: + +`light-arionum-cli block` + +- Display information about the current address' transactions: + +`light-arionum-cli transactions` + +- Display information about a specific transaction: + +`light-arionum-cli transaction {{transaction_id}}` diff --git a/pages.cn/common/link.md b/pages.cn/common/link.md new file mode 100644 index 0000000000..f57667a6a3 --- /dev/null +++ b/pages.cn/common/link.md @@ -0,0 +1,8 @@ +# link + +> Create a hard link to an existing file. +> For more options, see the `ln` command. + +- Create a hard link from a new file to an existing file: + +`link {{path/to/existing_file}} {{path/to/new_file}}` diff --git a/pages.cn/common/live-server.md b/pages.cn/common/live-server.md new file mode 100644 index 0000000000..18a35a4d9d --- /dev/null +++ b/pages.cn/common/live-server.md @@ -0,0 +1,19 @@ +# live-server + +> A simple development http server with live reload capability. + +- Serve an index.html file and reload on changes: + +`live-server` + +- Specify a port (default is 8080) from which to serve a file: + +`live-server --port={{8081}}` + +- Specify a given file to serve: + +`live-server --open={{about.html}}` + +- Proxy all requests for ROUTE to URL: + +`live-server --proxy={{/}}:{{http:localhost:3000}}` diff --git a/pages.cn/common/ln.md b/pages.cn/common/ln.md new file mode 100644 index 0000000000..ade29879ae --- /dev/null +++ b/pages.cn/common/ln.md @@ -0,0 +1,15 @@ +# ln + +> Creates links to files and folders. + +- Create a symbolic link to a file (or folder): + +`ln -s {{path/to/file}} {{path/to/symlink}}` + +- Overwrite an existing symbolic to point to a different file: + +`ln -sf {{path/to/new_file}} {{path/to/symlink}}` + +- Create a hard link to a file: + +`ln {{path/to/file}} {{path/to/hardlink}}` diff --git a/pages.cn/common/loc.md b/pages.cn/common/loc.md new file mode 100644 index 0000000000..e3f1bccd83 --- /dev/null +++ b/pages.cn/common/loc.md @@ -0,0 +1,19 @@ +# loc + +> Tool written in Rust that counts lines of code. + +- Print lines of code in the current directory: + +`loc` + +- Print lines of code in the target directory: + +`loc {{path/to/directory}}` + +- Print lines of code with stats for individual files: + +`loc --files` + +- Print lines of code without .gitignore (etc.) files (e.g. two -u flags will additionally count hidden files and dirs): + +`loc -u` diff --git a/pages.cn/common/locust.md b/pages.cn/common/locust.md new file mode 100644 index 0000000000..508cd9dbe5 --- /dev/null +++ b/pages.cn/common/locust.md @@ -0,0 +1,27 @@ +# locust + +> Load-testing tool to determine number of concurrent users a system can handle. + +- Load-test "example.com" with web interface using locustfile.py: + +`locust --host={{http://example.com}}` + +- Use a different test file: + +`locust --locustfile={{test_file.py}} --host={{http://example.com}}` + +- Run test without web interface, spawning 1 user a second until there are 100 users: + +`locust --no-web --clients={{100}} --hatch-rate={{1}} --host={{http://example.com}}` + +- Start locust in master mode: + +`locust --master --host={{http://example.com}}` + +- Connect locust slave to master: + +`locust --slave --host={{http://example.com}}` + +- Connect locust slave to master on a different machine: + +`locust --slave --master-host={{master_hostname}} --host={{http://example.com}}` diff --git a/pages.cn/common/logname.md b/pages.cn/common/logname.md new file mode 100644 index 0000000000..ee90d6b894 --- /dev/null +++ b/pages.cn/common/logname.md @@ -0,0 +1,7 @@ +# logname + +> Shows the user's login name. + +- Display the currently logged in user's name: + +`logname` diff --git a/pages.cn/common/logstash.md b/pages.cn/common/logstash.md new file mode 100644 index 0000000000..d285a93e04 --- /dev/null +++ b/pages.cn/common/logstash.md @@ -0,0 +1,16 @@ +# logstash + +> An ETL (extract, transform and load) tool. +> Commonly used to load data from various sources, like databases and log files, into elasticsearch. + +- Check validity of a logstash configuration: + +`logstash --configtest --config {{logstash_config.conf}}` + +- Run logstash using configuration: + +`sudo logstash --config {{logstash_config.conf}}` + +- Run logstash with the most basic inline configuration string: + +`sudo logstash -e 'input {} filter {} output {}'` diff --git a/pages.cn/common/lolcat.md b/pages.cn/common/lolcat.md new file mode 100644 index 0000000000..35980d4f8f --- /dev/null +++ b/pages.cn/common/lolcat.md @@ -0,0 +1,19 @@ +# lolcat + +> Put a rainbow in everything you `cat` to the console. + +- Print a file to the console in rainbow colors: + +`lolcat {{path/to/file}}` + +- Print the result of a text-producing command in rainbow colors: + +`{{fortune}} | lolcat` + +- Print a file to the console with animated rainbow colors: + +`lolcat -a {{path/to/file}}` + +- Print a file to the console with 24-bit (truecolor) rainbow colors: + +`lolcat -t {{path/to/file}}` diff --git a/pages.cn/common/lorem.md b/pages.cn/common/lorem.md new file mode 100644 index 0000000000..1e9527e342 --- /dev/null +++ b/pages.cn/common/lorem.md @@ -0,0 +1,19 @@ +# lorem + +> Create more or less random lorem ipsum text. + +- Print the specified number of words: + +`lorem -n {{20}}` + +- Print 10 lines of Goethe's Faust: + +`lorem -l {{10}} --faust` + +- Print 5 sentences of Poe's Raven: + +`lorem -s {{5}} --raven` + +- Print 40 random characters from Boccacio's Decameron: + +`lorem --randomize -c {{40}} --decamerone` diff --git a/pages.cn/common/lp.md b/pages.cn/common/lp.md new file mode 100644 index 0000000000..8413f9e893 --- /dev/null +++ b/pages.cn/common/lp.md @@ -0,0 +1,23 @@ +# lp + +> Print files. + +- Print the output of a command to the default printer (see `lpstat` command): + +`echo "test" | lp` + +- Print a file to the default printer: + +`lp {{path/to/filename}}` + +- Print a file to a named printer (see `lpstat` command): + +`lp -d {{printer_name}} {{path/to/filename}}` + +- Print N copies of file to default printer (replace N with desired number of copies): + +`lp -n {{N}} {{path/to/filename}}` + +- Print only certain pages to the default printer (print pages 1, 3-5, and 16): + +`lp -P 1,3-5,16 {{path/to/filename}}` diff --git a/pages.cn/common/lpass.md b/pages.cn/common/lpass.md new file mode 100644 index 0000000000..9d4ec9728e --- /dev/null +++ b/pages.cn/common/lpass.md @@ -0,0 +1,23 @@ +# lpass + +> Command line interface for the LastPass password manager. + +- Login to your LastPass account, by entering your master password when prompted: + +`lpass login {{username}}` + +- Show login status: + +`lpass status` + +- List all sites grouped by category: + +`lpass ls` + +- Generate a new password for "gmail.com" with identifier "myinbox" and add to LastPass: + +`lpass generate --username {{username}} --url {{gmail.com}} {{myinbox}} {{password_length}}` + +- Show password for a specified entry: + +`lpass show {{myinbox}} --password` diff --git a/pages.cn/common/lpstat.md b/pages.cn/common/lpstat.md new file mode 100644 index 0000000000..d0983b625f --- /dev/null +++ b/pages.cn/common/lpstat.md @@ -0,0 +1,19 @@ +# lpstat + +> Show status information about printers. + +- List printers present on the machine and whether they are enabled for printing: + +`lpstat -p` + +- Show the default printer: + +`lpstat -d` + +- Display all available status information: + +`lpstat -t` + +- Show a list of print jobs queued by the specified user: + +`lpstat -u {{user}}` diff --git a/pages.cn/common/ls.md b/pages.cn/common/ls.md new file mode 100644 index 0000000000..9d3725c046 --- /dev/null +++ b/pages.cn/common/ls.md @@ -0,0 +1,27 @@ +# ls + +> List directory contents. + +- List files one per line: + +`ls -1` + +- List all files, including hidden files: + +`ls -a` + +- Long format list (permissions, ownership, size and modification date) of all files: + +`ls -la` + +- Long format list with size displayed using human readable units (KB, MB, GB): + +`ls -lh` + +- Long format list sorted by size (descending): + +`ls -lS` + +- Long format list of all files, sorted by modification date (oldest first): + +`ls -ltr` diff --git a/pages.cn/common/lsof.md b/pages.cn/common/lsof.md new file mode 100644 index 0000000000..221bcbfa45 --- /dev/null +++ b/pages.cn/common/lsof.md @@ -0,0 +1,32 @@ +# lsof + +> Lists open files and the corresponding processes. +> Note: Root privileges (or sudo) is required to list files opened by others. + +- Find the processes that have a given file open: + +`lsof {{path/to/file}}` + +- Find the process that opened a local internet port: + +`lsof -i :{{port}}` + +- Only output the process ID (PID): + +`lsof -t {{path/to/file}}` + +- List files opened by the given user: + +`lsof -u {{username}}` + +- List files opened by the given command or process: + +`lsof -c {{process_or_command_name}}` + +- List files opened by a specific process, given its PID: + +`lsof -p {{PID}}` + +- List open files in a directory: + +`lsof +D {{path/to/directory}}` diff --git a/pages.cn/common/lua.md b/pages.cn/common/lua.md new file mode 100644 index 0000000000..981f3536d9 --- /dev/null +++ b/pages.cn/common/lua.md @@ -0,0 +1,15 @@ +# lua + +> A powerful, light-weight embeddable programming language. + +- Start an interactive Lua shell: + +`lua` + +- Execute a Lua script: + +`lua {{script_name.lua}} {{--optional-argument}}` + +- Execute a Lua expression: + +`lua -e '{{print( "Hello World" )}}` diff --git a/pages.cn/common/luac.md b/pages.cn/common/luac.md new file mode 100644 index 0000000000..88b5b389cf --- /dev/null +++ b/pages.cn/common/luac.md @@ -0,0 +1,11 @@ +# luac + +> Lua bytecode compiler. + +- Compile a Lua source file to Lua bytecode: + +`luac -o {{byte_code.luac}} {{source.lua}}` + +- Do not include debug symbols in the output: + +`luac -s -o {{byte_code.luac}} {{source.lua}}` diff --git a/pages.cn/common/lumen.md b/pages.cn/common/lumen.md new file mode 100644 index 0000000000..2c70d85640 --- /dev/null +++ b/pages.cn/common/lumen.md @@ -0,0 +1,11 @@ +# lumen + +> A command line installer for the Lumen micro-framework. + +- Create a new Lumen application: + +`lumen new {{application_name}}` + +- List the available installer commands: + +`lumen list` diff --git a/pages.cn/common/lwp-request.md b/pages.cn/common/lwp-request.md new file mode 100644 index 0000000000..5d80b06aea --- /dev/null +++ b/pages.cn/common/lwp-request.md @@ -0,0 +1,28 @@ +# lwp-request + +> Simple command-line HTTP client. +> Built with libwww-perl. + +- Make a simple GET request: + +`lwp-request -m GET {{http://example.com/some/path}}` + +- Upload a file with a POST request: + +`cat {{/path/to/file}} | lwp-request -m POST {{http://example.com/some/path}}` + +- Make a request with a custom user agent: + +`lwp-request -H 'User-Agent: {{user_agent}} -m {{METHOD}} {{http://example.com/some/path}}` + +- Make a request with HTTP authentication: + +`lwp-request -C {{username}}:{{password}} -m {{METHOD}} {{http://example.com/some/path}}` + +- Make a request and print request headers: + +`lwp-request -U -m {{METHOD}} {{http://example.com/some/path}}` + +- Make a request and print response headers and status chain: + +`lwp-request -E -m {{METHOD}} {{http://example.com/some/path}}` diff --git a/pages.cn/common/lz4.md b/pages.cn/common/lz4.md new file mode 100644 index 0000000000..33b42e2507 --- /dev/null +++ b/pages.cn/common/lz4.md @@ -0,0 +1,27 @@ +# lz4 + +> Compress or decompress .lz4 files. + +- Compress a file: + +`lz4 {{file}}` + +- Decompress a file: + +`lz4 -d {{file.lz4}}` + +- Decompress a file and write to stdout: + +`lz4 -dc {{file.lz4}}` + +- Package and compress a directory and its contents: + +`tar cvf - {{path/to/dir}} | lz4 - {{dir.tar.lz4}}` + +- Decompress and unpack a directory and its contents: + +`lz4 -d {{dir.tar.lz4}} | tar -xv` + +- Compress a file using the best compression: + +`lz4 -9 {{file}}` diff --git a/pages.cn/common/m4.md b/pages.cn/common/m4.md new file mode 100644 index 0000000000..c1f794949c --- /dev/null +++ b/pages.cn/common/m4.md @@ -0,0 +1,11 @@ +# m4 + +> Macro processor. + +- Process macros in a file: + +`m4 {{path/to/file}}` + +- Define a macro before processing files: + +`m4 -D{{macro_name}}={{macro_value}} {{path/to/file}}` diff --git a/pages.cn/common/magento.md b/pages.cn/common/magento.md new file mode 100644 index 0000000000..b6efafd53c --- /dev/null +++ b/pages.cn/common/magento.md @@ -0,0 +1,35 @@ +# magento + +> A CLI for managing the Magento PHP framework. + +- Enable one or more space-separated modules: + +`magento module:enable {{module(s)}}` + +- Disable one or more space-separated modules: + +`magento module:disable {{module(s)}}` + +- Update the database after enabling modules: + +`magento setup:upgrade` + +- Update code and dependency injection configuration: + +`magento setup:di:compile` + +- Deploy static assets: + +`magento setup:static-content:deploy` + +- Enable maintenance mode: + +`magento maintenance:enable` + +- Disable maintenance mode: + +`magento maintenance:disable` + +- List all available commands: + +`magento list` diff --git a/pages.cn/common/mailx.md b/pages.cn/common/mailx.md new file mode 100644 index 0000000000..fe9b4b07c0 --- /dev/null +++ b/pages.cn/common/mailx.md @@ -0,0 +1,27 @@ +# mailx + +> Send and receive mail. + +- Send mail (the content should be typed after the command, and ended with `Ctrl+D`): + +`mailx -s "{{subject}}" {{to_addr}}` + +- Send mail with content passed from another command: + +`echo "{{content}}" | mailx -s "{{subject}}" {{to_addr}}` + +- Send mail with content read from a file: + +`mailx -s "{{subject}}" {{to_addr}} < {{content.txt}}` + +- Send mail to a recipient and CC to another address: + +`mailx -s "{{subject}}" -c {{cc_addr}} {{to_addr}}` + +- Send mail specifying the sender address: + +`mailx -s "{{subject}}" -r {{from_addr}} {{to_addr}}` + +- Send mail with an attachment: + +`mailx -a {{file}} -s "{{subject}}" {{to_addr}}` diff --git a/pages.cn/common/make.md b/pages.cn/common/make.md new file mode 100644 index 0000000000..ea7b7a009c --- /dev/null +++ b/pages.cn/common/make.md @@ -0,0 +1,28 @@ +# make + +> Task runner for targets described in Makefile. +> Mostly used to control the compilation of an executable from source code. + +- Call the first target specified in the Makefile (usually named "all"): + +`make` + +- Call a specific target: + +`make {{target}}` + +- Call a specific target, executing 4 jobs at a time in parallel: + +`make -j{{4}} {{target}}` + +- Use a specific Makefile: + +`make --file {{file}}` + +- Execute make from another directory: + +`make --directory {{directory}}` + +- Force making of a target, even if source files are unchanged: + +`make --always-make {{target}}` diff --git a/pages.cn/common/makensis.md b/pages.cn/common/makensis.md new file mode 100644 index 0000000000..a97b6be0b9 --- /dev/null +++ b/pages.cn/common/makensis.md @@ -0,0 +1,16 @@ +# makensis + +> Cross-platform compiler for NSIS installers. +> It compiles a NSIS script into a Windows installer executable. + +- Compile a NSIS script: + +`makensis {{path/to/file.nsi}}` + +- Compile a NSIS script in strict mode (treat warnings as errors): + +`makensis -WX {{path/to/file.nsi}}` + +- Print help for a specific command: + +`makensis -CMDHELP {{command}}` diff --git a/pages.cn/common/man.md b/pages.cn/common/man.md new file mode 100644 index 0000000000..55f9bc8e42 --- /dev/null +++ b/pages.cn/common/man.md @@ -0,0 +1,23 @@ +# man + +> Format and display manual pages. + +- Display man page for a command: + +`man {{command}}` + +- Display man page for a command from section 7: + +`man {{command}}.{{7}}` + +- Display path searched for manpages: + +`man --path` + +- Display location of a manpage rather than the manpage itself: + +`man -w {{command}}` + +- Do a keyword search for manpages containing a search string: + +`man -k {{keyword}}` diff --git a/pages.cn/common/mc.md b/pages.cn/common/mc.md new file mode 100644 index 0000000000..db93ea130d --- /dev/null +++ b/pages.cn/common/mc.md @@ -0,0 +1,8 @@ +# mc + +> Midnight Commander, a terminal based file manager. +> Navigate the folder structure using the arrow keys, the mouse or by typing the commands into the terminal. + +- Start mc: + +`mc` diff --git a/pages.cn/common/md5sum.md b/pages.cn/common/md5sum.md new file mode 100644 index 0000000000..4dcd6fbc46 --- /dev/null +++ b/pages.cn/common/md5sum.md @@ -0,0 +1,15 @@ +# md5sum + +> Calculate MD5 cryptographic checksums. + +- Calculate the MD5 checksum for a file: + +`md5sum {{filename1}}` + +- Calculate MD5 checksums for multiple files: + +`md5sum {{filename1}} {{filename2}}` + +- Read a file of MD5SUMs and verify all files have matching checksums: + +`md5sum -c {{filename.md5}}` diff --git a/pages.cn/common/mdp.md b/pages.cn/common/mdp.md new file mode 100644 index 0000000000..da54069387 --- /dev/null +++ b/pages.cn/common/mdp.md @@ -0,0 +1,19 @@ +# mdp + +> A command-line based tool to make presentations from markdown files. + +- Launch a presentation in the terminal from a markdown file: + +`mdp {{presentation.md}}` + +- Disable fading transitions: + +`mdp --nofade {{presentation.md}}` + +- Invert font colors to use in terminals with light background: + +`mdp --invert {{presentation.md}}` + +- Disable transparency in transparent terminals: + +`mdp --notrans {{presentation.md}}` diff --git a/pages.cn/common/mediainfo.md b/pages.cn/common/mediainfo.md new file mode 100644 index 0000000000..ad16d55774 --- /dev/null +++ b/pages.cn/common/mediainfo.md @@ -0,0 +1,15 @@ +# mediainfo + +> Display metadata from video and audio files. + +- Display metadata for a given file in the console: + +`mediainfo {{file}}` + +- Store the output to a given file along with displaying in the console: + +`mediainfo --Logfile={{out.txt}} {{file}}` + +- Display the list of metadata attributes that can be extracted: + +`mediainfo --Info-Parameters` diff --git a/pages.cn/common/meshlabserver.md b/pages.cn/common/meshlabserver.md new file mode 100644 index 0000000000..4307b22534 --- /dev/null +++ b/pages.cn/common/meshlabserver.md @@ -0,0 +1,23 @@ +# meshlabserver + +> Command line interface for the MeshLab 3D mesh processing software. + +- Convert an STL file to an OBJ file: + +`meshlabserver -i {{input.stl}} -o {{output.obj}}` + +- Convert a WRL file to a OFF file, including the vertex and face normals in the output mesh: + +`meshlabserver -i {{input.wrl}} -o {{output.off}} -om vn fn` + +- Dump a list of all the available processing filters into a file: + +`meshlabserver -d {{filename}}` + +- Process a 3D file using a filter script created in the MeshLab GUI (Filters > Show current filter script > Save Script): + +`meshlabserver -i {{input.ply}} -o {{output.ply}} -s {{filter_script.mlx}}` + +- Process a 3D file using a filter script, writing the output of the filters into a log file: + +`meshlabserver -i {{input.x3d}} -o {{output.x3d}} -s {{filter_script.mlx}} -l {{logfile}}` diff --git a/pages.cn/common/meteor.md b/pages.cn/common/meteor.md new file mode 100644 index 0000000000..403bcfa578 --- /dev/null +++ b/pages.cn/common/meteor.md @@ -0,0 +1,27 @@ +# meteor + +> Full-stack javascript platform for building web applications. + +- Run a meteor project from its root directory in development mode: + +`meteor` + +- Create a project under the given directory: + +`meteor create {{path/to/directory}}` + +- Display the list of packages the project is currently using: + +`meteor list` + +- Add a package to the project: + +`meteor add {{package_name}}` + +- Remove a package from the project: + +`meteor remove {{package_name}}` + +- Create a production build of the project as a tarball under the given directory: + +`meteor build {{path/to/directory}}` diff --git a/pages.cn/common/micro.md b/pages.cn/common/micro.md new file mode 100644 index 0000000000..2b00a28b29 --- /dev/null +++ b/pages.cn/common/micro.md @@ -0,0 +1,28 @@ +# micro + +> Micro is a modern and intuitive terminal-based text editor. +> You can use your keyboard, but also your mouse to navigate and/or select text. + +- Open a file: + +`micro {{file}}` + +- Cut the entire line: + +`Ctrl + K` + +- Search for a pattern in the file (press `Ctrl + N`/`Ctrl + P` to go to next/previous match): + +`Ctrl + F "{{pattern}}" ` + +- Execute a command: + +`Ctrl + E {{command}} ` + +- Perform a substitution in the whole file: + +`Ctrl + E replaceall "{{pattern}}" "{{replacement}}" ` + +- Quit: + +`Ctrl + Q` diff --git a/pages.cn/common/minetest.md b/pages.cn/common/minetest.md new file mode 100644 index 0000000000..abfc69cef9 --- /dev/null +++ b/pages.cn/common/minetest.md @@ -0,0 +1,20 @@ +# minetest + +> Multiplayer infinite-world block sandbox. +> See also `minetestserver`, the server-only binary. + +- Start minetest in client mode: + +`minetest` + +- Start minetest in server mode: + +`minetest --server` + +- Write logs to a specific file: + +`minetest --logfile {{path/to/file}}` + +- Only write errors to the console: + +`minetest --quiet` diff --git a/pages.cn/common/minetestserver.md b/pages.cn/common/minetestserver.md new file mode 100644 index 0000000000..470e4fd3e9 --- /dev/null +++ b/pages.cn/common/minetestserver.md @@ -0,0 +1,36 @@ +# minetestserver + +> Multiplayer infinite-world block sandbox server. +> See also `minetest`, the graphical client. + +- Start the server: + +`minetestserver` + +- List available worlds: + +`minetestserver --world list` + +- Specify the world name to load: + +`minetestserver --world {{world_name}}` + +- List the available game IDs: + +`minetestserver --gameid list` + +- Specify a game to use: + +`minetestserver --gameid {{game_id}}` + +- Listen on a specific port: + +`minetestserver --port {{34567}}` + +- Migrate to a different data backend: + +`minetestserver --migrate {{sqlite3|leveldb|redis}}` + +- Start an interactive terminal after starting the server: + +`minetestserver --terminal` diff --git a/pages.cn/common/minikube.md b/pages.cn/common/minikube.md new file mode 100644 index 0000000000..9cb9f5d043 --- /dev/null +++ b/pages.cn/common/minikube.md @@ -0,0 +1,19 @@ +# minikube + +> Tool to run Kubernetes locally. + +- Start the cluster: + +`minikube start` + +- Get the IP address of the cluster: + +`minikube ip` + +- Access a service named my_service exposed via a node port and get the url: + +`minikube service {{my_service}} --url` + +- Open kubernetes dashboard in a browser: + +`minikube dashboard` diff --git a/pages.cn/common/mitmdump.md b/pages.cn/common/mitmdump.md new file mode 100644 index 0000000000..e5a83e85f0 --- /dev/null +++ b/pages.cn/common/mitmdump.md @@ -0,0 +1,16 @@ +# mitmdump + +> View, record, and programmatically transform HTTP traffic. +> The command-line counterpart to mitmproxy. + +- Start a proxy and save all output to a file: + +`mitmdump -w {{filename}}` + +- Filter a saved traffic file to just POST requests: + +`mitmdump -nr {{input_filename}} -w {{output_filename}} {{"~m post"}}` + +- Replay a saved traffic file: + +`mitmdump -nc {{filename}}` diff --git a/pages.cn/common/mitmproxy.md b/pages.cn/common/mitmproxy.md new file mode 100644 index 0000000000..431caa4238 --- /dev/null +++ b/pages.cn/common/mitmproxy.md @@ -0,0 +1,11 @@ +# mitmproxy + +> An interactive man-in-the-middle HTTP proxy. + +- Start mitmproxy with default settings: + +`mitmproxy` + +- Start mitmproxy bound to custom address and port: + +`mitmproxy -b {{ip_address}} -p {{port}}` diff --git a/pages.cn/common/mix.md b/pages.cn/common/mix.md new file mode 100644 index 0000000000..062fa06ec3 --- /dev/null +++ b/pages.cn/common/mix.md @@ -0,0 +1,23 @@ +# mix + +> Mix is a build tool that provides tasks for creating, compiling, and testing Elixir projects, managing its dependencies, and more. + +- Execute a particular file: + +`mix run {{my_script.exs}}` + +- Create a new project: + +`mix new {{project_name}}` + +- Compile project: + +`mix compile` + +- Run project tests: + +`mix test` + +- List all mix commands: + +`mix help` diff --git a/pages.cn/common/mkdir.md b/pages.cn/common/mkdir.md new file mode 100644 index 0000000000..905bba39fc --- /dev/null +++ b/pages.cn/common/mkdir.md @@ -0,0 +1,11 @@ +# mkdir + +> Creates a directory. + +- Create a directory in current folder or given path: + +`mkdir {{directory}}` + +- Create directories recursively (useful for creating nested dirs): + +`mkdir -p {{path/to/directory}}` diff --git a/pages.cn/common/mkfifo.md b/pages.cn/common/mkfifo.md new file mode 100644 index 0000000000..55c3042d51 --- /dev/null +++ b/pages.cn/common/mkfifo.md @@ -0,0 +1,7 @@ +# mkfifo + +> Makes FIFOs (named pipes). + +- Create a named pipe at a given path: + +`mkfifo {{path/to/pipe}}` diff --git a/pages.cn/common/mktemp.md b/pages.cn/common/mktemp.md new file mode 100644 index 0000000000..3db073a11f --- /dev/null +++ b/pages.cn/common/mktemp.md @@ -0,0 +1,15 @@ +# mktemp + +> Create a temporary file or directory. + +- Create an empty temporary file and return the absolute path to it: + +`mktemp` + +- Create a temporary directory and return the absolute path to it: + +`mktemp -d` + +- Create a temporary file with a specified suffix: + +`mktemp --suffix "{{.txt}}"` diff --git a/pages.cn/common/mlr.md b/pages.cn/common/mlr.md new file mode 100644 index 0000000000..7d73bb9530 --- /dev/null +++ b/pages.cn/common/mlr.md @@ -0,0 +1,27 @@ +# mlr + +> Miller is like `awk`, `sed`, `cut`, `join`, and `sort` for name-indexed data such as CSV, TSV, and tabular JSON. + +- Pretty-print a CSV file in a tabular format: + +`mlr --icsv --opprint cat {{example.csv}}` + +- Receive JSON data and pretty print the output: + +`echo '{"hello":"world"}' | mlr --ijson --opprint cat` + +- Sort alphabetically on a field: + +`mlr --icsv --opprint sort -f {{field}} {{example.csv}}` + +- Sort in descending numerical order on a field: + +`mlr --icsv --opprint sort -nr {{field}} {{example.csv}}` + +- Convert CSV to JSON, performing calculations and display those calculations: + +`mlr --icsv --ojson put '${{newField1}} = ${{oldFieldA}}/${{oldFieldB}}' {{example.csv}}` + +- Receive JSON and format the output as vertical JSON: + +`echo '{"hello":"world", "foo":"bar"}' | mlr --ijson --ojson --jvstack cat` diff --git a/pages.cn/common/mmv.md b/pages.cn/common/mmv.md new file mode 100644 index 0000000000..5c6ba37d18 --- /dev/null +++ b/pages.cn/common/mmv.md @@ -0,0 +1,19 @@ +# mmv + +> Move and rename files in bulk. + +- Rename all files with a certain extension to a different extension: + +`mmv "*{{.old_extension}}" "#1{{.new_extension}}"` + +- Copy report6part4.txt to ./french/rapport6partie4.txt along with all similarly named files: + +`mmv -c {{"report*part*.txt"}} {{"./french/rapport#1partie#2.txt"}}` + +- Append all .txt files into one file: + +`mmv -a {{"*.txt"}} {{"all.txt"}}` + +- Convert dates in filenames from "M-D-Y" format to "D-M-Y" format: + +`mmv {{"[0-1][0-9]-[0-3][0-9]-[0-9][0-9][0-9][0-9].txt"}} {{"#3#4-#1#2-#5#6#7#8.txt"}}` diff --git a/pages.cn/common/mocha.md b/pages.cn/common/mocha.md new file mode 100644 index 0000000000..6bff8bc869 --- /dev/null +++ b/pages.cn/common/mocha.md @@ -0,0 +1,23 @@ +# mocha + +> Execute Mocha JavaScript test runner. + +- Run tests with default configuration or as configured in `mocha.opts`: + +`mocha` + +- Run tests contained at a specific location: + +`mocha {{folder/with/tests}}` + +- Run tests that match a specific grep pattern: + +`mocha --grep {{^regex$}}` + +- Run tests on changes to JavaScript files in the current directory and once initially: + +`mocha --watch` + +- Run tests with a specific reporter: + +`mocha --reporter {{reporter}}` diff --git a/pages.cn/common/mogrify.md b/pages.cn/common/mogrify.md new file mode 100644 index 0000000000..6cb853c305 --- /dev/null +++ b/pages.cn/common/mogrify.md @@ -0,0 +1,24 @@ +# mogrify + +> Perform operations on multiple images, such as resizing, cropping, flipping, and adding effects. +> Changes are applied directly to the original file. + +- Resize all JPEG images in the folder to 50% of their initial size: + +`mogrify -resize {{50%}} {{*.jpg}}` + +- Resize all images starting with "DSC" to 800x600: + +`mogrify -resize {{800x600}} {{DSC*}}` + +- Convert all PNG images in the folder to JPEG: + +`mogrify -format {{jpg}} {{*.png}}` + +- Halve the saturation of all image files in the current directory: + +`mogrify -modulate {{100,50}} {{*}}` + +- Double the brightness of all image files in the current directory: + +`mogrify -modulate {{200}} {{*}}` diff --git a/pages.cn/common/mongo.md b/pages.cn/common/mongo.md new file mode 100644 index 0000000000..34f0592a47 --- /dev/null +++ b/pages.cn/common/mongo.md @@ -0,0 +1,19 @@ +# mongo + +> MongoDB interactive shell client. + +- Connect to a database: + +`mongo {{database}}` + +- Connect to a database running on a given host on a given port: + +`mongo --host {{host}} --port {{port}} {{database}}` + +- Connect to a database with a given username; user will be prompted for password: + +`mongo --username {{username}} {{database}} --password` + +- Evaluate a javascript expression on the database: + +`mongo --eval '{{JSON.stringify(db.foo.findOne())}}' {{database}}` diff --git a/pages.cn/common/mongod.md b/pages.cn/common/mongod.md new file mode 100644 index 0000000000..709faa072c --- /dev/null +++ b/pages.cn/common/mongod.md @@ -0,0 +1,15 @@ +# mongod + +> The MongoDB database server. + +- Specify a config file: + +`mongod --config {{filename}}` + +- Specify the port to listen on: + +`mongod --port {{port}}` + +- Specify database profiling level. 0 is off, 1 is only slow operations, 2 is all: + +`mongod --profile {{0|1|2}}` diff --git a/pages.cn/common/mongodump.md b/pages.cn/common/mongodump.md new file mode 100644 index 0000000000..6ed98617bf --- /dev/null +++ b/pages.cn/common/mongodump.md @@ -0,0 +1,27 @@ +# mongodump + +> Utility to export the contents of a MongoDB instance. + +- Create a dump of all databases (this will place the files inside a folder called "dump"): + +`mongodump` + +- Specify an output location for the dump: + +`mongodump --out {{path/to/folder}}` + +- Create a dump of a given database: + +`mongodump --db {{database_name}}` + +- Create a dump of a given collection within a given database: + +`mongodump --collection {{collection_name}} --db {{database_name}}` + +- Connect to a given host running on a given port, and create a dump: + +`mongodump --host {{host}} --port {{port}}` + +- Create a dump of a given database with a given username; user will be prompted for password: + +`mongodump --username {{username}} {{database}} --password` diff --git a/pages.cn/common/mongorestore.md b/pages.cn/common/mongorestore.md new file mode 100644 index 0000000000..30da0771e3 --- /dev/null +++ b/pages.cn/common/mongorestore.md @@ -0,0 +1,19 @@ +# mongorestore + +> Utility to import a collection or database from a binary dump into a MongoDB instance. + +- Import a bson data dump from a folder to a MongoDB database: + +`mongorestore --db {{database_name}} {{path/to/folder}}` + +- Import a bson data dump from a folder to a given database in a MongoDB server host, running at a given port, with user authentication (user will be prompted for password): + +`mongorestore --host {{database_host:port}} --db {{database_name}} --username {{username}} {{path/to/folder}} --password` + +- Import a collection from a bson file to a MongoDB database: + +`mongorestore --db {{database_name}} {{path/to/file}}` + +- Import a collection from a bson file to a given database in a MongoDB server host, running at a given port, with user authentication (user will be prompted for password): + +`mongorestore --host {{database_host:port}} --db {{database_name}} --username {{username}} {{path/to/file}} --password` diff --git a/pages.cn/common/monodis.md b/pages.cn/common/monodis.md new file mode 100644 index 0000000000..831a44796c --- /dev/null +++ b/pages.cn/common/monodis.md @@ -0,0 +1,31 @@ +# monodis + +> The Mono Common Intermediate Language (CIL) disassembler. + +- Disassemble an assembly to textual CIL: + +`monodis {{path/to/assembly.exe}}` + +- Save the output to a file: + +`monodis --output={{path/to/output.il}} {{path/to/assembly.exe}}` + +- Show information about an assembly: + +`monodis --assembly {{path/to/assembly.dll}}` + +- List the references of an assembly: + +`monodis --assemblyref {{path/to/assembly.exe}}` + +- List all the methods in an assembly: + +`monodis --method {{path/to/assembly.exe}}` + +- Show a list of resources embedded within an assembly: + +`monodis --manifest {{path/to/assembly.dll}}` + +- Extract all the embedded resources to the current directory: + +`monodis --mresources {{path/to/assembly.dll}}` diff --git a/pages.cn/common/monop.md b/pages.cn/common/monop.md new file mode 100644 index 0000000000..e0b0ccec12 --- /dev/null +++ b/pages.cn/common/monop.md @@ -0,0 +1,31 @@ +# monop + +> Finds and displays signatures of Types and methods inside .NET assemblies. + +- Show the structure of a Type built-in of the .NET Framework: + +`monop {{System.String}}` + +- List the types in an assembly: + +`monop -r:{{path/to/assembly.exe}}` + +- Show the structure of a Type in a specific assembly: + +`monop -r:{{path/to/assembly.dll}} {{Namespace.Path.To.Type}}` + +- Only show members defined in the specified Type: + +`monop -r:{{path/to/assembly.dll}} --only-declared {{Namespace.Path.To.Type}}` + +- Show private members: + +`monop -r:{{path/to/assembly.dll}} --private {{Namespace.Path.To.Type}}` + +- Hide obsolete members: + +`monop -r:{{path/to/assembly.dll}} --filter-obsolete {{Namespace.Path.To.Type}}` + +- List the other assemblies that a specified assembly references: + +`monop -r:{{path/to/assembly.dll}} --refs` diff --git a/pages.cn/common/montage.md b/pages.cn/common/montage.md new file mode 100644 index 0000000000..b3966a9f56 --- /dev/null +++ b/pages.cn/common/montage.md @@ -0,0 +1,24 @@ +# montage + +> Imagemagick image montage tool. +> Tiles images into a customisable grid. + +- Tile images into a grid, automatically resizing images larger than the grid cell size: + +`montage {{image1.png}} {{image2.jpg}} {{imageN.png}} montage.jpg` + +- Tile images into a grid, automatically calculating the grid cell size from the largest image: + +`montage {{image1.png}} {{image2.jpg}} {{imageN.png}} -geometry +0+0 montage.jpg` + +- Set the grid cell size and resize images to fit it before tiling: + +`montage {{image1.png}} {{image2.jpg}} {{imageN.png}} -geometry 640x480+0+0 montage.jpg` + +- Limit the number of rows and columns in the grid, causing input images to overflow into multiple output montages: + +`montage {{image1.png}} {{image2.jpg}} {{imageN.png}} -geometry +0+0 -tile 2x3 montage_%d.jpg` + +- Resize and crop images to completely fill their grid cells before tiling: + +`montage {{image1.png}} {{image2.jpg}} {{imageN.png}} -geometry +0+0 -resize 640x480^ -gravity center -crop 640x480+0+0 montage.jpg` diff --git a/pages.cn/common/more.md b/pages.cn/common/more.md new file mode 100644 index 0000000000..1ea8a9a677 --- /dev/null +++ b/pages.cn/common/more.md @@ -0,0 +1,19 @@ +# more + +> Open a file for interactive reading, allowing scrolling and search (in forward direction only). + +- Open a file: + +`more {{source_file}}` + +- Page down: + +`` + +- Search for a string (press `n` to go to the next match): + +`/{{something}}` + +- Exit: + +`q` diff --git a/pages.cn/common/moro.md b/pages.cn/common/moro.md new file mode 100644 index 0000000000..447eb736c8 --- /dev/null +++ b/pages.cn/common/moro.md @@ -0,0 +1,31 @@ +# moro + +> Track work time. + +- Invoke `moro` without parameters, to set the current time as the start of the working day: + +`moro` + +- Specify a custom time for the start of the working day: + +`moro hi {{09:30}}` + +- Invoke `moro` without parameters a second time, to set the current time at the end of the working day: + +`moro` + +- Specify a custom time for the end of the working day: + +`moro bye {{17:30}}` + +- Add a note on the current working day: + +`moro note {{3 hours on project Foo}}` + +- Show a report of time logs and notes for the current working day: + +`moro report` + +- Show a report of time logs and notes for all working days on record: + +`moro report --all` diff --git a/pages.cn/common/mosh.md b/pages.cn/common/mosh.md new file mode 100644 index 0000000000..a40453a189 --- /dev/null +++ b/pages.cn/common/mosh.md @@ -0,0 +1,28 @@ +# mosh + +> Mobile Shell (`mosh`) is a robust and responsive replacement for SSH. +> `mosh` persists connections to remote servers while roaming between networks. + +- Connect to a remote server: + +`mosh {{username}}@{{remote_host}}` + +- Connect to a remote server with a specific identity (private key): + +`mosh --ssh="ssh -i {{/path/to/key_file}}" {{username}}@{{remote_host}}` + +- Connect to a remote server using a specific port: + +`mosh --ssh="ssh -p {{2222}}" {{username}}@{{remote_host}}` + +- Run a command on a remote server: + +`mosh {{remote_host}} -- {{command -with -flags}}` + +- Select Mosh UDP port (useful when `{{remote_host}}` is behind a NAT): + +`mosh -p {{124}} {{username}}@{{remote_host}}` + +- Usage when `mosh-server` binary is outside standard path: + +`mosh --server={{/path/to/bin/}}mosh-server {{remote_host}}` diff --git a/pages.cn/common/most.md b/pages.cn/common/most.md new file mode 100644 index 0000000000..539049129a --- /dev/null +++ b/pages.cn/common/most.md @@ -0,0 +1,35 @@ +# most + +> Open one or several files for interactive reading, allowing scrolling and search. + +- Open a file: + +`most {{path/to/file}}` + +- Open several files: + +`most {{path/to/file1}} {{path/to/file2}}` + +- Open a file at the first occurrence of "string": + +`most {{file}} +/{{string}}` + +- Move through opened files: + +`:O n` + +- Jump to the 100th line: + +`{{100}}j` + +- Edit current file: + +`e` + +- Split the current window in half: + +` o` + +- Exit: + +`Q` diff --git a/pages.cn/common/mount.md b/pages.cn/common/mount.md new file mode 100644 index 0000000000..e798ddccdc --- /dev/null +++ b/pages.cn/common/mount.md @@ -0,0 +1,23 @@ +# mount + +> Provides access to an entire filesystem in one directory. + +- Show all mounted filesystems: + +`mount` + +- Mount a device to a directory: + +`mount -t {{filesystem_type}} {{path/to/device_file}} {{path/to/target_directory}}` + +- Mount a CD-ROM device (with the filetype ISO9660) to /cdrom (readonly): + +`mount -t {{iso9660}} -o ro {{/dev/cdrom}} {{/cdrom}}` + +- Mount all the filesystem defined in /etc/fstab: + +`mount -a` + +- Mount a specific filesystem described in /etc/fstab (e.g. "/dev/sda1 /my_drive ext2 defaults 0 2"): + +`mount {{/my_drive}}` diff --git a/pages.cn/common/mp4box.md b/pages.cn/common/mp4box.md new file mode 100644 index 0000000000..2f953c9621 --- /dev/null +++ b/pages.cn/common/mp4box.md @@ -0,0 +1,15 @@ +# mp4box + +> MPEG-4 Systems Toolbox - Muxes streams into MP4 container. + +- Display information about an existing MP4 file: + +`mp4box -info {{filename}}` + +- Add an SRT subtitle file into an MP4 file: + +`mp4box -add {{input_subs.srt}}:lang=eng -add {{input.mp4}} {{output.mp4}}` + +- Combine audio from one file and video from another: + +`mp4box -add {{input1.mp4}}#audio -add {{input2.mp4}}#video {{output.mp4}` diff --git a/pages.cn/common/mpc.md b/pages.cn/common/mpc.md new file mode 100644 index 0000000000..79807efa81 --- /dev/null +++ b/pages.cn/common/mpc.md @@ -0,0 +1,28 @@ +# mpc + +> Music Player Client. +> Program for controlling the Music Player Daemon (MPD). + +- Toggle play/pause: + +`mpc toggle` + +- Stop playing: + +`mpc stop` + +- Show information about the currently playing song: + +`mpc status` + +- Play next song: + +`mpc next` + +- Play previous song: + +`mpc prev` + +- Forward or rewind the currently playing song: + +`mpc [+-]{{seconds}}` diff --git a/pages.cn/common/mpv.md b/pages.cn/common/mpv.md new file mode 100644 index 0000000000..6b6da06af4 --- /dev/null +++ b/pages.cn/common/mpv.md @@ -0,0 +1,27 @@ +# mpv + +> A audio/video player based on MPlayer. + +- Play a video or audio file: + +`mpv {{file}}` + +- Jump backward/forward 5 seconds: + +`LEFT RIGHT` + +- Jump backward/forward 1 minute: + +`DOWN UP` + +- Decrease or increase playback speed by 10 %: + +`[ ]` + +- Play a file at a specified speed (0.01 to 100, default 1): + +`mpv --speed {{speed}} {{file}}` + +- Play a file using a profile defined in the `mpv.conf` file: + +`mpv --profile {{profile_name}} {{file}}` diff --git a/pages.cn/common/mr.md b/pages.cn/common/mr.md new file mode 100644 index 0000000000..39b97f0ef7 --- /dev/null +++ b/pages.cn/common/mr.md @@ -0,0 +1,19 @@ +# mr + +> Myrepos manages all your version control repositories at once. + +- Register a repository: + +`mr register` + +- Update repositories in 5 concurent jobs: + +`mr -j{{5}} update` + +- Print the status of all repositories: + +`mr status` + +- Checkout all repositories to the latest version: + +`mr checkout` diff --git a/pages.cn/common/msbuild.md b/pages.cn/common/msbuild.md new file mode 100644 index 0000000000..9737dca435 --- /dev/null +++ b/pages.cn/common/msbuild.md @@ -0,0 +1,31 @@ +# msbuild + +> The Microsoft build tool for Visual Studio project solutions. + +- Build the first project file in the current directory: + +`msbuild` + +- Build a specific project file: + +`msbuild {{path/to/project_file}}` + +- Set one or more semicolon-separated targets to build: + +`msbuild {{path/to/project_file}} /target:{{targets}}` + +- Set one or more semicolon-separated properties: + +`msbuild {{path/to/project_file}} /property:{{name=value}}` + +- Set the build tools version to use: + +`msbuild {{path/to/project_file}} /toolsversion:{{version}}` + +- Display detailed information at the end of the log about how the project was configured: + +`msbuild {{path/to/project_file}} /detailedsummary` + +- Display detailed help information: + +`msbuild /help` diff --git a/pages.cn/common/msmtp.md b/pages.cn/common/msmtp.md new file mode 100644 index 0000000000..4680fd78b3 --- /dev/null +++ b/pages.cn/common/msmtp.md @@ -0,0 +1,16 @@ +# msmtp + +> An SMTP client. +> It reads text from standard input and sends it to an SMTP server. + +- Send an email using the default account configured in `~/.msmtprc`: + +`echo {{"Hello world"}} | msmtp {{to@example.org}}` + +- Send an email using a specific account configured in `~/.msmtprc`: + +`echo {{"Hello world"}} | msmtp --account={{account_name}} {{to@example.org}}` + +- Send an email without a configured account. The password should be specified in the `~/.msmtprc` file: + +`echo {{"Hello world"}} | msmtp --host={{localhost}} --port={{999}} --from={{from@example.org}} {{to@example.org}}` diff --git a/pages.cn/common/mtr.md b/pages.cn/common/mtr.md new file mode 100644 index 0000000000..d8a7f3700d --- /dev/null +++ b/pages.cn/common/mtr.md @@ -0,0 +1,23 @@ +# mtr + +> Matt's Traceroute: combined traceroute and ping tool. + +- Traceroute to a host and continuously ping all intermediary hops: + +`mtr {{host}}` + +- Disable IP address and host name mapping: + +`mtr -n {{host}}` + +- Generate output after pinging each hop 10 times: + +`mtr -w {{host}}` + +- Force IP IPv4 or IPV6: + +`mtr -4 {{host}}` + +- Wait for a given time (in seconds) before sending another packet to the same hop: + +`mtr -i {{seconds}} {{host}}` diff --git a/pages.cn/common/mutool.md b/pages.cn/common/mutool.md new file mode 100644 index 0000000000..59e61ff36e --- /dev/null +++ b/pages.cn/common/mutool.md @@ -0,0 +1,23 @@ +# mutool + +> Convert PDF files, query information and extract data. + +- Convert pages 1-10 into 10 PNG images: + +`mutool convert -o {{image%d.png}} {{file.pdf}} {{1-10}}` + +- Convert pages 2, 3 and 5 of a PDF into text in the standard output: + +`mutool draw -F {{txt}} {{file.pdf}} {{2,3,5}}` + +- Concatenate two PDFs: + +`mutool merge -o {{output.pdf}} {{input1.pdf}} {{input2.pdf}}` + +- Query information about all content embedded in a PDF: + +`mutool info {{input.pdf}}` + +- Extract all images, fonts and resources embedded in a PDF out into the current directory: + +`mutool extract {{input.pdf}}` diff --git a/pages.cn/common/mutt.md b/pages.cn/common/mutt.md new file mode 100644 index 0000000000..c43f888cf9 --- /dev/null +++ b/pages.cn/common/mutt.md @@ -0,0 +1,23 @@ +# mutt + +> Command-line email client. + +- Open the specified mailbox: + +`mutt -f {{mailbox}}` + +- Send an email and specify a subject and a cc recipient: + +`mutt -s {{subject}} -c {{cc@example.com}} {{recipient@example.com}}` + +- Send an email with files attached: + +`mutt -a {{file1}} {{file2}} -- {{recipient@example.com}}` + +- Specify a file to include as the message body: + +`mutt -i {{file}} {{recipient@example.com}}` + +- Specify a draft file containing the header and the body of the message, in RFC 5322 format: + +`mutt -H {{file}} {{recipient@example.com}}` diff --git a/pages.cn/common/mv.md b/pages.cn/common/mv.md new file mode 100644 index 0000000000..c055b4184a --- /dev/null +++ b/pages.cn/common/mv.md @@ -0,0 +1,23 @@ +# mv + +> Move or rename files and directories. + +- Move files in arbitrary locations: + +`mv {{source}} {{target}}` + +- Do not prompt for confirmation before overwriting existing files: + +`mv -f {{source}} {{target}}` + +- Prompt for confirmation before overwriting existing files, regardless of file permissions: + +`mv -i {{source}} {{target}}` + +- Do not overwrite existing files at the target: + +`mv -n {{source}} {{target}}` + +- Move files in verbose mode, showing files after they are moved: + +`mv -v {{source}} {{target}}` diff --git a/pages.cn/common/mvn.md b/pages.cn/common/mvn.md new file mode 100644 index 0000000000..73858ab4eb --- /dev/null +++ b/pages.cn/common/mvn.md @@ -0,0 +1,36 @@ +# mvn + +> Apache Maven. +> Tool for building and managing Java-based projects. + +- Compile a project: + +`mvn compile` + +- Compile and package the compiled code in its distributable format, such as a `jar`: + +`mvn package` + +- Compile and package, skipping unit tests: + +`mvn package -Dmaven.test.skip=true` + +- Install the built package in local maven repository. (This will invoke the compile and package commands too): + +`mvn install` + +- Delete build artifacts from the target folder: + +`mvn clean` + +- Do a clean and then invoke the package phase: + +`mvn clean package` + +- Clean and then package the code with a given build profile: + +`mvn clean -P{{profile}} package` + +- Run a class with a main method: + +`mvn exec:java -Dexec.mainClass="{{com.example.Main}}" -Dexec.args="{{arg1 arg2}}"` diff --git a/pages.cn/common/mysql.md b/pages.cn/common/mysql.md new file mode 100644 index 0000000000..8bea863556 --- /dev/null +++ b/pages.cn/common/mysql.md @@ -0,0 +1,23 @@ +# mysql + +> The MySQL command-line tool. + +- Connect to a database: + +`mysql {{database_name}}` + +- Connect to a database, user will be prompted for a password: + +`mysql -u {{user}} --password {{database_name}}` + +- Connect to a database on another host: + +`mysql -h {{database_host}} {{database_name}}` + +- Connect to a database through a Unix socket: + +`mysql --socket {{path/to/socket.sock}}` + +- Execute SQL statements in a script file (batch file): + +`mysql -e "source {{filename.sql}}" {{database_name}}` diff --git a/pages.cn/common/mysqldump.md b/pages.cn/common/mysqldump.md new file mode 100644 index 0000000000..f329186397 --- /dev/null +++ b/pages.cn/common/mysqldump.md @@ -0,0 +1,11 @@ +# mysqldump + +> Backups MySQL databases. + +- Create a backup, user will be prompted for a password: + +`mysqldump -u {{user}} --password {{database_name}} -r {{filename.sql}}` + +- Restore a backup, user will be prompted for a password: + +`mysql -u {{user}} --password -e "source {{filename.sql}}" {{database_name}}` diff --git a/pages.cn/common/nano.md b/pages.cn/common/nano.md new file mode 100644 index 0000000000..c164eb8669 --- /dev/null +++ b/pages.cn/common/nano.md @@ -0,0 +1,15 @@ +# nano + +> Simple, easy to use editor. An enhanced, free Pico clone. + +- Start nano in terminal with {filename}: + +`nano {{filename}}` + +- Enable smooth scrolling: + +`nano -S {{filename}}` + +- Indent new lines to the previous lines' indentation: + +`nano -i {{filename}}` diff --git a/pages.cn/common/nasm.md b/pages.cn/common/nasm.md new file mode 100644 index 0000000000..8be1682d71 --- /dev/null +++ b/pages.cn/common/nasm.md @@ -0,0 +1,23 @@ +# nasm + +> The Netwide Assembler, a portable 80x86 assembler. + +- Assemble `source.asm` into a binary file `source`, in the (default) raw binary format: + +`nasm {{source.asm}}` + +- Assemble `source.asm` into a binary file `output_file`, in the specified format: + +`nasm -f {{format}} {{source.asm}} -o {{output_file}}` + +- List valid output formats (along with basic nasm help): + +`nasm -hf` + +- Assemble and generate an assembly listing file: + +`nasm -l {{list_file}} {{source.asm}}` + +- Add a directory (must be written with trailing slash) to the include file search path before assembling: + +`nasm -i {{/path/to/include_dir/}} {{source.asm}}` diff --git a/pages.cn/common/nc.md b/pages.cn/common/nc.md new file mode 100644 index 0000000000..0ec7955e97 --- /dev/null +++ b/pages.cn/common/nc.md @@ -0,0 +1,39 @@ +# nc + +> Reads and writes tcp or udp data. + +- Listen on a specified port: + +`nc -l {{port}}` + +- Connect to a certain port (you can then write to this port): + +`nc {{ip_address}} {{port}}` + +- Set a timeout: + +`nc -w {{timeout_in_seconds}} {{ipaddress}} {{port}}` + +- Serve a file: + +`nc -l {{port}} < {{file}}` + +- Receive a file: + +`nc {{ip_address}} {{port}} > {{file}}` + +- Server stay up after client detach: + +`nc -k -l {{port}}` + +- Client stay up after EOF: + +`nc -q {{timeout}} {{ip_address}}` + +- Port scanning: + +`nc -v -z {{ip_address}} {{port}}` + +- Proxy and port forwarding: + +`nc -l {{port}} | nc {{hostname}} {{port}}` diff --git a/pages.cn/common/ncmpcpp.md b/pages.cn/common/ncmpcpp.md new file mode 100644 index 0000000000..8bd43ad01e --- /dev/null +++ b/pages.cn/common/ncmpcpp.md @@ -0,0 +1,19 @@ +# ncmpcpp + +> A command line music player client for the Music Player Daemon. + +- Connect to a music player daemon on a given host and port: + +`ncmpcpp --host {{ip}} --port {{port}}` + +- Display metadata of the current song to console: + +`ncmpcpp --current-song` + +- Use a specified configuration file: + +`ncmpcpp --config {{file}}` + +- Use a different set of key bindings from a file: + +`ncmpcpp --bindings {{file}}` diff --git a/pages.cn/common/neofetch.md b/pages.cn/common/neofetch.md new file mode 100644 index 0000000000..2a9d52b9dc --- /dev/null +++ b/pages.cn/common/neofetch.md @@ -0,0 +1,19 @@ +# neofetch + +> CLI tool to display information about your operating system, software and hardware. + +- Return the default config, and create it if it's the first time the program runs: + +`neofetch` + +- Trigger an info line from appearing in the output, where 'infoname' is the function name in the config file, e.g. memory: + +`neofetch --{{enable|disable}} {{infoname}}` + +- Hide/Show OS architecture: + +`neofetch --os_arch {{on|off}}` + +- Enable/Disable CPU brand in output: + +`neofetch --cpu_brand {{on|off}}` diff --git a/pages.cn/common/ng.md b/pages.cn/common/ng.md new file mode 100644 index 0000000000..a222db7587 --- /dev/null +++ b/pages.cn/common/ng.md @@ -0,0 +1,35 @@ +# ng + +> Command Line Interface (CLI) for creating and managing Angular applications. + +- Create a new Angular application inside a folder: + +`ng new {{project_name}}` + +- Add a new component to one's application: + +`ng generate component {{component_name}}` + +- Add a new class to one's application: + +`ng generate class {{class_name}}` + +- Add a new directive to one's application: + +`ng generate directive {{directive_name}}` + +- Run the application with the following command in its root directory: + +`ng serve` + +- Build the application: + +`ng build` + +- Run unit tests: + +`ng test` + +- Check the version of your current Angular installation: + +`ng version` diff --git a/pages.cn/common/nginx.md b/pages.cn/common/nginx.md new file mode 100644 index 0000000000..9aa467c6c7 --- /dev/null +++ b/pages.cn/common/nginx.md @@ -0,0 +1,23 @@ +# nginx + +> Nginx web server. + +- Start server with the default config file: + +`nginx` + +- Start server with a custom config file: + +`nginx -c {{config_file}}` + +- Start server with a prefix for all relative paths in the config file: + +`nginx -c {{config_file}} -p {{prefix/for/relative/paths}}` + +- Test the configuration without affecting the running server: + +`nginx -t` + +- Reload the configuration by sending a signal with no downtime: + +`nginx -s reload` diff --git a/pages.cn/common/ngrep.md b/pages.cn/common/ngrep.md new file mode 100644 index 0000000000..06d4740879 --- /dev/null +++ b/pages.cn/common/ngrep.md @@ -0,0 +1,23 @@ +# ngrep + +> Filter network traffic packets using regular expressions. + +- Capture traffic of all interfaces: + +`ngrep -d any` + +- Capture traffic of a specific interface: + +`ngrep -d {{eth0}}` + +- Capture traffic crossing port 22 of interface eth0: + +`ngrep -d {{eth0}} port {{22}}` + +- Capture traffic from or to a host: + +`ngrep host {{www.example.com}}` + +- Filter keyword 'User-Agent:' of interface eth0: + +`ngrep -d {{eth0}} '{{User-Agent:}}'` diff --git a/pages.cn/common/nice.md b/pages.cn/common/nice.md new file mode 100644 index 0000000000..c23226397e --- /dev/null +++ b/pages.cn/common/nice.md @@ -0,0 +1,8 @@ +# nice + +> Execute a program with a custom scheduling priority (niceness). +> Niceness values range from -20 (the highest priority) to 19 (the lowest). + +- Launch a program with altered priority: + +`nice -n {{niceness_value}} {{command}}` diff --git a/pages.cn/common/nikto.md b/pages.cn/common/nikto.md new file mode 100644 index 0000000000..15216d8098 --- /dev/null +++ b/pages.cn/common/nikto.md @@ -0,0 +1,23 @@ +# nikto + +> Web server scanner which performs comprehensive tests against web servers for multiple items. + +- Perform a basic Nikto scan against a target host: + +`perl nikto.pl -h {{192.168.0.1}}` + +- Specify the port number when performing a basic scan: + +`perl nikto.pl -h {{192.168.0.1}} -p {{443}}` + +- Scan ports and protocols with full URL syntax: + +`perl nikto.pl -h {{https://192.168.0.1:443/}}` + +- Scan multiple ports in the same scanning session: + +`perl nikto.pl -h {{192.168.0.1}} -p {{80,88,443}}` + +- Update to the latest plugins and databases: + +`perl nikto.pl -update` diff --git a/pages.cn/common/nim.md b/pages.cn/common/nim.md new file mode 100644 index 0000000000..b28f3c7a30 --- /dev/null +++ b/pages.cn/common/nim.md @@ -0,0 +1,24 @@ +# nim + +> The Nim compiler. +> Processes, compiles and links Nim language source files. + +- Compile a source file: + +`nim compile {{file.nim}}` + +- Compile and run a source file: + +`nim compile -r {{file.nim}}` + +- Compile a source file with release optimizations enabled: + +`nim compile -d:release {{file.nim}}` + +- Build a release binary optimized for low file size: + +`nim compile -d:release --opt:size {{file.nim}}` + +- Generate HTML documentation for a module (output will be placed in the current directory): + +`nim doc {{file.nim}}` diff --git a/pages.cn/common/nimble.md b/pages.cn/common/nimble.md new file mode 100644 index 0000000000..7f7c453c73 --- /dev/null +++ b/pages.cn/common/nimble.md @@ -0,0 +1,28 @@ +# nimble + +> Package manager for the Nim programming language. +> Manage Nim projects and their dependencies. + +- Search for packages: + +`nimble search {{search_string}}` + +- Install a package: + +`nimble install {{package_name}}` + +- List installed packages: + +`nimble list -i` + +- Create a new Nimble package in the current directory: + +`nimble init` + +- Build a Nimble package: + +`nimble build` + +- Install a Nimble package: + +`nimble install` diff --git a/pages.cn/common/nix-collect-garbage.md b/pages.cn/common/nix-collect-garbage.md new file mode 100644 index 0000000000..12f1694970 --- /dev/null +++ b/pages.cn/common/nix-collect-garbage.md @@ -0,0 +1,16 @@ +# nix-collect-garbage + +> Delete unused and unreachable nix store paths. +> Generations can be listed using `nix-env --list-generations`. + +- Delete all store paths unused by current generations of each profile: + +`sudo nix-collect-garbage --delete-old` + +- Simulate the deletion of old store paths: + +`sudo nix-collect-garbage --delete-old --dry-run` + +- Delete all store paths older than 30 days: + +`sudo nix-collect-garbage --delete-older-than {{30d}}` diff --git a/pages.cn/common/nix-env.md b/pages.cn/common/nix-env.md new file mode 100644 index 0000000000..0226bfb050 --- /dev/null +++ b/pages.cn/common/nix-env.md @@ -0,0 +1,27 @@ +# nix-env + +> Manipulate or query Nix user environments. + +- Show available package with name or without name: + +`nix-env -qa {{pkg_name}}` + +- Show the status of available packages: + +`nix-env -qas` + +- Install package: + +`nix-env -i {{pkg_name}}` + +- Uninstall package: + +`nix-env -e {{pkg_name}}` + +- Upgrade one package: + +`nix-env -u {{pkg_name}}` + +- Upgrade all packages: + +`nix-env -u` diff --git a/pages.cn/common/nl.md b/pages.cn/common/nl.md new file mode 100644 index 0000000000..761ffc1f06 --- /dev/null +++ b/pages.cn/common/nl.md @@ -0,0 +1,23 @@ +# nl + +> A utility for numbering lines, either from a file, or from standard input. + +- Number non-blank lines in a file: + +`nl {{file}}` + +- Read from standard output: + +`cat {{file}} | nl {{options}} -` + +- Number only the lines with printable text: + +`nl -t {{file}}` + +- Number all lines including blank lines: + +`nl -b a {{file}}` + +- Number only the body lines that match a basic regular expression (BRE) pattern: + +`nl -b p'FooBar[0-9]' {{file}}` diff --git a/pages.cn/common/nmap.md b/pages.cn/common/nmap.md new file mode 100644 index 0000000000..ae203e31dc --- /dev/null +++ b/pages.cn/common/nmap.md @@ -0,0 +1,32 @@ +# nmap + +> Network exploration tool and security / port scanner. +> Some features only activate when Nmap is run with privileges. + +- Try to determine whether the specified hosts are up and what are their names: + +`nmap -sn {{ip_or_hostname}} {{optional_another_address}}` + +- Like above, but also run a default 1000-port TCP scan if host seems up: + +`nmap {{ip_or_hostname}} {{optional_another_address}}` + +- Also enable scripts, service detection, OS fingerprinting and traceroute: + +`nmap -A {{address_or_addresses}}` + +- Assume good network connection and speed up execution: + +`nmap -T4 {{address_or_addresses}}` + +- Scan a specific list of ports (use -p- for all ports 1-65535): + +`nmap -p {{port1,port2,...,portN}} {{address_or_addresses}}` + +- Perform TCP and UDP scanning (use -sU for UDP only, -sZ for SCTP, -sO for IP): + +`nmap -sSU {{address_or_addresses}}` + +- Perform TLS cipher scan against a host to determine supported ciphers and SSL/TLS protocols: + +`nmap --script ssl-enum-ciphers {{address_or_addresses}} -p 443` diff --git a/pages.cn/common/node.md b/pages.cn/common/node.md new file mode 100644 index 0000000000..efe50ee921 --- /dev/null +++ b/pages.cn/common/node.md @@ -0,0 +1,15 @@ +# node + +> Server-side JavaScript platform (Node.js). + +- Run a JavaScript file: + +`node {{file}}.js` + +- Start a REPL (interactive shell): + +`node` + +- Evaluate JavaScript by passing it in the command: + +`node -e "{{code}}"` diff --git a/pages.cn/common/nohup.md b/pages.cn/common/nohup.md new file mode 100644 index 0000000000..ac1f849cf5 --- /dev/null +++ b/pages.cn/common/nohup.md @@ -0,0 +1,7 @@ +# nohup + +> Allows for a process to live when the terminal gets killed. + +- Run process that can live beyond the terminal: + +`nohup {{command options}}` diff --git a/pages.cn/common/nokogiri.md b/pages.cn/common/nokogiri.md new file mode 100644 index 0000000000..c944c742e7 --- /dev/null +++ b/pages.cn/common/nokogiri.md @@ -0,0 +1,23 @@ +# nokogiri + +> An HTML, XML, SAX and Reader parser. + +- Parse the contents of a url or file: + +`nokogiri {{url|path/to/file}}` + +- Parse as a specific type: + +`nokogiri {{url|path/to/file}} --type {{xml|html}}` + +- Load a specific initialisation file before parsing: + +`nokogiri {{url|path/to/file}} -C {{path/to/config_file}}` + +- Parse using a specific encoding: + +`nokogiri {{url|path/to/file}} --encoding {{encoding}}` + +- Validate using a RELAX NG file: + +`nokogiri {{url|path/to/file}} --rng {{url|path/to/file}}` diff --git a/pages.cn/common/noti.md b/pages.cn/common/noti.md new file mode 100644 index 0000000000..cd466a84ef --- /dev/null +++ b/pages.cn/common/noti.md @@ -0,0 +1,15 @@ +# noti + +> Monitor a process and trigger a banner notification. + +- Display a notification when tar finishes compressing files: + +`noti {{tar -cjf example.tar.bz2 example/}}` + +- Display a notification even when you put it after the command to watch: + +`{{command_to_watch}}; noti` + +- Monitor a process by PID and trigger a notification when the PID disappears: + +`noti -w {{process_id}}` diff --git a/pages.cn/common/npm-check.md b/pages.cn/common/npm-check.md new file mode 100644 index 0000000000..d71d7aa789 --- /dev/null +++ b/pages.cn/common/npm-check.md @@ -0,0 +1,19 @@ +# npm-check + +> Check for outdated, incorrect, and unused npm package dependencies. + +- Display a report of outdated, incorrect, and unused dependencies: + +`npm-check` + +- Interactively update out-of-date packages: + +`npm-check --update` + +- Update everything without prompting: + +`npm-check --update-all` + +- Don't check for unused packages: + +`npm-check --skip-unused` diff --git a/pages.cn/common/npm.md b/pages.cn/common/npm.md new file mode 100644 index 0000000000..da33713c0e --- /dev/null +++ b/pages.cn/common/npm.md @@ -0,0 +1,36 @@ +# npm + +> JavaScript and Node.js package manager. +> Manage Node.js projects and their module dependencies. + +- Download and install a module globally: + +`npm install -g {{module_name}}` + +- Download all dependencies referenced in package.json: + +`npm install` + +- Download a given dependency required for the application to run, and add it to the package.json: + +`npm install {{module_name}}@{{version}} --save` + +- Download a given dependency for development purposes, and add it to the package.json: + +`npm install {{module_name}}@{{version}} --save-dev` + +- Uninstall a module: + +`npm uninstall {{module_name}}` + +- List a tree of installed modules referenced in package.json: + +`npm list` + +- List top-level globally installed modules: + +`npm list -g --depth={{0}}` + +- Interactively create a package.json file: + +`npm init` diff --git a/pages.cn/common/nproc.md b/pages.cn/common/nproc.md new file mode 100644 index 0000000000..9cff59d08a --- /dev/null +++ b/pages.cn/common/nproc.md @@ -0,0 +1,15 @@ +# nproc + +> Print the number of processing units (normally CPUs) available. + +- Display the number of available processing units: + +`nproc` + +- Display the number of installed processing units, including any inactive ones: + +`nproc --all` + +- If possible, subtract a given number of units from the returned value: + +`nproc --ignore {{count}}` diff --git a/pages.cn/common/npx.md b/pages.cn/common/npx.md new file mode 100644 index 0000000000..04c2a312f2 --- /dev/null +++ b/pages.cn/common/npx.md @@ -0,0 +1,15 @@ +# npx + +> Execute binaries from `npm` packages. + +- Execute the binary from a given npm module: + +`npx {{module_name}}` + +- In case a package has multiple binaries, specify the package name along with the binary: + +`npx -p {{package_name}} {{module_name}}` + +- View help contents: + +`npx --help` diff --git a/pages.cn/common/nrm.md b/pages.cn/common/nrm.md new file mode 100644 index 0000000000..53ac529120 --- /dev/null +++ b/pages.cn/common/nrm.md @@ -0,0 +1,24 @@ +# nrm + +> NPM registry manager. +> Helps to easily switch between different npm registries. + +- List all registries: + +`nrm ls` + +- Change to a particular registry: + +`nrm use {{registry}}` + +- Show the response time for all registries: + +`nrm test` + +- Add a custom registry: + +`nrm add {{registry}} {{url}}` + +- Delete a registry: + +`nrm del {{registry}}` diff --git a/pages.cn/common/nslookup.md b/pages.cn/common/nslookup.md new file mode 100644 index 0000000000..5f5e4667ba --- /dev/null +++ b/pages.cn/common/nslookup.md @@ -0,0 +1,31 @@ +# nslookup + +> Query name server(s) for various domain records. + +- Query your system's default name server for an IP address (A record) of the domain: + +`nslookup {{example.com}}` + +- Query a given name server for a NS record of the domain: + +`nslookup -type=NS {{example.com}} {{8.8.8.8}}` + +- Query for a reverse lookup (PTR record) of an IP address: + +`nslookup -type=PTR {{54.240.162.118}}` + +- Query for ANY available records using TCP protocol: + +`nslookup -vc -type=ANY {{example.com}} ` + +- Query a given name server for the whole zone file (zone transfer) of the domain using TCP protocol: + +`nslookup -vc -type=AXFR {{example.com}} {{name_server}}` + +- Query for a mail server (MX record) of the domain, showing details of the transaction: + +`nslookup -type=MX -debug {{example.com}}` + +- Query a given name server on a specific port number for a TXT record of the domain: + +`nslookup -port={{port_number}} -type=TXT {{example.com}} {{name_server}}` diff --git a/pages.cn/common/numfmt.md b/pages.cn/common/numfmt.md new file mode 100644 index 0000000000..50b3826ce3 --- /dev/null +++ b/pages.cn/common/numfmt.md @@ -0,0 +1,15 @@ +# numfmt + +> Convert numbers to and from human-readable strings. + +- Convert 1.5K (SI Units) to 1500: + +`numfmt --from={{si}} {{1.5K}}` + +- Convert 5th field (1-indexed) to IEC Units without converting header: + +`ls -l | numfmt --header={{1}} --field={{5}} --to={{iec}}` + +- Convert to IEC units, pad with 5 characters, left aligned: + +`du -s * | numfmt --to={{iec}} --format={{"%-5f"}}` diff --git a/pages.cn/common/nvim.md b/pages.cn/common/nvim.md new file mode 100644 index 0000000000..620b6c05fb --- /dev/null +++ b/pages.cn/common/nvim.md @@ -0,0 +1,36 @@ +# nvim + +> Neovim, a programmer's text editor based on Vim, provides several modes for different kinds of text manipulation. +> Pressing `i` enters edit mode. `` goes back to normal mode, which doesn't allow regular text insertion. + +- Open a file: + +`nvim {{file}}` + +- Enter text editing mode (insert mode): + +`i` + +- Copy ("yank") or cut ("delete") the current line (paste it with `P`): + +`{{yy|dd}}` + +- Undo the last operation: + +`u` + +- Search for a pattern in the file (press `n`/`N` to go to next/previous match): + +`/{{search_pattern}}` + +- Perform a regex substitution in the whole file: + +`:%s/{{pattern}}/{{replacement}}/g` + +- Save (write) the file, and quit: + +`:wq` + +- Quit without saving: + +`:q!` diff --git a/pages.cn/common/nvm.md b/pages.cn/common/nvm.md new file mode 100644 index 0000000000..150e7c9c9b --- /dev/null +++ b/pages.cn/common/nvm.md @@ -0,0 +1,28 @@ +# nvm + +> Node.js version manager. +> Switch between NodeJS versions: system, node, 0.10, 0.12, 4.2 etc. + +- Install a specific version of NodeJS: + +`nvm install {{node_version}}` + +- Use a specific version NodeJS in the current shell: + +`nvm use {{node_version}}` + +- Set the default NodeJS version: + +`nvm alias default {{node_version}}` + +- List all available NodeJS versions and print the default one: + +`nvm list` + +- Run a specific version NodeJS REPL: + +`nvm run {{node_version}} --version` + +- Run app in a specific version of NodeJS: + +`nvm exec {{node_version}} node {{app.js}}` diff --git a/pages.cn/common/objdump.md b/pages.cn/common/objdump.md new file mode 100644 index 0000000000..aafbe48ec1 --- /dev/null +++ b/pages.cn/common/objdump.md @@ -0,0 +1,15 @@ +# objdump + +> View information about object files. + +- Display the file header information: + +`objdump -f {{binary}}` + +- Display the dis-assembled output of executable sections: + +`objdump -d {{binary}}` + +- Display a complete binary hex dump of all sections: + +`objdump -s {{binary}}` diff --git a/pages.cn/common/od.md b/pages.cn/common/od.md new file mode 100644 index 0000000000..63f9040ddc --- /dev/null +++ b/pages.cn/common/od.md @@ -0,0 +1,28 @@ +# od + +> Display file contents in octal, decimal or hexadecimal format. +> Optionally display the byte offsets and/or printable representation for each line. + +- Display file using default settings: octal format, 8 bytes per line, byte offsets in octal, and duplicate lines replaced with `*`: + +`od {{path/to/file}}` + +- Display file in verbose mode, i.e. without replacing duplicate lines with `*`: + +`od -v {{path/to/file}}` + +- Display file in hexadecimal format (2-byte units), with byte offsets in decimal format: + +`od --format={{x}} --address-radix={{d}} -v {{path/to/file}}` + +- Display file in hexadecimal format (1-byte units), and 4 bytes per line: + +`od --format={{x1}} --width={{4}} -v {{path/to/file}}` + +- Display file in hexadecimal format along with its character representation, and do not print byte offsets: + +`od --format={{xz}} --address-radix={{n}} -v {{path/to/file}}` + +- Read only 100 bytes of a file starting from the 500th byte: + +`od --read-bytes {{100}} --skip-bytes={{500}} -v {{path/to/file}}` diff --git a/pages.cn/common/odps-auth.md b/pages.cn/common/odps-auth.md new file mode 100644 index 0000000000..433ccbeb2f --- /dev/null +++ b/pages.cn/common/odps-auth.md @@ -0,0 +1,31 @@ +# odps auth + +> User authorities in ODPS (Open Data Processing Service). + +- Add a user to the current project: + +`add user {{user_name}};` + +- Grant a set of authorities to a user: + +`grant {{action_list}} on {{object_type}} {{object_name}} to user {{user_name}};` + +- Show authorities of a user: + +`show grants for {{user_name}};` + +- Create a user role: + +`create role {{role_name}};` + +- Grant a set of authorities to a role: + +`grant {{action_list}} on {{object_type}} {{object_name}} to role {{role_name}};` + +- Describe authorities of a role: + +`desc role {{role_name}};` + +- Grant a role to a user: + +`grant {{role_name}} to {{user_name}};` diff --git a/pages.cn/common/odps-func.md b/pages.cn/common/odps-func.md new file mode 100644 index 0000000000..3bbd78a24c --- /dev/null +++ b/pages.cn/common/odps-func.md @@ -0,0 +1,19 @@ +# odps func + +> Manage functions in ODPS (Open Data Processing Service). + +- Show functions in the current project: + +`list functions;` + +- Create a Java function using a .jar resource: + +`create function {{func_name}} as {{path.to.package.Func}} using '{{package.jar}}';` + +- Create a Python function using a .py resource: + +`create function {{func_name}} as {{script.Func}} using '{{script.py}}';` + +- Delete a function: + +`drop function {{func_name}};` diff --git a/pages.cn/common/odps-inst.md b/pages.cn/common/odps-inst.md new file mode 100644 index 0000000000..e916523aac --- /dev/null +++ b/pages.cn/common/odps-inst.md @@ -0,0 +1,23 @@ +# odps inst + +> Manage instances in ODPS (Open Data Processing Service). + +- Show instances created by current user: + +`show instances;` + +- Describe the details of an instance: + +`desc instance {{instance_id}};` + +- Check the status of an instance: + +`status {{instance_id}};` + +- Wait on the termination of an instance, printing log and progress information until then: + +`wait {{instance_id}};` + +- Kill an instance: + +`kill {{instance_id}};` diff --git a/pages.cn/common/odps-resource.md b/pages.cn/common/odps-resource.md new file mode 100644 index 0000000000..7101737b0a --- /dev/null +++ b/pages.cn/common/odps-resource.md @@ -0,0 +1,27 @@ +# odps resource + +> Manage resources in ODPS (Open Data Processing Service). + +- Show resources in the current project: + +`list resources;` + +- Add file resource: + +`add file {{file_name}} as {{alias}};` + +- Add archive resource: + +`add archive {{archive.tar.gz}} as {{alias}};` + +- Add .jar resource: + +`add jar {{package.jar}};` + +- Add .py resource: + +`add py {{script.py}};` + +- Delete resource: + +`drop resource {{resource_name}};` diff --git a/pages.cn/common/odps-table.md b/pages.cn/common/odps-table.md new file mode 100644 index 0000000000..19bfcb4660 --- /dev/null +++ b/pages.cn/common/odps-table.md @@ -0,0 +1,23 @@ +# odps table + +> Create and modify tables in ODPS (Open Data Processing Service). + +- Create a table with partition and lifecycle: + +`create table {{table_name}} ({{col}} {{type}}) partitioned by ({{col}} {{type}}) lifecycle {{days}};` + +- Create a table based on the definition of another table: + +`create table {{table_name}} like {{another_table}};` + +- Add partition to a table: + +`alter table {{table_name}} add partition ({{partition_spec}});` + +- Delete partition from a table: + +`alter table {{table_name}} drop partition ({{partition_spec}});` + +- Delete table: + +`drop table {{table_name}};` diff --git a/pages.cn/common/odps-tunnel.md b/pages.cn/common/odps-tunnel.md new file mode 100644 index 0000000000..a53537aebb --- /dev/null +++ b/pages.cn/common/odps-tunnel.md @@ -0,0 +1,19 @@ +# odps tunnel + +> Data tunnel in ODPS (Open Data Processing Service). + +- Download table to local file: + +`tunnel download {{table_name}} {{file}};` + +- Upload local file to a table partition: + +`tunnel upload {{file}} {{table_name}}/{{partition_spec}};` + +- Upload table specifying field and record delimiters: + +`tunnel upload {{file}} {{table_name}} -fd {{field_delim}} -rd {{record_delim}};` + +- Upload table using multiple threads: + +`tunnel upload {{file}} {{table_name}} -threads {{num}};` diff --git a/pages.cn/common/odps.md b/pages.cn/common/odps.md new file mode 100644 index 0000000000..2e67a936d8 --- /dev/null +++ b/pages.cn/common/odps.md @@ -0,0 +1,27 @@ +# odps + +> Aliyun ODPS (Open Data Processing Service) command line tool. + +- Start the command line with a custom configuration file: + +`odpscmd --config={{odps_config.ini}}` + +- Switch current project: + +`use {{project_name}};` + +- Show tables in the current project: + +`show tables;` + +- Describe a table: + +`desc {{table_name}};` + +- Show table partitions: + +`show partitions {{table_name}};` + +- Describe a partition: + +`desc {{table_name}} partition ({{partition_spec}});` diff --git a/pages.cn/common/omf.md b/pages.cn/common/omf.md new file mode 100644 index 0000000000..48f63a89b2 --- /dev/null +++ b/pages.cn/common/omf.md @@ -0,0 +1,28 @@ +# omf + +> Oh My Fish, the Fishshell Framework. +> Install packages to extend and modify the fish shell. + +- Install one or more packages: + +`omf install {{name}}` + +- List installed packages: + +`omf list` + +- List available themes: + +`omf theme` + +- Apply a theme: + +`omf theme {{name}}` + +- Remove a theme or package: + +`omf remove {{name}}` + +- Uninstall Oh My Fish: + +`omf destroy` diff --git a/pages.cn/common/openssl.md b/pages.cn/common/openssl.md new file mode 100644 index 0000000000..ff49782f5a --- /dev/null +++ b/pages.cn/common/openssl.md @@ -0,0 +1,31 @@ +# openssl + +> OpenSSL cryptographic toolkit. + +- Generate a 2048bit RSA private key and save it to a file: + +`openssl genrsa -out {{filename.key}} 2048` + +- Generate a certificate signing request to be sent to a certificate authority: + +`openssl req -new -sha256 -key {{filename.key}} -out {{filename.csr}}` + +- Generate a self-signed certificate from a certificate signing request valid for some number of days: + +`openssl x509 -req -days {{days}} -in {{filename.csr}} -signkey {{filename.key}} -out {{filename.crt}}` + +- Display certificate information: + +`openssl x509 -in {{filename.crt}} -noout -text` + +- Display the start and expiry dates for a domain's certificate: + +`openssl s_client -connect {{host}}:{{port}} 2>/dev/null | openssl x509 -noout -dates` + +- Display the certificate presented by an SSL/TLS server: + +`openssl s_client -connect {{host}}:{{port}} A tool that takes LLVM source files and runs specified optimizations and/or analyses on them. + +- Run an optimization or analysis on a bitcode file: + +`opt -{{passname}} {{path/to/file.bc}} -S -o {{file_opt.bc}}` + +- Output the Control Flow Graph of a function to a "dot" file: + +`opt {{-dot-cfg}} -S {{path/to/file.bc}} -disable-output` + +- Optimize the program at level 2 and output the result to another file: + +`opt -O2 {{path/to/file.bc}} -S -o {{path/to/output_file.bc}}` diff --git a/pages.cn/common/optipng.md b/pages.cn/common/optipng.md new file mode 100644 index 0000000000..f482e57409 --- /dev/null +++ b/pages.cn/common/optipng.md @@ -0,0 +1,27 @@ +# optipng + +> PNG image file optimization utility. + +- Compress a PNG with default settings: + +`optipng {{path/to/file.png}}` + +- Compress a PNG with best compression: + +`optipng -o{{7}} {{path/to/file.png}}` + +- Compress a PNG with fastest compression: + +`optipng -o{{0}} {{path/to/file.png}}` + +- Compress a PNG and add interlacing: + +`optipng -i {{1}} {{path/to/file.png}}` + +- Compress a PNG and preserve all metadata (including file timestamps): + +`optipng -preserve {{path/to/file.png}}` + +- Compress a PNG and remove all metadata: + +`optipng -strip all {{path/to/file.png}}` diff --git a/pages.cn/common/p4.md b/pages.cn/common/p4.md new file mode 100644 index 0000000000..56e24fd775 --- /dev/null +++ b/pages.cn/common/p4.md @@ -0,0 +1,35 @@ +# p4 + +> Perforce Version Control System. + +- Log in to the Perforce service: + +`p4 login -a` + +- Create a client: + +`p4 client` + +- Copy files from depot into the client workspace: + +`p4 sync` + +- Create or edit changelist description: + +`p4 change` + +- Open a file to edit: + +`p4 edit -c {{changelist_number}} {{file_name}}` + +- Open a new file to add it to the depot: + +`p4 add` + +- Display list of files modified by changelist: + +`p4 describe -c {{changelist_number}}` + +- Submit a changelist to the depot: + +`p4 submit -c {{changelist_number}}` diff --git a/pages.cn/common/p5.md b/pages.cn/common/p5.md new file mode 100644 index 0000000000..380d5ba56d --- /dev/null +++ b/pages.cn/common/p5.md @@ -0,0 +1,19 @@ +# p5 + +> P5js template builder and sketch manager. + +- Create a new p5 collection: + +`p5 new {{collection_name}}` + +- Generate a new p5 project (should be run from collection directory): + +`p5 generate {{project_name}}` + +- Run the p5 manager server: + +`p5 server` + +- Update libraries to their latest versions: + +`p5 update` diff --git a/pages.cn/common/paci.md b/pages.cn/common/paci.md new file mode 100644 index 0000000000..3a685aa145 --- /dev/null +++ b/pages.cn/common/paci.md @@ -0,0 +1,23 @@ +# paci + +> A lightweight and flexible package manager for bash scripts. + +- Update the list of available packages and versions (it's recommended to run this before other `paci` commands): + +`paci refresh` + +- Configure its behaviour: + +`paci configure` + +- Search for a given package: + +`paci search {{package}}` + +- Install a package: + +`paci install {{package}}` + +- Update a package: + +`paci update {{package}}` diff --git a/pages.cn/common/pandoc.md b/pages.cn/common/pandoc.md new file mode 100644 index 0000000000..a5fdaca14b --- /dev/null +++ b/pages.cn/common/pandoc.md @@ -0,0 +1,23 @@ +# pandoc + +> Convert documents between various formats. + +- Convert file to pdf (the output format is determined by file extension): + +`pandoc {{input.md}} -o {{output.pdf}}` + +- Force conversion to use a specific format: + +`pandoc {{input.docx}} --to {{markdown_github}} -o {{output.md}}` + +- Convert to a standalone file with the appropriate headers/footers (for LaTeX, HTML, etc.): + +`pandoc {{input.md}} -s -o {{output.tex}}` + +- List all supported input formats: + +`pandoc --list-input-formats` + +- List all supported output formats: + +`pandoc --list-output-formats` diff --git a/pages.cn/common/parallel.md b/pages.cn/common/parallel.md new file mode 100644 index 0000000000..c4ac66aa2d --- /dev/null +++ b/pages.cn/common/parallel.md @@ -0,0 +1,27 @@ +# parallel + +> Run commands on multiple CPU cores. + +- Gzip several files at once, using all cores: + +`parallel gzip ::: {{file1}} {{file2}} {{file3}}` + +- Read arguments from stdin, run 4 jobs at once: + +`ls *.txt | parallel -j4 gzip` + +- Convert JPG images to PNG using replacement strings: + +`parallel convert {} {.}.png ::: *.jpg` + +- Parallel xargs, cram as many args as possible onto one command: + +`{{args}} | parallel -X {{command}}` + +- Break stdin into ~1M blocks, feed each block to stdin of new command: + +`cat {{big_file.txt}} | parallel --pipe --block 1M {{command}}` + +- Run on multiple machines via SSH: + +`parallel -S {{machine1}},{{machine2}} {{command}} ::: {{arg1}} {{arg2}}` diff --git a/pages.cn/common/pass.md b/pages.cn/common/pass.md new file mode 100644 index 0000000000..4e7c5a8cc8 --- /dev/null +++ b/pages.cn/common/pass.md @@ -0,0 +1,28 @@ +# pass + +> Safely store and read passwords or other sensitive data easily. +> All data is GPG-encrypted, and managed with a git repository. + +- Initialize the storage using a gpg-id for encryption: + +`pass init {{gpg_id}}` + +- Save a new password (prompts you for the value without echoing it): + +`pass insert {{path/to/data}}` + +- Copy a password (first line of the data file) to the clipboard: + +`pass -c {{path/to/data}}` + +- List the whole store tree: + +`pass` + +- Generate a new random password with a given length, and copy it to the clipboard: + +`pass generate -c {{path/to/data}} {{num}}` + +- Run any git command against the underlying store repository: + +`pass git {{git_arguments}}` diff --git a/pages.cn/common/passwd.md b/pages.cn/common/passwd.md new file mode 100644 index 0000000000..1e980b8a8c --- /dev/null +++ b/pages.cn/common/passwd.md @@ -0,0 +1,19 @@ +# passwd + +> Passwd is a tool used to change a user's password. + +- Change the password of the current user: + +`passwd {{new_password}}` + +- Change the password of the specified user: + +`passwd {{username}} {{new_password}}` + +- Get the current status of the user: + +`passwd -S` + +- Make the password of the account blank (it will set the named account passwordless): + +`passwd -d` diff --git a/pages.cn/common/paste.md b/pages.cn/common/paste.md new file mode 100644 index 0000000000..454ba2a6f3 --- /dev/null +++ b/pages.cn/common/paste.md @@ -0,0 +1,23 @@ +# paste + +> Merge lines of files. + +- Join all the lines into a single line, using TAB as delimiter: + +`paste -s {{file}}` + +- Join all the lines into a single line, using the specified delimiter: + +`paste -s -d {{delimiter}} {{file}}` + +- Merge two files side by side, each in its column, using TAB as delimiter: + +`paste {{file1}} {{file2}}` + +- Merge two files side by side, each in its column, using the specified delimiter: + +`paste -d {{delimiter}} {{file1}} {{file2}}` + +- Merge two files, with lines added alternatively: + +`paste -d '\n' {{file1}} {{file2}}` diff --git a/pages.cn/common/patch.md b/pages.cn/common/patch.md new file mode 100644 index 0000000000..44260c4b7c --- /dev/null +++ b/pages.cn/common/patch.md @@ -0,0 +1,16 @@ +# patch + +> Patch a file (or files) with a diff file. +> Note that diff files contain both the target filenames and list of changes. + +- Apply a patch: + +`patch < {{patch_file}}.diff` + +- Apply a patch to current directory: + +`patch -p1 < {{patch_file}}.diff` + +- Apply the reverse of a patch: + +`patch -R < {{patch_file}}.diff` diff --git a/pages.cn/common/pdfjoin.md b/pages.cn/common/pdfjoin.md new file mode 100644 index 0000000000..ad0e3081a5 --- /dev/null +++ b/pages.cn/common/pdfjoin.md @@ -0,0 +1,15 @@ +# pdfjoin + +> PDF merging utility. + +- Merge two PDFs: + +`pdfjoin {{file1}} {{file2}} --outfile {{output_file}}` + +- Save pages 3 to 5 followed by page 1 to a new PDF: + +`pdfjoin {{file 3-5,1}} --outfile {{output_file}}` + +- Merge subranges from two PDFs: + +`pdfjoin {{file1 3-5,1}} {{file2 4-6}} --outfile {{output_file}}` diff --git a/pages.cn/common/pdflatex.md b/pages.cn/common/pdflatex.md new file mode 100644 index 0000000000..ebc195c278 --- /dev/null +++ b/pages.cn/common/pdflatex.md @@ -0,0 +1,11 @@ +# pdflatex + +> Compile a pdf document from LaTeX source files. + +- Compile a pdf document: + +`pdflatex {{source.tex}}` + +- Compile a pdf document, halting on each error: + +`pdflatex -halt-on-error {{source.tex}}` diff --git a/pages.cn/common/pdfposter.md b/pages.cn/common/pdfposter.md new file mode 100644 index 0000000000..ec8ef9d2f7 --- /dev/null +++ b/pages.cn/common/pdfposter.md @@ -0,0 +1,11 @@ +# pdfposter + +> Convert a large-sheeted pdf into multiple A4 pages for printing. + +- Convert an A2 poster into 4 A4 pages: + +`pdfposter --poster-size a2 {{input_file.pdf}} {{output_file.pdf}}` + +- Scale an A4 poster to A3 and then generate 2 A4 pages: + +`pdfposter --scale 2 {{input_file.pdf}} {{output_file.pdf}}` diff --git a/pages.cn/common/pdftk.md b/pages.cn/common/pdftk.md new file mode 100644 index 0000000000..8bfd90d196 --- /dev/null +++ b/pages.cn/common/pdftk.md @@ -0,0 +1,23 @@ +# pdftk + +> PDF toolkit. + +- Extract pages 1-3, 5 and 6-10 from a PDF file and save them as another one: + +`pdftk {{input.pdf}} cat {{1-3 5 6-10}} output {{output.pdf}}` + +- Merge (concatenate) a list of PDF files and save the result as another one: + +`pdftk {{file1.pdf}} {{file2.pdf}} ... cat output {{output.pdf}}` + +- Split each page of a PDF file into a separate file, with a given filename output pattern: + +`pdftk {{input.pdf}} burst output {{out_%d.pdf}}` + +- Rotate all pages by 180 degrees clockwise: + +`pdftk {{input.pdf}} cat {{1-endsouth}} output {{output.pdf}}` + +- Rotate third page by 90 degrees clockwise and leave others unchanged: + +`pdftk {{input.pdf}} cat {{1-2 3east 4-end}} output {{output.pdf}}` diff --git a/pages.cn/common/pdftotext.md b/pages.cn/common/pdftotext.md new file mode 100644 index 0000000000..6bf3b1eb6b --- /dev/null +++ b/pages.cn/common/pdftotext.md @@ -0,0 +1,19 @@ +# pdftotext + +> Convert PDF files to plain text format. + +- Convert filename.pdf to plain text and print it to standard output: + +`pdftotext {{filename.pdf}} -` + +- Convert filename.pdf to plain text and save it as filename.txt: + +`pdftotext {{filename.pdf}}` + +- Convert input.pdf to plain text and save it as output.txt: + +`pdftotext {{input.pdf}} {{output.txt}}` + +- Convert pages 2, 3 and 4 of input.pdf to plain text and save them as output.txt: + +`pdftotext -f {{2}} -l {{4}} {{input.pdf}} {{output.txt}}` diff --git a/pages.cn/common/pdfunite.md b/pages.cn/common/pdfunite.md new file mode 100644 index 0000000000..53cba201ee --- /dev/null +++ b/pages.cn/common/pdfunite.md @@ -0,0 +1,11 @@ +# pdfunite + +> PDF merging utility. + +- Merge 2 PDFs into a single PDF: + +`pdfunite {{path/to/fileA.pdf}} {{path/to/fileB.pdf}} {{path/to/merged_output.pdf}}` + +- Merge a folder of PDFs into a single PDF: + +`pdfunite {{path/to/directory/*.pdf}} {{path/to/merged_output.pdf}}` diff --git a/pages.cn/common/peerflix.md b/pages.cn/common/peerflix.md new file mode 100644 index 0000000000..cad33fa812 --- /dev/null +++ b/pages.cn/common/peerflix.md @@ -0,0 +1,23 @@ +# peerflix + +> Stream video- or audio-based torrents to a media player. + +- Stream the largest media file in a torrent: + +`peerflix "{{torrent_url|magnet_link}}"` + +- List all streamable files contained in a torrent (given as a magnet link): + +`peerflix "{{magnet:?xt=urn:btih:0123456789abcdef0123456789abcdef01234567}}" --list` + +- Stream the largest file in a torrent, given as a torrent URL, to VLC: + +`peerflix "{{http://example.net/music.torrent}}" --vlc` + +- Stream the largest file in a torrent to MPlayer, with subtitles: + +`peerflix "{{torrent_url|magnet_link}}" --mplayer --subtitles {{subtitle-file.srt}}` + +- Stream all files from a torrent to Airplay: + +`peerflix "{{torrent_url|magnet_link}}" --all --airplay` diff --git a/pages.cn/common/perl.md b/pages.cn/common/perl.md new file mode 100644 index 0000000000..fc5e6b51e8 --- /dev/null +++ b/pages.cn/common/perl.md @@ -0,0 +1,31 @@ +# perl + +> The Perl 5 language interpreter. + +- Parse and execute a Perl script: + +`perl {{script.pl}}` + +- Check syntax errors on a Perl script: + +`perl -c {{script.pl}}` + +- Parse and execute a perl statement: + +`perl -e {{perl_statement}}` + +- Run a Perl script in debug mode, using `perldebug`: + +`perl -d {{script.pl}}` + +- Loo[p] over all lines of a file, editing them [i]n-place using a find/replace [e]xpression: + +`perl -p -i -e 's/{{find}}/{{replace}}/g' {{filename}}` + +- Run a find/replace expression on a file, saving the original file with a given extension: + +`perl -p -i'.old' -e 's/{{find}}/{{replace}}/g' {{filename}}` + +- Run a multi-line find/replace expression on a file, and save the result in another file: + +`perl -p0e 's/{{foo\nbar}}/{{foobar}}/g' {{input_file}} > {{output_file}}` diff --git a/pages.cn/common/pg_ctl.md b/pages.cn/common/pg_ctl.md new file mode 100644 index 0000000000..1d8ea3f277 --- /dev/null +++ b/pages.cn/common/pg_ctl.md @@ -0,0 +1,19 @@ +# pg_ctl + +> Utility for controlling a PostgreSQL server and database cluster. + +- Start a PostgreSQL server: + +`pg_ctl -D {{data_directory}} -l {{log_file_name}}` + +- Initialize a PostgreSQL database cluster: + +`pg_ctl -D {{data_directory}} init` + +- Stop a PostgreSQL server: + +`pg_ctl -D {{data_directory}} stop` + +- Restart a PostgreSQL server: + +`pg_ctl -D {{data_directory}} restart` diff --git a/pages.cn/common/pg_dump.md b/pages.cn/common/pg_dump.md new file mode 100644 index 0000000000..6afd1fa34b --- /dev/null +++ b/pages.cn/common/pg_dump.md @@ -0,0 +1,19 @@ +# pg_dump + +> Extract a PostgreSQL database into a script file or other archive file. + +- Dump database into a SQL-script file: + +`pg_dump {{db_name}} > {{output_file.sql}}` + +- Same as above, customize username: + +`pg_dump -U {{username}} {{db_name}} > {{output_file.sql}}` + +- Same as above, customize host and port: + +`pg_dump -h {{host}} -p {{port}} {{db_name}} > {{output_file.sql}}` + +- Dump a database into a custom-format archive file: + +`pg_dump -Fc {{db_name}} > {{output_file.dump}}` diff --git a/pages.cn/common/pg_restore.md b/pages.cn/common/pg_restore.md new file mode 100644 index 0000000000..321c43c264 --- /dev/null +++ b/pages.cn/common/pg_restore.md @@ -0,0 +1,23 @@ +# pg_restore + +> Restore a PostgreSQL database from an archive file created by pg_dump. + +- Restore an archive into an existing database: + +`pg_restore -d {{db_name}} {{archive_file.dump}}` + +- Same as above, customize username: + +`pg_restore -U {{username}} -d {{db_name}} {{archive_file.dump}}` + +- Same as above, customize host and port: + +`pg_restore -h {{host}} -p {{port}} -d {{db_name}} {{archive_file.dump}}` + +- Clean database objects before creating them: + +`pg_restore --clean -d {{db_name}} {{archive_file.dump}}` + +- Use multiple jobs to do the restoring: + +`pg_restore -j {{2}} -d {{db_name}} {{archive_file.dump}}` diff --git a/pages.cn/common/pgrep.md b/pages.cn/common/pgrep.md new file mode 100644 index 0000000000..1f5221736e --- /dev/null +++ b/pages.cn/common/pgrep.md @@ -0,0 +1,15 @@ +# pgrep + +> Find or signal process by name. + +- Return PIDs of any running processes with a matching command string: + +`pgrep {{process_name}}` + +- Search full command line with parameters instead of just the process name: + +`pgrep -f "{{process_name}} {{parameter}}"` + +- Search for process run by a specific user: + +`pgrep -u root {{process_name}}` diff --git a/pages.cn/common/phing.md b/pages.cn/common/phing.md new file mode 100644 index 0000000000..d90e6ef5a6 --- /dev/null +++ b/pages.cn/common/phing.md @@ -0,0 +1,35 @@ +# phing + +> A PHP build tool based on Apache Ant. + +- Perform the default task in the "build.xml" file: + +`phing` + +- Initialise a new build file: + +`phing -i {{path/to/build.xml}}` + +- Perform a specific task: + +`phing {{task_name}}` + +- Specify a custom build file path: + +`phing -f {{path/to/build.xml}} {{task_name}}` + +- Specify a log file to output to: + +`phing -b {{path/to/log_file}} {{task_name}}` + +- Specify custom properties to use in the build: + +`phing -D{{property}}={{value}} {{task_name}}` + +- Specify a custom listener class: + +`phing -listener {{class_name}} {{task_name}}` + +- Build using verbose output: + +`phing -verbose {{task_name}}` diff --git a/pages.cn/common/phive.md b/pages.cn/common/phive.md new file mode 100644 index 0000000000..a195f1deb5 --- /dev/null +++ b/pages.cn/common/phive.md @@ -0,0 +1,35 @@ +# phive + +> The Phar Installation and Verification Environment for secure PHP application deployment. + +- Display a list of available aliased Phars: + +`phive list` + +- Install a specified Phar to the local directory: + +`phive install {{alias|url}}` + +- Install a specified Phar globally: + +`phive install {{alias|url}} --global` + +- Install a specified Phar to a target directory: + +`phive install {{alias|url}} --target {{path/to/directory}}` + +- Update all Phar files to the latest version: + +`phive update` + +- Remove a specified Phar file: + +`phive remove {{alias|url}}` + +- Remove unused Phar files: + +`phive purge` + +- List all available commands: + +`phive help` diff --git a/pages.cn/common/php-artisan.md b/pages.cn/common/php-artisan.md new file mode 100644 index 0000000000..f81a751e04 --- /dev/null +++ b/pages.cn/common/php-artisan.md @@ -0,0 +1,19 @@ +# php artisan + +> Laravel's Artisan command line interface. + +- Start PHP's built-in web server for the current Laravel application: + +`php artisan serve` + +- Start an interactive PHP command line interface: + +`php artisan tinker` + +- Generate a new Eloquent model class with a migration, factory and resource controller: + +`php artisan make:model {{ModelName}} --all` + +- Display a list of all available commands: + +`php artisan help` diff --git a/pages.cn/common/php-yii.md b/pages.cn/common/php-yii.md new file mode 100644 index 0000000000..cca4c84d89 --- /dev/null +++ b/pages.cn/common/php-yii.md @@ -0,0 +1,15 @@ +# php yii + +> Yii Framework's command line interface. + +- Display a list of all available commands: + +`php yii {{help}}` + +- Start PHP's built-in web server for the current Yii application: + +`php yii {{serve}}` + +- Generate a controller, views and related files for the CRUD actions on the specified model class: + +`php yii {{gii/crud}} --modelClass={{ModelName}} --controllerClass={{ControllerName}}` diff --git a/pages.cn/common/php.md b/pages.cn/common/php.md new file mode 100644 index 0000000000..a8822bf6c9 --- /dev/null +++ b/pages.cn/common/php.md @@ -0,0 +1,23 @@ +# php + +> PHP command line interface. + +- Parse and execute a php script: + +`php {{file}}` + +- Check syntax on (i.e. lint) a PHP script: + +`php -l {{file}}` + +- Run PHP interactively: + +`php -a` + +- Run PHP code (Notes: Don't use tags; escape double quotes with backslash): + +`php -r "{{code}}"` + +- Start a PHP built-in web server in the current directory: + +`php -S {{host:port}}` diff --git a/pages.cn/common/phpcpd.md b/pages.cn/common/phpcpd.md new file mode 100644 index 0000000000..45779d8235 --- /dev/null +++ b/pages.cn/common/phpcpd.md @@ -0,0 +1,27 @@ +# phpcpd + +> A copy and paste detector for PHP code. + +- Analyse duplicated code for a specific file or directory: + +`phpcpd {{path/to/file_or_directory}}` + +- Analyse using fuzzy matching for variable names: + +`phpcpd --fuzzy {{path/to/file_or_directory}}` + +- Specify a minimum number of identical lines (defaults to 5): + +`phpcpd --min-lines {{number_of_lines}} {{path/to/file_or_directory}}` + +- Specify a minimum number of identical tokens (defaults to 70): + +`phpcpd --min-tokens {{number_of_tokens}} {{path/to/file_or_directory}}` + +- Exclude a directory from analysis (must be relative to the source): + +`phpcpd --exclude {{path/to/excluded_directory}} {{path/to/file_or_directory}}` + +- Output the results to a PHP-CPD XML file: + +`phpcpd --log-pmd {{path/to/log_file}} {{path/to/file_or_directory}}` diff --git a/pages.cn/common/phpcs.md b/pages.cn/common/phpcs.md new file mode 100644 index 0000000000..e18aded999 --- /dev/null +++ b/pages.cn/common/phpcs.md @@ -0,0 +1,35 @@ +# phpcs + +> Tokenize PHP, JavaScript and CSS files to detect violations of a defined set of coding standards. + +- Sniff the specified directory for issues (defaults to the PEAR standard): + +`phpcs {{path/to/directory}}` + +- Display a list of installed coding standards: + +`phpcs -i` + +- Specify a coding standard to validate against: + +`phpcs {{path/to/directory}} --standard {{standard}}` + +- Specify file extension(s) to include when sniffing: + +`phpcs {{path/to/directory}} --extensions {{file_extension(s)}}` + +- Specify the format of the output report (e.g. `full`, `xml`, `json`, `summary`): + +`phpcs {{path/to/directory}} --report {{format}}` + +- Set config variables to be used during the process: + +`phpcs {{path/to/directory}} --config-set {{key}} {{value}}` + +- A comma-separated list of files to load before processing: + +`phpcs {{path/to/directory}} --bootstrap {{file(s)}}` + +- Don't recurse into subdirectories: + +`phpcs {{path/to/directory}} -l` diff --git a/pages.cn/common/phpize.md b/pages.cn/common/phpize.md new file mode 100644 index 0000000000..e765701672 --- /dev/null +++ b/pages.cn/common/phpize.md @@ -0,0 +1,11 @@ +# phpize + +> Prepare a PHP extension for compiling. + +- Prepare the PHP extension in the current directory for compiling: + +`phpize` + +- Delete files previously created by phpize: + +`phpize --clean` diff --git a/pages.cn/common/phploc.md b/pages.cn/common/phploc.md new file mode 100644 index 0000000000..ec20951875 --- /dev/null +++ b/pages.cn/common/phploc.md @@ -0,0 +1,31 @@ +# phploc + +> A tool for quickly measuring the size and analyzing the structure of a PHP project. + +- Analyse a directory and print the result: + +`phploc {{path/to/directory}}` + +- Include only specific files from a comma-separated list (globs are allowed): + +`phploc {{path/to/directory}} --names {{files}}` + +- Exclude specific files from a comma-separated list (globs are allowed): + +`phploc {{path/to/directory}} --names-exclude {{files}}` + +- Exclude a specific directory from analysis: + +`phploc {{path/to/directory}} --exclude {{path/to/exclude_directory}}` + +- Log the results to a specific CSV file: + +`phploc {{path/to/directory}} --log-csv {{path/to/file}}` + +- Log the results to a specific XML file: + +`phploc {{path/to/directory}} --log-xml {{path/to/file}}` + +- Count PHPUnit test case classes and test methods: + +`phploc {{path/to/directory}} --count-tests` diff --git a/pages.cn/common/phpmd.md b/pages.cn/common/phpmd.md new file mode 100644 index 0000000000..b6365e8f26 --- /dev/null +++ b/pages.cn/common/phpmd.md @@ -0,0 +1,31 @@ +# phpmd + +> A PHP mess detector that checks for common potential problems. + +- Display a list of available rulesets and formats: + +`phpmd` + +- Scan a file or directory for problems using comma-separated rulesets: + +`phpmd {{path/to/file_or_directory}} {{xml|text|html}} {{rulesets}}` + +- Specify the minimum priority threshold for rules: + +`phpmd {{path/to/file_or_directory}} {{xml|text|html}} {{rulesets}} --minimumpriority {{priority}}` + +- Include only the specified extensions in analysis: + +`phpmd {{path/to/file_or_directory}} {{xml|text|html}} {{rulesets}} --suffixes {{extensions}}` + +- Exclude the specified comma-separated directories: + +`phpmd {{path/to/file_or_directory}} {{xml|text|html}} {{rulesets}} --exclude {{directory_patterns}}` + +- Output the results to a file instead of stdout: + +`phpmd {{path/to/file_or_directory}} {{xml|text|html}} {{rulesets}} --reportfile {{path/to/report_file}}` + +- Ignore the use of warning-suppressive PHPDoc comments: + +`phpmd {{path/to/file_or_directory}} {{xml|text|html}} {{rulesets}} --strict` diff --git a/pages.cn/common/phpstan.md b/pages.cn/common/phpstan.md new file mode 100644 index 0000000000..ad16dfb9e0 --- /dev/null +++ b/pages.cn/common/phpstan.md @@ -0,0 +1,27 @@ +# phpstan + +> A PHP static analysis tool to discover bugs in code. + +- Display available options for analysis: + +`phpstan analyse --help` + +- Analyse the specified space-separated directories: + +`phpstan analyse {{path/to/directory}}` + +- Analyse a directory using a configuration file: + +`phpstan analyse {{path/to/directory}} --configuration {{path/to/config}}` + +- Analyse using a specific rule level (0-7, higher is stricter): + +`phpstan analyse {{path/to/directory}} --level {{level}}` + +- Specify an autoload file to load before analysing: + +`phpstan analyse {{path/to/directory}} --autoload-file {{path/to/autoload_file}}` + +- Specify a memory limit during analysis: + +`phpstan analyse {{path/to/directory}} --memory-limit {{memory_limit}}` diff --git a/pages.cn/common/phpunit.md b/pages.cn/common/phpunit.md new file mode 100644 index 0000000000..f72df979a9 --- /dev/null +++ b/pages.cn/common/phpunit.md @@ -0,0 +1,19 @@ +# phpunit + +> PHPUnit command-line test runner. + +- Run tests in the current directory. Note: Expects you to have a 'phpunit.xml': + +`phpunit` + +- Run tests in a specific file: + +`phpunit {{path/to/TestFile.php}}` + +- Run tests annotated with the given group: + +`phpunit --group {{name}}` + +- Run tests and generate a coverage report in HTML: + +`phpunit --coverage-html {{directory}}` diff --git a/pages.cn/common/picard.md b/pages.cn/common/picard.md new file mode 100644 index 0000000000..26807a8445 --- /dev/null +++ b/pages.cn/common/picard.md @@ -0,0 +1,15 @@ +# picard + +> Next generation MusicBrainz tagging application. + +- Start Picard: + +`picard` + +- Open a set of files: + +`picard {{path/to/file1.mp3}} {{path/to/file2.mp3}}` + +- Display the version of Picard installed: + +`picard --long-version` diff --git a/pages.cn/common/pigz.md b/pages.cn/common/pigz.md new file mode 100644 index 0000000000..91546501de --- /dev/null +++ b/pages.cn/common/pigz.md @@ -0,0 +1,23 @@ +# pigz + +> Multithreaded zlib compression utility. + +- Compress a file with default options: + +`pigz {{filename}}` + +- Compress a file using the best compression method: + +`pigz -9 {{filename}}` + +- Compress a file using no compression and 4 processors: + +`pigz -0 -p{{4}} {{filename}}` + +- Decompress a file: + +`pigz -d {{archive.gz}}` + +- List the contents of an archive: + +`pigz -l {{archive.tar.gz}}` diff --git a/pages.cn/common/ping.md b/pages.cn/common/ping.md new file mode 100644 index 0000000000..1b72e6f30a --- /dev/null +++ b/pages.cn/common/ping.md @@ -0,0 +1,27 @@ +# ping + +> Send ICMP ECHO_REQUEST packets to network hosts. + +- Ping host: + +`ping {{host}}` + +- Ping a host only a specific number of times: + +`ping -c {{count}} {{host}}` + +- Ping host, specifying the interval in seconds between requests (default is 1 second): + +`ping -i {{seconds}} {{host}}` + +- Ping host without trying to lookup symbolic names for addresses: + +`ping -n {{host}}` + +- Ping host and ring the bell when a packet is received (if your terminal supports it): + +`ping -a {{host}}` + +- Also display a message if no response was received: + +`ping -O {{host}}` diff --git a/pages.cn/common/ping6.md b/pages.cn/common/ping6.md new file mode 100644 index 0000000000..26280c9aa4 --- /dev/null +++ b/pages.cn/common/ping6.md @@ -0,0 +1,23 @@ +# ping6 + +> Send ICMP ECHO_REQUEST packets to network hosts via IPv6 address. + +- Ping a host: + +`ping6 {{host}}` + +- Ping a host only a specific number of times: + +`ping6 -c {{count}} {{host}}` + +- Ping a host, specifying the interval in seconds between requests (default is 1 second): + +`ping6 -i {{seconds}} {{host}}` + +- Ping a host without trying to lookup symbolic names for addresses: + +`ping6 -n {{host}}` + +- Ping a host and ring the bell when a packet is received (if your terminal supports it): + +`ping6 -a {{host}}` diff --git a/pages.cn/common/pinky.md b/pages.cn/common/pinky.md new file mode 100644 index 0000000000..6e047f2e3b --- /dev/null +++ b/pages.cn/common/pinky.md @@ -0,0 +1,27 @@ +# pinky + +> Print user information using the `finger` protocol. + +- Display details about the current user: + +`pinky` + +- Display details for a specific user: + +`pinky {{user}}` + +- Display details in the long format: + +`pinky {{user}} -l` + +- Omit the user's home directory and shell in long format: + +`pinky {{user}} -lb` + +- Omit the user's project file in long format: + +`pinky {{user}} -lh` + +- Omit the column headings in short format: + +`pinky {{user}} -f` diff --git a/pages.cn/common/pip.md b/pages.cn/common/pip.md new file mode 100644 index 0000000000..341530c66b --- /dev/null +++ b/pages.cn/common/pip.md @@ -0,0 +1,27 @@ +# pip + +> Python package manager. + +- Install a package: + +`pip install {{package_name}}` + +- Install a specific version of a package: + +`pip install {{package_name}}=={{package_version}}` + +- Upgrade a package: + +`pip install -U {{package_name}}` + +- Uninstall a package: + +`pip uninstall {{package_name}}` + +- Save installed packages to file: + +`pip freeze > {{requirements.txt}}` + +- Install packages from file: + +`pip install -r {{requirements.txt}}` diff --git a/pages.cn/common/pipenv.md b/pages.cn/common/pipenv.md new file mode 100644 index 0000000000..c59e8b36f2 --- /dev/null +++ b/pages.cn/common/pipenv.md @@ -0,0 +1,32 @@ +# pipenv + +> Simple and unified Python development workflow. +> Manages packages and the virtual environment for a project. + +- Create a new project: + +`pipenv` + +- Create a new project using Python 3: + +`pipenv --three` + +- Install a package: + +`pipenv install {{package_name}}` + +- Install all the dependencies for a project (including dev): + +`pipenv install --dev` + +- Uninstall a package: + +`pipenv uninstall {{package_name}}` + +- Start a shell within the created virtual environment: + +`pipenv shell` + +- Generate a requirements.txt for a project: + +`pipenv lock --requirements` diff --git a/pages.cn/common/pkill.md b/pages.cn/common/pkill.md new file mode 100644 index 0000000000..a0d89acaf3 --- /dev/null +++ b/pages.cn/common/pkill.md @@ -0,0 +1,16 @@ +# pkill + +> Signal process by name. +> Mostly used for stopping processes. + +- Kill all processes which match: + +`pkill -9 {{process_name}}` + +- Kill all processes which match their full command instead of just the process name: + +`pkill -9 -f "{{command_name}}"` + +- Send SIGUSR1 signal to processes which match: + +`pkill -USR1 {{process_name}}` diff --git a/pages.cn/common/play.md b/pages.cn/common/play.md new file mode 100644 index 0000000000..316290470d --- /dev/null +++ b/pages.cn/common/play.md @@ -0,0 +1,20 @@ +# play + +> Audio player of SoX - Sound eXchange. +> Plays any audio from the command line, with audio formats identified by the extension. + +- Play the given audio file: + +`play {{audiofile}}` + +- Play the given audio files: + +`play {{audiofile1}} {{audiofile2}}` + +- Play the given audio at twice the speed: + +`play {{audiofile}} speed 2.0` + +- Play the given audio in reverse: + +`play {{audiofile}} reverse` diff --git a/pages.cn/common/pm2.md b/pages.cn/common/pm2.md new file mode 100644 index 0000000000..1fc16e08c2 --- /dev/null +++ b/pages.cn/common/pm2.md @@ -0,0 +1,24 @@ +# pm2 + +> Process manager for Node.js. +> Used for log management, monitoring and configuring processes. + +- Start a process with a name that can be used for later operations: + +`pm2 start {{app.js}} --name {{myapp}}` + +- List processes: + +`pm2 list` + +- Monitor all processes: + +`pm2 monit` + +- Stop a process: + +`pm2 stop {{myapp}}` + +- Restart a process: + +`pm2 restart {{myapp}}` diff --git a/pages.cn/common/pngcrush.md b/pages.cn/common/pngcrush.md new file mode 100644 index 0000000000..4c5db08799 --- /dev/null +++ b/pages.cn/common/pngcrush.md @@ -0,0 +1,15 @@ +# pngcrush + +> PNG image compression utility. + +- Compress a PNG file: + +`pngcrush {{in.png}} {{out.png}}` + +- Compress all PNGs and output to directory: + +`pngcrush -d {{path/to/output}} *.png` + +- Compress PNG file with all 114 available algorithms and pick the best result: + +`pngcrush -rem allb -brute -reduce {{in.png}} {{out.png}}` diff --git a/pages.cn/common/postcss.md b/pages.cn/common/postcss.md new file mode 100644 index 0000000000..0646e3c297 --- /dev/null +++ b/pages.cn/common/postcss.md @@ -0,0 +1,35 @@ +# postcss + +> PostCSS is a tool for transforming styles with JS plugins. + +- Parse and transform a CSS file: + +`postcss {{path/to/file}}` + +- Parse and transform a CSS file and output to a specific file: + +`postcss {{path/to/file}} --output {{path/to/file}}` + +- Parse and transform a CSS file and output to a specific directory: + +`postcss {{path/to/file}} --dir {{path/to/directory}}` + +- Parse and transform a CSS file in-place: + +`postcss {{path/to/file}} --replace` + +- Specify a custom PostCSS parser: + +`postcss {{path/to/file}} --parser {{parser}}` + +- Specify a custom PostCSS syntax: + +`postcss {{path/to/file}} --syntax {{syntax}}` + +- Watch for changes to a CSS file: + +`postcss {{path/to/file}} --watch` + +- Display available options and examples: + +`postcss --help` diff --git a/pages.cn/common/printenv.md b/pages.cn/common/printenv.md new file mode 100644 index 0000000000..9a285321a6 --- /dev/null +++ b/pages.cn/common/printenv.md @@ -0,0 +1,15 @@ +# printenv + +> Print values of all or specific environment variables. + +- Display key-value pairs of all environment variables: + +`printenv` + +- Display the value of a specific variable: + +`printenv {{HOME}}` + +- Display the value of a variable and end with NUL instead of newline: + +`printenv --null {{HOME}}` diff --git a/pages.cn/common/printf.md b/pages.cn/common/printf.md new file mode 100644 index 0000000000..5dd6062e0b --- /dev/null +++ b/pages.cn/common/printf.md @@ -0,0 +1,23 @@ +# printf + +> Format and print text. + +- Print a text message: + +`printf {{"%s\n"}} {{"Hello world"}}` + +- Print an integer in bold blue: + +`printf {{"\e[1;34m%.3d\e[0m\n"}} {{42}}` + +- Print a float number with the unicode Euro sign: + +`printf {{"\u20AC %.2f\n"}} {{123.4}}` + +- Print a text message composed with environment variables: + +`printf {{"var1: %s\tvar2: %s\n"}} {{"$VAR1"}} {{"$VAR2"}}` + +- Store a formatted message in a variable (does not work on zsh): + +`printf -v {{myvar}} {{"This is %s = %d\n" "a year" 2016}}` diff --git a/pages.cn/common/progpilot.md b/pages.cn/common/progpilot.md new file mode 100644 index 0000000000..5b32e4e606 --- /dev/null +++ b/pages.cn/common/progpilot.md @@ -0,0 +1,15 @@ +# progpilot + +> A PHP static analysis tool for detecting security vulnerabilities. + +- Analyse the current directory: + +`progpilot` + +- Analyse a specific file or directory: + +`progpilot {{path/to/file_or_directory}}` + +- Specify a custom configuration file: + +`progpilot --configuration {{path/to/configuration.yml}}` diff --git a/pages.cn/common/prosodyctl.md b/pages.cn/common/prosodyctl.md new file mode 100644 index 0000000000..203ef293b9 --- /dev/null +++ b/pages.cn/common/prosodyctl.md @@ -0,0 +1,23 @@ +# prosodyctl + +> The control tool for the Prosody XMPP server. + +- Show the status of the Prosody server: + +`sudo prosodyctl status` + +- Reload the server's configuration files: + +`sudo prosodyctl reload` + +- Add a user to the Prosody XMPP server: + +`sudo prosodyctl adduser {{user@example.com}}` + +- Set a user's password: + +`sudo prosodyctl passwd {{user@example.com}}` + +- Permanently delete a user: + +`sudo prosodyctl deluser {{user@example.com}}` diff --git a/pages.cn/common/protoc.md b/pages.cn/common/protoc.md new file mode 100644 index 0000000000..441e08516f --- /dev/null +++ b/pages.cn/common/protoc.md @@ -0,0 +1,15 @@ +# protoc + +> Parse Google Protobuf `.proto` files and generate output in the specified language. + +- Generate Python code from a `.proto` file: + +`protoc --python_out={{path/to/output_directory}} {{input_file.proto}}` + +- Generate Java code from a `.proto` file that imports other `.proto` files: + +`protoc --java_out={{path/to/output_directory}} --proto_path={{path/to/import_search_path}} {{input_file.proto}}` + +- Generate code for multiple languages: + +`protoc --csharp_out={{path/to/c#_output_directory}} --js_out={{path/to/js_output_directory}} {{input_file.proto}}` diff --git a/pages.cn/common/ps.md b/pages.cn/common/ps.md new file mode 100644 index 0000000000..c5949a6208 --- /dev/null +++ b/pages.cn/common/ps.md @@ -0,0 +1,27 @@ +# ps + +> Information about running processes. + +- List all running processes: + +`ps aux` + +- List all running processes including the full command string: + +`ps auxww` + +- Search for a process that matches a string: + +`ps aux | grep {{string}}` + +- List all processes of the current user in extra full format: + +`ps --user $(id -u) -F` + +- List all processes of the current user as a tree: + +`ps --user $(id -u) f` + +- Get the parent pid of a process: + +`ps -o ppid= -p {{pid}}` diff --git a/pages.cn/common/psgrep.md b/pages.cn/common/psgrep.md new file mode 100644 index 0000000000..cc02688adc --- /dev/null +++ b/pages.cn/common/psgrep.md @@ -0,0 +1,15 @@ +# psgrep + +> Search through processes with grep. + +- Find process lines containing a specific string: + +`psgrep {{process_name}}` + +- Find process lines containing a specific string, do not include headers: + +`psgrep -n {{process_name}}` + +- Search using simplified format (PID, user, command): + +`psgrep -s {{process_name}}` diff --git a/pages.cn/common/psql.md b/pages.cn/common/psql.md new file mode 100644 index 0000000000..3996c11f16 --- /dev/null +++ b/pages.cn/common/psql.md @@ -0,0 +1,23 @@ +# psql + +> PostgreSQL command-line client. + +- Connect to database. It connects to localhost using default port 5432 with default user as currently logged in user: + +`psql {{database}}` + +- Connect to database on given server host running on given port with given username, without a password prompt: + +`psql -h {{host}} -p {{port}} -U {{username}} {{database}}` + +- Connect to database; user will be prompted for password: + +`psql -h {{host}} -p {{port}} -U {{username}} -W {{database}}` + +- Execute a single SQL query or PostgreSQL command on the given database (useful in shell scripts): + +`psql -c '{{query}}' {{database}}` + +- Execute commands from a file on the given database: + +`psql {{database}} -f {{file.sql}}` diff --git a/pages.cn/common/pssh.md b/pages.cn/common/pssh.md new file mode 100644 index 0000000000..76c08313a2 --- /dev/null +++ b/pages.cn/common/pssh.md @@ -0,0 +1,27 @@ +# pssh + +> Parallel SSH program. + +- Run a command on two hosts, and print its output on each server inline: + +`pssh -i -H "{{host1}} {{host2}}" {{hostname -i}}` + +- Run a command and save the output to separate files: + +`pssh -H {{host1}} -H {{host2}} -o {{path/to/output_dir}} {{hostname -i}}` + +- Run a command on multiple hosts, specified in a new-line separated file: + +`pssh -i -h {{path/to/hosts_file}} {{hostname -i}}` + +- Run a command as root (this asks for the root password): + +`pssh -i -h {{path/to/hosts_file}} -A -l {{root_username}} {{hostname -i}}` + +- Run a command with extra SSH arguments: + +`pssh -i -h {{path/to/hosts_file}} -x "{{-O VisualHostKey=yes}}" {{hostname -i}}` + +- Run a command limiting the number of parallel connections to 10: + +`pssh -i -h {{path/to/hosts_file}} -p {{10}} '{{cd dir; ./script.sh; exit}}'` diff --git a/pages.cn/common/pt.md b/pages.cn/common/pt.md new file mode 100644 index 0000000000..0fa1510891 --- /dev/null +++ b/pages.cn/common/pt.md @@ -0,0 +1,24 @@ +# pt + +> Platinum Searcher. +> A code search tool similar to `ag`. + +- Find files containing "foo" and print the files with highlighted matches: + +`pt {{foo}}` + +- Find files containing "foo" and display count of matches in each file: + +`pt -c {{foo}}` + +- Find files containing "foo" as a whole word and ignore its case: + +`pt -wi {{foo}}` + +- Find "foo" in files with a given extension using a regular expression: + +`pt -G='{{\.bar$}}' {{foo}}` + +- Find files whose contents match the regular expression, up to 2 folders deep: + +`pt --depth={{2}} -e '{{^ba[rz]*$}}'` diff --git a/pages.cn/common/pup.md b/pages.cn/common/pup.md new file mode 100644 index 0000000000..4b32e85e72 --- /dev/null +++ b/pages.cn/common/pup.md @@ -0,0 +1,27 @@ +# pup + +> Command line HTML parsing tool. + +- Transform a raw HTML file into a cleaned, indented, and colored format: + +`cat {{index.html}} | pup --color` + +- Filter HTML by element tag name: + +`cat {{index.html}} | pup '{{tag}}'` + +- Filter HTML by id: + +`cat {{index.html}} | pup '{{div#id}}'` + +- Filter HTML by attribute value: + +`cat {{index.html}} | pup '{{input[type="text"]}}'` + +- Print all text from the filtered HTML elements and their children: + +`cat {{index.html}} | pup '{{div}} text{}'` + +- Print HTML as JSON: + +`cat {{index.html}} | pup '{{div}} json{}'` diff --git a/pages.cn/common/pv.md b/pages.cn/common/pv.md new file mode 100644 index 0000000000..3705bd6837 --- /dev/null +++ b/pages.cn/common/pv.md @@ -0,0 +1,27 @@ +# pv + +> Monitor the progress of data through a pipe. + +- Print the contents of the file and display a progress bar: + +`pv {{file}}` + +- Measure the speed and amount of data flow between pipes (`-s` is optional): + +`command1 | pv -s {{expected_amount_of_data_for_eta}} | command2` + +- Filter a file, see both progress and amount of output data: + +`pv -cN in {{big_text_file}} | grep {{pattern}} | pv -cN out > {{filtered_file}}` + +- Attach to an already running process and see its file reading progress: + +`pv -d {{PID}}` + +- Read an erroneous file, skip errors as `dd conv=sync,noerror` would: + +`pv -EE {{path/to/faulty_media}} > image.img` + +- Stop reading after reading specified amount of data, rate limit to 1K/s: + +`pv -L 1K -S {{maximum_file_size_to_be_read}}` diff --git a/pages.cn/common/pwd.md b/pages.cn/common/pwd.md new file mode 100644 index 0000000000..5c9af42f89 --- /dev/null +++ b/pages.cn/common/pwd.md @@ -0,0 +1,11 @@ +# pwd + +> Print name of current/working directory. + +- Print the current directory: + +`pwd` + +- Print the current directory, and resolve all symlinks (i.e. show the "physical" path): + +`pwd -P` diff --git a/pages.cn/common/pycodestyle.md b/pages.cn/common/pycodestyle.md new file mode 100644 index 0000000000..74477ae152 --- /dev/null +++ b/pages.cn/common/pycodestyle.md @@ -0,0 +1,23 @@ +# pycodestyle + +> A tool to check Python code against PEP 8 style conventions. + +- Check the style of a single file: + +`pycodestyle {{file.py}}` + +- Check the style of multiple files: + +`pycodestyle {{file1.py}} {{file2.py}} {{file3.py}}` + +- Show only the first occurrence of an error: + +`pycodestyle --first {{file.py}}` + +- Show the source code for each error: + +`pycodestyle --show-source {{file.py}}` + +- Show the specific PEP 8 text for each error: + +`pycodestyle --show-pep8 {{file.py}}` diff --git a/pages.cn/common/pyenv-virtualenv.md b/pages.cn/common/pyenv-virtualenv.md new file mode 100644 index 0000000000..461787f765 --- /dev/null +++ b/pages.cn/common/pyenv-virtualenv.md @@ -0,0 +1,11 @@ +# pyenv virtualenv + +> Create virtual environments based on one's installed Python distributions. + +- Create a new Python 3.6.6 virtual environment: + +`pyenv virtualenv {{3.6.6}} {{my-virtual-env-3.6.6}}` + +- List all existing virtual environments: + +`pyenv virtualenvs` diff --git a/pages.cn/common/pyenv.md b/pages.cn/common/pyenv.md new file mode 100644 index 0000000000..5aa0e54b19 --- /dev/null +++ b/pages.cn/common/pyenv.md @@ -0,0 +1,27 @@ +# pyenv + +> Switch between multiple versions of Python easily. + +- List all available commands: + +`pyenv commands` + +- List all Python versions under the ${PYENV_ROOT}/versions directory: + +`pyenv versions` + +- Install a Python version under the ${PYENV_ROOT}/versions directory: + +`pyenv install {{2.7.10}}` + +- Uninstall a Python version under the ${PYENV_ROOT}/versions directory: + +`pyenv uninstall {{2.7.10}}` + +- Set Python version to be used globally in the current machine: + +`pyenv global {{2.7.10}}` + +- Set Python version to be used in the current directory and all directories below it: + +`pyenv local {{2.7.10}}` diff --git a/pages.cn/common/pyflakes.md b/pages.cn/common/pyflakes.md new file mode 100644 index 0000000000..a0b92fe1f0 --- /dev/null +++ b/pages.cn/common/pyflakes.md @@ -0,0 +1,19 @@ +# pyflakes + +> Checks Python source code files for errors. + +- Check a single Python file: + +`pyflakes check {{path/to/file}}.py` + +- Check Python files in a specific directory: + +`pyflakes checkPath {{path/to/directory}}` + +- Check Python files in a directory recursively: + +`pyflakes checkRecursive {{path/to/directory}}` + +- Check all Python files found in multiple directories: + +`pyflakes iterSourceCode {{path/to/directory_1}} {{path/to/directory_2}}` diff --git a/pages.cn/common/pygmentize.md b/pages.cn/common/pygmentize.md new file mode 100644 index 0000000000..e239a8ba7d --- /dev/null +++ b/pages.cn/common/pygmentize.md @@ -0,0 +1,27 @@ +# pygmentize + +> Python-based syntax highlighter. + +- Highlight file syntax and print to standard output (language is inferred from the file extension): + +`pygmentize {{file.py}}` + +- Explicitly set the language for syntax highlighting: + +`pygmentize -l {{javascript}} {{input_file}}` + +- List available lexers (processors for input languages): + +`pygmentize -L lexers` + +- Save output to a file in HTML format: + +`pygmentize -f html -o {{output_file.html}} {{input_file.py}}` + +- List available output formats: + +`pygmentize -L formatters` + +- Output an HTML file, with additional formatter options (full page, with line numbers): + +`pygmentize -f html -O "full,linenos=True" -o {{output_file.html}} {{input_file}}` diff --git a/pages.cn/common/python.md b/pages.cn/common/python.md new file mode 100644 index 0000000000..7260a9d87a --- /dev/null +++ b/pages.cn/common/python.md @@ -0,0 +1,27 @@ +# python + +> Python language interpreter. + +- Call a Python interactive shell (REPL): + +`python` + +- Execute script in a given Python file: + +`python {{script.py}}` + +- Execute script as part of an interactive shell: + +`python -i {{script.py}}` + +- Execute a Python expression: + +`python -c "{{expression}}"` + +- Run library module as a script (terminates option list): + +`python -m {{module}} {{arguments}}` + +- Interactively debug a Python script: + +`python -m pdb {{script.py}}` diff --git a/pages.cn/common/q.md b/pages.cn/common/q.md new file mode 100644 index 0000000000..5124db5cf1 --- /dev/null +++ b/pages.cn/common/q.md @@ -0,0 +1,27 @@ +# q + +> Execute SQL-like queries on .csv and .tsv files. + +- Query .csv file by specifying the delimiter as ',': + +`q -d',' "SELECT * from {{path/to/file}}"` + +- Query .tsv file: + +`q -t "SELECT * from {{path/to/file}}"` + +- Query file with header row: + +`q -d{{delimiter}} -H "SELECT * from {{path/to/file}}"` + +- Read data from stdin; '-' in the query represents the data from stdin: + +`{{output}} | q "select * from -"` + +- Join two files (aliased as `f1` and `f2` in the example) on column `c1`, a common column: + +`q "SELECT * FROM {{path/to/file}} f1 JOIN {{path/to/other_file}} f2 ON (f1.c1 = f2.c1)"` + +- Format output using an output delimiter with an output header line (note: command will output column names based on the input file header or the column aliases overridden in the query): + +`q -D{{delimiter}} -O "SELECT {{column}} as {{alias}} from {{path/to/file}}"` diff --git a/pages.cn/common/qemu-img.md b/pages.cn/common/qemu-img.md new file mode 100644 index 0000000000..c4301a0b36 --- /dev/null +++ b/pages.cn/common/qemu-img.md @@ -0,0 +1,19 @@ +# qemu-img + +> Tool for Quick Emulator Virtual HDD image creation and manipulation. + +- Create disk image with a specific size (in gigabytes): + +`qemu-img create {{image_name.img}} {{gigabites}}G` + +- Show information about a disk image: + +`qemu-img info {{image_name.img}}` + +- Increase or decrease image size: + +`qemu-img resize {{image_name.img}} {{gigabites}}G` + +- Dump the allocation state of every sector of the specified disk image: + +`qemu-img map {{image_name.img}}` diff --git a/pages.cn/common/qemu.md b/pages.cn/common/qemu.md new file mode 100644 index 0000000000..3d1ce3088e --- /dev/null +++ b/pages.cn/common/qemu.md @@ -0,0 +1,24 @@ +# qemu + +> Generic machine emulator and virtualizer. +> Supports a large variety of CPU architectures. + +- Boot from image emulating i386 architecture: + +`qemu-system-i386 -hda {{image_name.img}}` + +- Boot from image emulating x64 architecture: + +`qemu-system-x86_64 -hda {{image_name.img}}` + +- Boot QEMU instance with a live ISO image: + +`qemu-system-i386 -hda {{image_name.img}} -cdrom {{os_image.iso}} -boot d` + +- Specify amount of RAM for instance: + +`qemu-system-i386 -m 256 -hda image_name.img -cdrom os-image.iso -boot d` + +- Boot from physical device (e.g. from USB to test bootable medium): + +`qemu-system-i386 -hda /dev/{{storage_device}}` diff --git a/pages.cn/common/qpdf.md b/pages.cn/common/qpdf.md new file mode 100644 index 0000000000..244017509a --- /dev/null +++ b/pages.cn/common/qpdf.md @@ -0,0 +1,23 @@ +# qpdf + +> Versatile PDF transformation software. + +- Extract pages 1-3, 5 and 6-10 from a PDF file and save them as another one: + +`qpdf --empty --pages {{input.pdf}} {{1-3,5,6-10}} -- {{output.pdf}}` + +- Merge (concatenate) a list of PDF files and save the result as another one: + +`qpdf --empty --pages {{file1.pdf}} {{1,6-8}} --pages {{file2.pdf}} {{3,4,5}} -- {{output.pdf}}` + +- Write each group of n pages to a separate output file with a given filename pattern: + +`qpdf --split-pages=n {{input.pdf}} {{out_%d.pdf}}` + +- Rotate certain pages of a pdf with a given angle: + +`qpdf --rotate={{90:2,4,6}} --rotate={{180:7-8}} {{input.pdf}} {{output.pdf}}` + +- Remove the password from a password protected file: + +`qpdf --password={{password}} --decrypt {{input.pdf}} {{output.pdf}}` diff --git a/pages.cn/common/quota.md b/pages.cn/common/quota.md new file mode 100644 index 0000000000..aabc4d32e9 --- /dev/null +++ b/pages.cn/common/quota.md @@ -0,0 +1,23 @@ +# quota + +> Display users' disk space usage and allocated limits. + +- Show disk quotas in human readable units for the current user: + +`quota -s` + +- Verbose output (also display quotas on filesystems where no storage is allocated): + +`quota -v` + +- Quiet output (only display quotas on filesystems where usage is over quota): + +`quota -q` + +- Print quotas for the groups of which the current user is a member: + +`quota -g` + +- Show disk quotas for another user: + +`sudo quota -u {{username}}` diff --git a/pages.cn/common/r.md b/pages.cn/common/r.md new file mode 100644 index 0000000000..8a1896a636 --- /dev/null +++ b/pages.cn/common/r.md @@ -0,0 +1,15 @@ +# r + +> R language interpreter. + +- Start an R interactive shell (REPL): + +`R` + +- Check R version: + +`R --version` + +- Execute a file: + +`R -f {{file.R}}` diff --git a/pages.cn/common/rabin2.md b/pages.cn/common/rabin2.md new file mode 100644 index 0000000000..4dfe1e0487 --- /dev/null +++ b/pages.cn/common/rabin2.md @@ -0,0 +1,24 @@ +# rabin2 + +> Get information about binary files (ELF, PE, Java CLASS, Mach-O) - symbols, sections, linked libraries, etc. +> Comes bundled with `radare2`. + +- Display general information about a binary (architecture, type, endianness): + +`rabin2 -I {{path/to/binary}}` + +- Display linked libraries: + +`rabin2 -l {{path/to/binary}}` + +- Display symbols imported from libraries: + +`rabin2 -i {{path/to/binary}}` + +- Display strings contained in the binary: + +`rabin2 -z {{path/to/binary}}` + +- Display the output in JSON: + +`rabin2 -j -I {{path/to/binary}}` diff --git a/pages.cn/common/rails.md b/pages.cn/common/rails.md new file mode 100644 index 0000000000..9b21d90f34 --- /dev/null +++ b/pages.cn/common/rails.md @@ -0,0 +1,23 @@ +# rails + +> A server-side MVC framework written in Ruby. + +- Create a new rails project: + +`rails new "{{project_name}}"` + +- Start local server for current project on port 3000: + +`rails server` + +- Start local server for current project on a specified port: + +`rails server -p "{{port}}"` + +- Open console to interact with application from command line: + +`rails console` + +- Check current version of rails: + +`rails --version` diff --git a/pages.cn/common/rainbowstream.md b/pages.cn/common/rainbowstream.md new file mode 100644 index 0000000000..80ce6c5211 --- /dev/null +++ b/pages.cn/common/rainbowstream.md @@ -0,0 +1,32 @@ +# rainbowstream + +> Terminal-based Twitter client supporting realtime tweetstream, trends, sending, search, favorites and user management. +> Online help with `h`, up and down arrows for history, tab to auto-complete and 2-tab for suggestion. + +- Open rainbowstream: + +`rainbowstream` + +- Show your timeline (optional number of tweets to display, default is 5): + +`home [{{num_of_last_tweets}}]` + +- Show profile of a given user: + +`whois @{{user}}` + +- Tweet the message as-is: + +`t {{message}}` + +- Retweet the tweet with given id (id is beside the time): + +`rt {{tweet_id}}` + +- Favorite the tweet with given id: + +`fav {{tweet_id}}` + +- Perform a search for a given word (with or without hashtag): + +`s {{word}}` diff --git a/pages.cn/common/rbash.md b/pages.cn/common/rbash.md new file mode 100644 index 0000000000..b4b1c2fc8d --- /dev/null +++ b/pages.cn/common/rbash.md @@ -0,0 +1,20 @@ +# rbash + +> Restricted Bash shell. +> Similar to the `bash` shell with some restrictions like changing directories with `cd`, setting/unsetting of PATH, ENV variables and others. + +- Start rbash: + +`rbash` + +- Execute a command: + +`rbash -c "{{command}}"` + +- Run commands from a file: + +`rbash {{file.sh}}` + +- Print the version information of rbash: + +`rbash --version` diff --git a/pages.cn/common/rbenv.md b/pages.cn/common/rbenv.md new file mode 100644 index 0000000000..abda059154 --- /dev/null +++ b/pages.cn/common/rbenv.md @@ -0,0 +1,31 @@ +# rbenv + +> A tool to easily install Ruby versions and manage application environments. + +- Install one or more space-separated versions of Ruby: + +`rbenv install {{version(s)}}` + +- Display a list of installed versions: + +`rbenv versions` + +- Use a specific version of Ruby across the whole system: + +`rbenv global {{version}}` + +- Use a specific version of Ruby for an application/project folder: + +`rbenv local {{version}}` + +- Show the currently selected Ruby version: + +`rbenv version` + +- Uninstall a version of Ruby: + +`rbenv uninstall {{version}}` + +- Display all ruby versions that contain the specified executable: + +`rbenv whence {{executable}}` diff --git a/pages.cn/common/rdfind.md b/pages.cn/common/rdfind.md new file mode 100644 index 0000000000..b5ca66f419 --- /dev/null +++ b/pages.cn/common/rdfind.md @@ -0,0 +1,19 @@ +# rdfind + +> Find files with duplicate content and get rid of them. + +- Identify all duplicates in a given directory and output a summary: + +`rdfind -dryrun true {{path/to/directory}}` + +- Replace all duplicates with hardlinks: + +`rdfind -makehardlinks true {{path/to/directory}}` + +- Replace all duplicates with symlinks/soft links: + +`rdfind -makesymlinks true {{path/to/directory}}` + +- Delete all duplicates and do not ignore empty files: + +`rdfind -deleteduplicates true -ignoreempty false {{path/to/directory}}` diff --git a/pages.cn/common/read.md b/pages.cn/common/read.md new file mode 100644 index 0000000000..abd53d421e --- /dev/null +++ b/pages.cn/common/read.md @@ -0,0 +1,27 @@ +# read + +> BASH builtin for retrieving data from standard input. + +- Store data that you type from the keyboard: + +`read {{variable}}` + +- Store each of the next lines you enter as values of an array: + +`read -a {{array}}` + +- Enable backspace and GNU readline hotkeys when entering input with read: + +`read -e {{variable}}` + +- Specify the number of maximum characters to be read: + +`read -n {{character_count}} {{variable}}` + +- Use a specific character as a delimiter instead of a new line: + +`read -d {{new_delimiter}} {{variable}}` + +- Do not let backslash (\) act as an escape character: + +`read -r {{variable}}` diff --git a/pages.cn/common/readlink.md b/pages.cn/common/readlink.md new file mode 100644 index 0000000000..865e64f77d --- /dev/null +++ b/pages.cn/common/readlink.md @@ -0,0 +1,11 @@ +# readlink + +> Follow symlinks and get symlink information. + +- Get the actual file to which the symlink points: + +`readlink {{filename}}` + +- Get the absolute path to a file: + +`readlink -f {{filename}}` diff --git a/pages.cn/common/realpath.md b/pages.cn/common/realpath.md new file mode 100644 index 0000000000..1b994877fd --- /dev/null +++ b/pages.cn/common/realpath.md @@ -0,0 +1,23 @@ +# realpath + +> Display the resolved absolute path for a file or directory. + +- Display the absolute path for a file or directory: + +`realpath {{path/to/file_or_directory}}` + +- Require all path components to exist: + +`realpath --canonicalize-existing {{path/to/file_or_directory}}` + +- Resolve ".." components before symlinks: + +`realpath --logical {{path/to/file_or_directory}}` + +- Disable symlink expansion: + +`realpath --no-symlinks {{path/to/file_or_directory}}` + +- Suppress error messages: + +`realpath --quiet {{path/to/file_or_directory}}` diff --git a/pages.cn/common/redis-cli.md b/pages.cn/common/redis-cli.md new file mode 100644 index 0000000000..2e0c0ad529 --- /dev/null +++ b/pages.cn/common/redis-cli.md @@ -0,0 +1,23 @@ +# redis-cli + +> Opens a connection to a Redis server. + +- Connect to the local server: + +`redis-cli` + +- Connect to a remote server on the default port (6379): + +`redis-cli -h {{host}}` + +- Connect to a remote server specifying a port number: + +`redis-cli -h {{host}} -p {{port}}` + +- Specify a password: + +`redis-cli -a {{password}}` + +- Execute Redis command: + +`redis-cli {{redis_command}}` diff --git a/pages.cn/common/redshift.md b/pages.cn/common/redshift.md new file mode 100644 index 0000000000..f2079a629f --- /dev/null +++ b/pages.cn/common/redshift.md @@ -0,0 +1,23 @@ +# redshift + +> Adjust the color temperature of your screen according to your surroundings. + +- Turn on Redshift with 5700K temperature during day and 3600K at night: + +`redshift -t {{5700}}:{{3600}}` + +- Turn on Redshift with a manually-specified custom location: + +`redshift -l {{latitude}}:{{longitude}}` + +- Turn on Redshift with 70% screen brightness during day and 40% brightness at night: + +`redshift -b {{0.7}}:{{0.4}}` + +- Turn on Redshift with custom gamma levels (between 0 and 1): + +`redshift -g {{red}}:{{green}}:{{blue}}` + +- Turn on Redshift with a constant unchanging color temperature: + +`redshift -O {{temperature}}` diff --git a/pages.cn/common/rename.md b/pages.cn/common/rename.md new file mode 100644 index 0000000000..041e4ee9ea --- /dev/null +++ b/pages.cn/common/rename.md @@ -0,0 +1,23 @@ +# rename + +> Renames multiple files. + +- Rename files using a Perl Common Regular Expression (substitute 'foo' with 'bar' wherever found): + +`rename {{'s/foo/bar/'}} {{\*}}` + +- Dry-run - display which renames would occur without performing them: + +`rename -n {{'s/foo/bar/'}} {{\*}}` + +- Force renaming even if the operation would overwrite existing files: + +`rename -f {{'s/foo/bar/'}} {{\*}}` + +- Convert filenames to lower case (use `-f` in case-insensitive filesystems to prevent "already exists" errors): + +`rename 'y/A-Z/a-z/' {{\*}}` + +- Replace whitespace with underscores: + +`rename 's/\s+/_/g' {{\*}}` diff --git a/pages.cn/common/renice.md b/pages.cn/common/renice.md new file mode 100644 index 0000000000..3977bb0512 --- /dev/null +++ b/pages.cn/common/renice.md @@ -0,0 +1,15 @@ +# renice + +> Alters the scheduling priority/nicenesses of one or more running processes. Niceness values range from -20 (most favorable to the process) to 19 (least favorable to the process). + +- Change priority of a running process: + +`renice -n {{niceness_value}} -p {{pid}}` + +- Change priority of all processes owned by a user: + +`renice -n {{niceness_value}} -u {{user}}` + +- Change priority of all processes that belong to a process group: + +`renice -n {{niceness_value}} --pgrp {{process_group}}` diff --git a/pages.cn/common/repren.md b/pages.cn/common/repren.md new file mode 100644 index 0000000000..06a902a4f3 --- /dev/null +++ b/pages.cn/common/repren.md @@ -0,0 +1,23 @@ +# repren + +> Multi-pattern string replacement and file renaming tool. + +- Do a dry-run renaming a folder of pngs with a literal string replacement: + +`repren --dry-run --rename --literal --from '{{find_string}}' --to '{{replacement_string}}' {{*.png}}` + +- Do a dry-run renaming a folder of jpegs with a regular expression: + +`repren --rename --dry-run --from '{{regular_expression}}' --to '{{replacement_string}}' {{*.jpg}} {{*.jpeg}}` + +- Do a find-and-replace on the contents of a folder of csv files: + +`repren --from '{{([0-9]+) example_string}}' --to '{{replacement_string \1}}' {{*.csv}}` + +- Do both a find-and-replace and a rename operation at the same time, using a pattern file: + +`repren --patterns {{path/to/patfile.ext}} --full {{*.txt}}` + +- Do a case-insensitive rename: + +`repren --rename --insensitive --patterns {{path/to/patfile.ext}} *` diff --git a/pages.cn/common/restic.md b/pages.cn/common/restic.md new file mode 100644 index 0000000000..75b42d4542 --- /dev/null +++ b/pages.cn/common/restic.md @@ -0,0 +1,27 @@ +# restic + +> Fast, secure, efficient backup program. + +- Initialize a backup repository in the specified local directory: + +`restic init -r {{path/to/repository}}` + +- Backup folder "my_folder" to the repository: + +`restic -r {{path/to/repository}} backup {{path/to/my_folder}}` + +- Show backup snapshots currently stored in the repository: + +`restic -r {{path/to/repository}} snapshots` + +- Restore a specific backup snapshot to a target directory: + +`restic -r {{path/to/repository}} restore {{snapshot_id}} {{path/to/target}}` + +- Restore a specific path from a specific backup to a target directory: + +`restic -r {{path/to/repository}} --include {{path/to/restore}} --target {{path/to/target}} restore {{snapshot_id}}` + +- Clean up the repository and keep only the most recent snapshot of each unique backup: + +`restic forget --keep-last 1 --prune` diff --git a/pages.cn/common/rev.md b/pages.cn/common/rev.md new file mode 100644 index 0000000000..fac7ada714 --- /dev/null +++ b/pages.cn/common/rev.md @@ -0,0 +1,11 @@ +# rev + +> Reverse a line of text. + +- Reverse the text string "hello": + +`echo "hello" | rev` + +- Reverse an entire file and print to stdout: + +`rev {{file}}` diff --git a/pages.cn/common/rg.md b/pages.cn/common/rg.md new file mode 100644 index 0000000000..f713177cbf --- /dev/null +++ b/pages.cn/common/rg.md @@ -0,0 +1,31 @@ +# ripgrep + +> A fast command-line search tool. + +- Recursively search the current directory for a regex pattern: + +`rg {{pattern}}` + +- Search for pattern including all .gitignored and hidden files: + +`rg -uu {{pattern}}` + +- Search for a pattern only in a certain filetype (e.g., html, css, etc.): + +`rg -t {{filetype}} {{pattern}}` + +- Search for a pattern only in a subset of directories: + +`rg {{pattern}} {{set_of_subdirs}}` + +- Search for a pattern in files matching a glob (e.g., `README.*`): + +`rg {{pattern}} -g {{glob}}` + +- Only list matched files -- useful when piping to other commands: + +`rg --files-with-matches {{pattern}}` + +- Show lines that do not match the given pattern: + +`rg --invert-match {{pattern}}` diff --git a/pages.cn/common/rm.md b/pages.cn/common/rm.md new file mode 100644 index 0000000000..5c4496299e --- /dev/null +++ b/pages.cn/common/rm.md @@ -0,0 +1,23 @@ +# rm + +> Remove files or directories. + +- Remove files from arbitrary locations: + +`rm {{path/to/file}} {{path/to/another/file}}` + +- Recursively remove a directory and all its subdirectories: + +`rm -r {{path/to/folder}}` + +- Forcibly remove a directory, without prompting for confirmation or showing error messages: + +`rm -rf {{path/to/folder}}` + +- Interactively remove multiple files, with a prompt before every removal: + +`rm -i {{file(s)}}` + +- Remove files in verbose mode, printing a message for each removed file: + +`rm -v {{path/to/folder/*}}` diff --git a/pages.cn/common/rmdir.md b/pages.cn/common/rmdir.md new file mode 100644 index 0000000000..eb11ad2ebf --- /dev/null +++ b/pages.cn/common/rmdir.md @@ -0,0 +1,11 @@ +# rmdir + +> Removes a directory. + +- Remove directory, provided it is empty. Use `rm` to remove not empty directories: + +`rmdir {{path/to/directory}}` + +- Remove directories recursively (useful for nested dirs): + +`rmdir -p {{path/to/directory}}` diff --git a/pages.cn/common/roll.md b/pages.cn/common/roll.md new file mode 100644 index 0000000000..74cbb007f9 --- /dev/null +++ b/pages.cn/common/roll.md @@ -0,0 +1,27 @@ +# roll + +> Rolls a user-defined dice sequence. + +- Roll 3 6-sided dice and sums the results: + +`roll {{3d}}` + +- Roll 1 8-sided die, add 3 and sum the results: + +`roll {{d8 + 3}}` + +- Roll 4 6-sided dice, keep the 3 highest results and sum the results: + +`roll {{4d6h3}}` + +- Roll 2 12-sided dice 2 times and show every roll: + +`roll --verbose {{2{2d12}}}` + +- Roll 2 20-sided dice until the result is bigger than 10: + +`roll "{{2d20>10}}"` + +- Roll 2 5-sided dice 3 times and show the total sum: + +`roll --sum-series {{3{2d5}}}` diff --git a/pages.cn/common/route.md b/pages.cn/common/route.md new file mode 100644 index 0000000000..f2f3e928f0 --- /dev/null +++ b/pages.cn/common/route.md @@ -0,0 +1,15 @@ +# route + +> Use route cmd to set the route table . + +- Display the information of route table: + +`route -n` + +- Add route rule: + +`sudo route add -net {{ip_address}} netmask {{netmask_address}} gw {{gw_address}}` + +- Delete route rule: + +`sudo route del -net {{ip_address}} netmask {{netmask_address}} dev {{gw_address}}` diff --git a/pages.cn/common/rsstail.md b/pages.cn/common/rsstail.md new file mode 100644 index 0000000000..6b44563eb4 --- /dev/null +++ b/pages.cn/common/rsstail.md @@ -0,0 +1,23 @@ +# rsstail + +> `tail` for RSS feeds. + +- Show the feed of a given url and wait for new entries appearing at the bottom: + +`rsstail -u {{url}}` + +- Show the feed in reverse chronological order (newer at the bottom): + +`rsstail -r -u {{url}}` + +- Include publication date and link: + +`rsstail -pl -u {{url}}` + +- Set update interval: + +`rsstail -u {{url}} -i {{interval_in_seconds}}` + +- Show feed and exit: + +`rsstail -1 -u {{url}}` diff --git a/pages.cn/common/rsync.md b/pages.cn/common/rsync.md new file mode 100644 index 0000000000..2b35a27821 --- /dev/null +++ b/pages.cn/common/rsync.md @@ -0,0 +1,32 @@ +# rsync + +> Transfer files either to or from a remote host (not between two remote hosts). +> Can transfer single files, or multiple files matching a pattern. + +- Transfer file from local to remote host: + +`rsync {{path/to/file}} {{remote_host_name}}:{{remote_host_location}}` + +- Transfer file from remote host to local: + +`rsync {{remote_host_name}}:{{remote_file_location}} {{local_file_location}}` + +- Transfer file in archive (to preserve attributes) and compressed (zipped) mode with verbose and human-readable progress: + +`rsync -azvhP {{path/to/file}} {{remote_host_name}}:{{remote_host_location}}` + +- Transfer a directory and all its children from a remote to local: + +`rsync -r {{remote_host_name}}:{{remote_folder_location}} {{local_folder_location}}` + +- Transfer only updated files from remote host: + +`rsync -ru {{remote_host_name}}:{{remote_folder_location}} {{local_folder_location}}` + +- Transfer file over SSH and delete local files that do not exist on remote host: + +`rsync -e ssh --delete {{remote_host_name}}:{{remote_file}} {{local_file}}` + +- Transfer file over SSH and show global progress: + +`rsync -e ssh --info=progress2 {{remote_host_name}}:{{remote_file}} {{local_file}}` diff --git a/pages.cn/common/rtv.md b/pages.cn/common/rtv.md new file mode 100644 index 0000000000..458568ea98 --- /dev/null +++ b/pages.cn/common/rtv.md @@ -0,0 +1,28 @@ +# rtv + +> Reddit Terminal Viewer. +> Use arrow keys to navigate. Right and Left to view and return from a submission, respectively. + +- Open the front page: + +`/front` + +- Open a subreddit: + +`/r/{{subreddit_name}}` + +- Expand/collapse comments: + +`[space]` + +- Open link: + +`o` + +- Login: + +`u` + +- Open the help screen: + +`?` diff --git a/pages.cn/common/ruby.md b/pages.cn/common/ruby.md new file mode 100644 index 0000000000..7f8389eca1 --- /dev/null +++ b/pages.cn/common/ruby.md @@ -0,0 +1,23 @@ +# ruby + +> Ruby programming language interpreter. + +- Open an Interactive Ruby Shell (REPL): + +`irb` + +- Execute a Ruby script: + +`ruby {{script.rb}}` + +- Execute a single Ruby command in the command line: + +`ruby -e {{command}}` + +- Check for syntax errors on a given Ruby script: + +`ruby -c {{script.rb}}` + +- Show the version of Ruby you are using: + +`ruby -v` diff --git a/pages.cn/common/rustc.md b/pages.cn/common/rustc.md new file mode 100644 index 0000000000..6e7e3ca6f6 --- /dev/null +++ b/pages.cn/common/rustc.md @@ -0,0 +1,16 @@ +# rustc + +> The Rust compiler. +> Processes, compiles and links Rust language source files. + +- Compile a single file: + +`rustc {{file.rs}}` + +- Compile with high optimization: + +`rustc -O {{file.rs}}` + +- Compile with debugging information: + +`rustc -g {{file.rs}}` diff --git a/pages.cn/common/rustfmt.md b/pages.cn/common/rustfmt.md new file mode 100644 index 0000000000..0226eadf71 --- /dev/null +++ b/pages.cn/common/rustfmt.md @@ -0,0 +1,15 @@ +# rustfmt + +> Tool for formatting Rust source code. + +- Format a file, overwriting the original file in-place: + +`rustfmt {{source.rs}}` + +- Check a file for formatting and display any changes on the console: + +`rustfmt --check {{source.rs}}` + +- Backup any modified files before formatting (the original file is renamed with a `.bk` extension): + +`rustfmt --backup {{source.rs}}` diff --git a/pages.cn/common/rustup.md b/pages.cn/common/rustup.md new file mode 100644 index 0000000000..95a904ce21 --- /dev/null +++ b/pages.cn/common/rustup.md @@ -0,0 +1,28 @@ +# rustup + +> Rust toolchain installer. +> Install, manage, and update Rust toolchains. + +- Install the nightly toolchain for your system: + +`rustup install nightly` + +- Switch the default toolchain to nightly so that the `cargo` and `rustc` commands will use it: + +`rustup default nightly` + +- Use the nightly toolchain when inside the current project, but leave global settings unchanged: + +`rustup override set nightly` + +- Update all toolchains: + +`rustup update` + +- List installed toolchains: + +`rustup show` + +- Run cargo build with a certain toolchain: + +`rustup run {{toolchain_name}} cargo build` diff --git a/pages.cn/common/rvm.md b/pages.cn/common/rvm.md new file mode 100644 index 0000000000..61b2592b76 --- /dev/null +++ b/pages.cn/common/rvm.md @@ -0,0 +1,31 @@ +# rvm + +> A tool for easily installing, managing, and working with multiple ruby environments. + +- Install one or more space-separated versions of Ruby: + +`rvm install {{version(s)}}` + +- Display a list of installed versions: + +`rvm list` + +- Use a specific version of Ruby: + +`rvm use {{version}}` + +- Set the default Ruby version: + +`rvm --default use {{version}}` + +- Upgrade a version of Ruby to a new version: + +`rvm upgrade {{current_version}} {{new_version}}` + +- Uninstall a version of Ruby and keep its sources: + +`rvm uninstall {{version}}` + +- Remove a version of Ruby and its sources: + +`rvm remove {{version}}` diff --git a/pages.cn/common/s.md b/pages.cn/common/s.md new file mode 100644 index 0000000000..3dec967946 --- /dev/null +++ b/pages.cn/common/s.md @@ -0,0 +1,19 @@ +# s + +> Web search from the terminal. + +- Search for a query on Google(default provider): + +`s {{query}}` + +- List all providers: + +`s --list-providers` + +- Search for a query with a given provider: + +`s --provider {{provider}} {{query}}` + +- Use a specified binary to perform the search query: + +`s --binary "{{binary}} {{arguments}}" {{query}}` diff --git a/pages.cn/common/sails.md b/pages.cn/common/sails.md new file mode 100644 index 0000000000..5a7f3d7d35 --- /dev/null +++ b/pages.cn/common/sails.md @@ -0,0 +1,23 @@ +# sails + +> Sails.js is a realtime enterprise level MVC framework built on top of Node.js. + +- Start Sails: + +`sails lift` + +- Create new Sails project: + +`sails new {{projectName}}` + +- Generate Sails API: + +`sails generate {{name}}` + +- Generate Sails Controller: + +`sails generate controller {{name}}` + +- Generate Sails Model: + +`sails generate model {{name}}` diff --git a/pages.cn/common/salt-call.md b/pages.cn/common/salt-call.md new file mode 100644 index 0000000000..705bf7736a --- /dev/null +++ b/pages.cn/common/salt-call.md @@ -0,0 +1,19 @@ +# salt-key + +> Invoke salt locally on a salt minion. + +- Perform a highstate on this minion: + +`salt-call state.highstate` + +- Perform a highstate dry-run, compute all changes but don't actually perform them: + +`salt-call state.highstate test=true` + +- Perform a highstate with verbose debugging output: + +`salt-call -l debug state.highstate` + +- List this minion's grains: + +`salt-call grains.items` diff --git a/pages.cn/common/salt-key.md b/pages.cn/common/salt-key.md new file mode 100644 index 0000000000..a0352a5cc2 --- /dev/null +++ b/pages.cn/common/salt-key.md @@ -0,0 +1,20 @@ +# salt-key + +> Manages salt minion keys on the salt master. +> Needs to be run on the salt master, likely as root or with sudo. + +- List all accepted, unaccepted and rejected minion keys: + +`salt-key -L` + +- Accept a minion key by name: + +`salt-key -a {{MINION_ID}}` + +- Reject a minion key by name: + +`salt-key -r {{MINION_ID}}` + +- Print fingerprints of all public keys: + +`salt-key -F` diff --git a/pages.cn/common/salt-run.md b/pages.cn/common/salt-run.md new file mode 100644 index 0000000000..73a4b780f9 --- /dev/null +++ b/pages.cn/common/salt-run.md @@ -0,0 +1,11 @@ +# salt-run + +> Frontend for executing salt-runners on minions. + +- Show status of all minions: + +`salt-run manage.status` + +- Show all minions which are disconnected: + +`salt-run manage.up` diff --git a/pages.cn/common/salt.md b/pages.cn/common/salt.md new file mode 100644 index 0000000000..00e31471c4 --- /dev/null +++ b/pages.cn/common/salt.md @@ -0,0 +1,19 @@ +# salt + +> Execute commands and assert state on remote salt minions. + +- List connected minions: + +`salt '*' test.ping` + +- Execute a highstate on all connected minions: + +`salt '*' state.highstate` + +- Upgrade packages using the OS package manager (apt, yum, brew) on a subset of minions: + +`salt '*.domain.com' pkg.upgrade` + +- Execute an arbitrary command on a particular minion: + +`salt '{{minion_id}}' cmd.run "ls "` diff --git a/pages.cn/common/samtools.md b/pages.cn/common/samtools.md new file mode 100644 index 0000000000..3a1773a016 --- /dev/null +++ b/pages.cn/common/samtools.md @@ -0,0 +1,36 @@ +# samtools + +> Tools for handling high-throughput sequencing (genomics) data. +> Used for reading/writing/editing/indexing/viewing of data in SAM/BAM/CRAM format. + +- Convert a SAM input file to BAM stream and save to file: + +`samtools view -S -b {{input.sam}} > {{output.bam}}` + +- Take input from stdin (-) and print the SAM header and any reads overlapping a specific region to stdout: + +`{{other_command}} | samtools view -h - chromosome:start-end` + +- Sort file and save to BAM (the output format is automatically determined from the output file's extension): + +`samtools sort {{input}} -o {{output.bam}}` + +- Index a sorted BAM file (creates {{sorted_input.bam.bai}}): + +`samtools index {{sorted_input.bam}}` + +- Print alignment statistics about a file: + +`samtools flagstat {{sorted_input}}` + +- Count alignments to each index (chromosome / contig): + +`samtools idxstats {{sorted_indexed_input}}` + +- Merge multiple files: + +`samtools merge {{output}} {{input_1}} [{{input_2}}...]` + +- Split input file according to read groups: + +`samtools split {{merged_input}}` diff --git a/pages.cn/common/sass.md b/pages.cn/common/sass.md new file mode 100644 index 0000000000..3872daacc2 --- /dev/null +++ b/pages.cn/common/sass.md @@ -0,0 +1,19 @@ +# sass + +> Converts SCSS or Sass files to CSS. + +- Convert a SCSS or Sass file to CSS and print out the result: + +`sass {{inputfile.scss|inputfile.sass}}` + +- Convert a SCSS or Sass file to CSS and save the result to a file: + +`sass {{inputfile.scss|inputfile.sass}} {{outputfile.css}}` + +- Watch a SCSS or Sass file for changes and output or update the CSS file with same filename: + +`sass --watch {{inputfile.scss|inputfile.sass}}` + +- Watch a SCSS or Sass file for changes and output or update the CSS file with the given filename: + +`sass --watch {{inputfile.scss|inputfile.sass}}:{{outputfile.css}}` diff --git a/pages.cn/common/sc-im.md b/pages.cn/common/sc-im.md new file mode 100644 index 0000000000..6933c2b050 --- /dev/null +++ b/pages.cn/common/sc-im.md @@ -0,0 +1,28 @@ +# SC-IM + +> A curses based, vim-like spreadsheet calculator. +> Use hjkl or arrow keys to navigate. + +- Start SC-IM: + +`scim {{file_name}}.csv` + +- Enter a string into the current cell: + +`< or >` + +- Enter a numeric constant into the current cell: + +`=` + +- Edit string in the current cell: + +`E` + +- Edit number in the current cell: + +`e` + +- Center align the current cell: + +`|` diff --git a/pages.cn/common/scala.md b/pages.cn/common/scala.md new file mode 100644 index 0000000000..3fe77649f1 --- /dev/null +++ b/pages.cn/common/scala.md @@ -0,0 +1,19 @@ +# scala + +> Scala application launcher and interactive interpreter. + +- Start a Scala interactive shell (REPL): + +`scala` + +- Execute a Scala script: + +`scala {{script.scala}}` + +- Execute a .jar program: + +`scala {{filename.jar}}` + +- Execute a single Scala command in the command line: + +`scala -e {{command}}` diff --git a/pages.cn/common/scheme.md b/pages.cn/common/scheme.md new file mode 100644 index 0000000000..2d2c2b5ea3 --- /dev/null +++ b/pages.cn/common/scheme.md @@ -0,0 +1,23 @@ +# scheme + +> MIT Scheme language interperter and REPL (interactive shell). + +- Open an interactive shell (REPL): + +`scheme` + +- Run a scheme program (with no REPL output): + +`scheme --quiet < {{script.scm}}` + +- Load a scheme program into the REPL: + +`scheme --load {{script.scm}}` + +- Load scheme expressions into the REPL: + +`scheme --eval {{"(define foo 'x)"}}` + +- Open the REPL in quiet mode: + +`scheme --quiet` diff --git a/pages.cn/common/scp.md b/pages.cn/common/scp.md new file mode 100644 index 0000000000..3c1de22077 --- /dev/null +++ b/pages.cn/common/scp.md @@ -0,0 +1,28 @@ +# scp + +> Secure copy. +> Copy files between hosts using Secure Copy Protocol over SSH. + +- Copy a local file to a remote host: + +`scp {{path/to/local_file}} {{remote_host}}:{{path/to/remote_file}}` + +- Copy a file from a remote host to a local folder: + +`scp {{remote_host}}:{{path/to/remote_file}} {{path/to/local_dir}}` + +- Recursively copy the contents of a directory from a remote host to a local directory: + +`scp -r {{remote_host}}:{{path/to/remote_dir}} {{path/to/local_dir}}` + +- Copy a file between two remote hosts transferring through the local host: + +`scp -3 {{host1}}:{{path/to/remote_file}} {{host2}}:{{path/to/remote_dir}}` + +- Use a specific username when connecting to the remote host: + +`scp {{path/to/local_file}} {{remote_username}}@{{remote_host}}:{{path/to/remote_dir}}` + +- Use a specific ssh private key for authentication with the remote host: + +`scp -i {{~/.ssh/private_key}} {{local_file}} {{remote_host}}:{{/path/remote_file}}` diff --git a/pages.cn/common/scrapy.md b/pages.cn/common/scrapy.md new file mode 100644 index 0000000000..ed22f8c118 --- /dev/null +++ b/pages.cn/common/scrapy.md @@ -0,0 +1,31 @@ +# scrapy + +> Web-crawling framework. + +- Create a project: + +`scrapy startproject {{project_name}}` + +- Create a spider (in project directory): + +`scrapy genspider {{spider_name}} {{website_domain}}` + +- Edit spider (in project directory): + +`scrapy edit {{spider_name}}` + +- Run spider (in project directory): + +`scrapy crawl {{spider_name}}` + +- Fetch a webpage as scrapy sees it and print source in stdout: + +`scrapy fetch {{url}}` + +- Open a webpage in the default browser as scrapy sees it (disable javascript for extra fidelity): + +`scrapy view {{url}}` + +- Open scrapy shell for url, which allows interaction with the page source in python shell (or ipython if available): + +`scrapy shell {{url}}` diff --git a/pages.cn/common/screen.md b/pages.cn/common/screen.md new file mode 100644 index 0000000000..f775ee76b3 --- /dev/null +++ b/pages.cn/common/screen.md @@ -0,0 +1,31 @@ +# screen + +> Hold a session open on a remote server. Manage multiple windows with a single SSH connection. + +- Start a new screen session: + +`screen` + +- Start a new named screen session: + +`screen -S {{session_name}}` + +- Start a new daemon and log the output to screenlog.x: + +`screen -dmLS {{session_name}} {{command}}` + +- Show open screen sessions: + +`screen -ls` + +- Reattach to an open screen: + +`screen -r {{session_name}}` + +- Detach from inside a screen: + +`Ctrl + A, D` + +- Kill a detached screen: + +`screen -X -S {{session_name}} quit` diff --git a/pages.cn/common/screenfetch.md b/pages.cn/common/screenfetch.md new file mode 100644 index 0000000000..38ad881537 --- /dev/null +++ b/pages.cn/common/screenfetch.md @@ -0,0 +1,23 @@ +# screenfetch + +> Display system information. + +- Start screenfetch: + +`screenfetch` + +- Take a screenshot (requires 'scrot'): + +`screenfetch -s` + +- Specify distribution logo: + +`screenfetch -A '{{distribution_name}}'` + +- Specify distribution logo and text: + +`screenfetch -D '{{distribution_name}}'` + +- Strip all color: + +`screenfetch -N` diff --git a/pages.cn/common/script.md b/pages.cn/common/script.md new file mode 100644 index 0000000000..803e9b84ba --- /dev/null +++ b/pages.cn/common/script.md @@ -0,0 +1,23 @@ +# script + +> Make a typescript file of a terminal session. + +- Start recording in file named "typescript": + +`script` + +- Stop recording: + +`exit` + +- Start recording in a given file: + +`script {{logfile.log}}` + +- Append to an existing file: + +`script -a {{logfile.log}}` + +- Execute quietly without start and done messages: + +`script -q {{logfile.log}}` diff --git a/pages.cn/common/sdk.md b/pages.cn/common/sdk.md new file mode 100644 index 0000000000..de238082b0 --- /dev/null +++ b/pages.cn/common/sdk.md @@ -0,0 +1,28 @@ +# sdk + +> Tool for managing parallel versions of multiple Software Development Kits. +> Supports Java, Groovy, Scala, Kotlin, Gradle, Maven, Vert.x and many others. + +- Install a specific version of Gradle: + +`sdk install {{gradle}} {{gradle_version}}` + +- Switch to a specific version of Gradle: + +`sdk use {{gradle}} {{gradle_version}}` + +- Check current Gradle version: + +`sdk current {{gradle}}` + +- List all Software Development Kits available to install: + +`sdk list` + +- Update Gradle to the latest version: + +`sdk upgrade {{gradle}}` + +- Uninstall a particular version of Gradle: + +`sdk rm {{gradle}} {{gradle_version}}` diff --git a/pages.cn/common/sed.md b/pages.cn/common/sed.md new file mode 100644 index 0000000000..4138cfd634 --- /dev/null +++ b/pages.cn/common/sed.md @@ -0,0 +1,35 @@ +# sed + +> Edit text in a scriptable manner. + +- Replace the first occurrence of a string in a file, and print the result: + +`sed 's/{{find}}/{{replace}}/' {{filename}}` + +- Replace all occurrences of an extended regular expression in a file: + +`sed -r 's/{{regex}}/{{replace}}/g' {{filename}}` + +- Replace all occurrences of a string in a file, overwriting the file (i.e. in-place): + +`sed -i 's/{{find}}/{{replace}}/g' {{filename}}` + +- Replace only on lines matching the line pattern: + +`sed '/{{line_pattern}}/s/{{find}}/{{replace}}/' {{filename}}` + +- Delete lines matching the line pattern: + +`sed '/{{line_pattern}}/d' {{filename}}` + +- Print only text between n-th line till the next empty line: + +`sed -n '{{line_number}},/^$/p' {{filename}}` + +- Apply multiple find-replace expressions to a file: + +`sed -e 's/{{find}}/{{replace}}/' -e 's/{{find}}/{{replace}}/' {{filename}}` + +- Replace separator / by any other character not used in the find or replace patterns, e.g., #: + +`sed 's#{{find}}#{{replace}}#' {{filename}}` diff --git a/pages.cn/common/sendmail.md b/pages.cn/common/sendmail.md new file mode 100644 index 0000000000..74d2a0b543 --- /dev/null +++ b/pages.cn/common/sendmail.md @@ -0,0 +1,15 @@ +# sendmail + +> Send email from the command line. + +- Send a message with the content of message.txt to the mail folder of local user `user_name`: + +`sendmail {{user_name}} < {{message.txt}}` + +- Send an email from you@yourdomain.com (assuming the mail server is configured for this) to test@gmail.com containing the message in `message.txt`: + +`sendmail -f {{you@yourdomain.com}} {{test@gmail.com}} < {{message.txt}}` + +- Send an email from you@yourdomain.com (assuming the mail server is configured for this) to test@gmail.com containing the file `file.zip`: + +`sendmail -f {{you@yourdomain.com}} {{test@gmail.com}} < {{file.zip}}` diff --git a/pages.cn/common/seq.md b/pages.cn/common/seq.md new file mode 100644 index 0000000000..74eec36ff9 --- /dev/null +++ b/pages.cn/common/seq.md @@ -0,0 +1,19 @@ +# seq + +> Output a sequence of numbers to stdout. + +- Sequence from 1 to 10: + +`seq 10` + +- Every 3rd number from 5 to 20: + +`seq 5 3 20` + +- Separate the output with a space instead of a newline: + +`seq -s " " 5 3 20` + +- Format output width to a minimum of 4 digits padding with zeros as necessary: + +`seq -f "%04g" 5 3 20` diff --git a/pages.cn/common/serverless.md b/pages.cn/common/serverless.md new file mode 100644 index 0000000000..7d37c80084 --- /dev/null +++ b/pages.cn/common/serverless.md @@ -0,0 +1,28 @@ +# serverless + +> Toolkit for deploying and operating serverless architectures on AWS, Google Cloud, Azure and IBM OpenWhisk. +> Commands can be run either using the `serverless` command or it's alias, `sls`. + +- Create a serverless project: + +`serverless create` + +- Create a serverless project from a template: + +`serverless create --template {{template_name}}` + +- Deploy to a cloud provider: + +`serverless deploy` + +- Display information about a serverless project: + +`serverless info` + +- Invoke a deployed function: + +`serverless invoke -f {{function_name}}` + +- Follow the logs for a project: + +`serverless logs -t` diff --git a/pages.cn/common/set.md b/pages.cn/common/set.md new file mode 100644 index 0000000000..7246dbf393 --- /dev/null +++ b/pages.cn/common/set.md @@ -0,0 +1,19 @@ +# set + +> Display, set or unset values of shell attributes and positional parameters. + +- Display the names and values of shell variables: + +`set` + +- Mark variables that are modified or created for export: + +`set -a` + +- Notify of job termination immediately: + +`set -b` + +- Set various options, e.g. enable `vi` style line editing: + +`set -o {{vi}}` diff --git a/pages.cn/common/sftp.md b/pages.cn/common/sftp.md new file mode 100644 index 0000000000..f8135ef65f --- /dev/null +++ b/pages.cn/common/sftp.md @@ -0,0 +1,33 @@ +# sftp + +> Secure File Transfer Program. +> Interactive program to copy files between hosts over SSH. +> For non-interactive file transfers, see `scp` or `rsync`. + +- Connect to a remote server and enter an interactive command mode: + +`sftp {{remote_user}}@{{remote_host}}` + +- Connect using an alternate port: + +`sftp -P {{remote_port}} {{remote_user}}@{{remote_host}}` + +- Transfer remote file to the local system: + +`get {{/path/remote_file}}` + +- Transfer local file to the remote system: + +`put {{/path/local_file}}` + +- Transfer remote folder to the local system recursively (works with `put` too): + +`get -R {{/path/remote_folder}}` + +- Get list of files on local machine: + +`lls` + +- Get list of files on remote machine: + +`ls` diff --git a/pages.cn/common/sh.md b/pages.cn/common/sh.md new file mode 100644 index 0000000000..699823a3cd --- /dev/null +++ b/pages.cn/common/sh.md @@ -0,0 +1,20 @@ +# sh + +> Bourne shell. +> The standard command language interpreter. + +- Start interactive shell: + +`sh` + +- Execute a command: + +`sh -c {{command}}` + +- Run commands from a file: + +`sh {{file.sh}}` + +- Run commands from STDIN: + +`sh -s` diff --git a/pages.cn/common/sha1sum.md b/pages.cn/common/sha1sum.md new file mode 100644 index 0000000000..fbc8aeaa65 --- /dev/null +++ b/pages.cn/common/sha1sum.md @@ -0,0 +1,15 @@ +# sha1sum + +> Calculate SHA1 cryptographic checksums. + +- Calculate the SHA1 checksum for a file: + +`sha1sum {{filename1}}` + +- Calculate SHA1 checksums for multiple files: + +`sha1sum {{filename1}} {{filename2}}` + +- Read a file of SHA1 sums and verify all files have matching checksums: + +`sha1sum -c {{filename.sha1}}` diff --git a/pages.cn/common/sha224sum.md b/pages.cn/common/sha224sum.md new file mode 100644 index 0000000000..e2058e21ce --- /dev/null +++ b/pages.cn/common/sha224sum.md @@ -0,0 +1,15 @@ +# sha224sum + +> Calculate SHA224 cryptographic checksums. + +- Calculate the SHA224 checksum for a file: + +`sha224sum {{filename1}}` + +- Calculate SHA224 checksums for multiple files: + +`sha224sum {{filename1}} {{filename2}}` + +- Read a file of SHA224 sums and verify all files have matching checksums: + +`sha224sum -c {{filename.sha224}}` diff --git a/pages.cn/common/sha256sum.md b/pages.cn/common/sha256sum.md new file mode 100644 index 0000000000..2311de3727 --- /dev/null +++ b/pages.cn/common/sha256sum.md @@ -0,0 +1,15 @@ +# sha256sum + +> Calculate SHA256 cryptographic checksums. + +- Calculate the SHA256 checksum for a file: + +`sha256sum {{filename1}}` + +- Calculate SHA256 checksums for multiple files: + +`sha256sum {{filename1}} {{filename2}}` + +- Read a file of SHA256 sums and verify all files have matching checksums: + +`sha256sum -c {{filename.sha256}}` diff --git a/pages.cn/common/sha384sum.md b/pages.cn/common/sha384sum.md new file mode 100644 index 0000000000..3dcbaba2ea --- /dev/null +++ b/pages.cn/common/sha384sum.md @@ -0,0 +1,15 @@ +# sha384sum + +> Calculate SHA384 cryptographic checksums. + +- Calculate the SHA384 checksum for a file: + +`sha384sum {{filename1}}` + +- Calculate SHA384 checksums for multiple files: + +`sha384sum {{filename1}} {{filename2}}` + +- Read a file of SHA384 sums and verify all files have matching checksums: + +`sha384sum -c {{filename.sha384}}` diff --git a/pages.cn/common/sha512sum.md b/pages.cn/common/sha512sum.md new file mode 100644 index 0000000000..c3e8efc7fa --- /dev/null +++ b/pages.cn/common/sha512sum.md @@ -0,0 +1,15 @@ +# sha512sum + +> Calculate SHA512 cryptographic checksums. + +- Calculate the SHA512 checksum for a file: + +`sha512sum {{filename1}}` + +- Calculate SHA512 checksums for multiple files: + +`sha512sum {{filename1}} {{filename2}}` + +- Read a file of SHA512 sums and verify all files have matching checksums: + +`sha512sum -c {{filename.sha512}}` diff --git a/pages.cn/common/shards.md b/pages.cn/common/shards.md new file mode 100644 index 0000000000..f6df8a8d8e --- /dev/null +++ b/pages.cn/common/shards.md @@ -0,0 +1,23 @@ +# shards + +> Dependency management tool for the Crystal language. + +- Create a skeleton shard.yml file: + +`shards init` + +- Install dependencies from a shard.yml file: + +`shards install` + +- Update all dependencies: + +`shards update` + +- List all installed dependencies: + +`shards list` + +- List version of dependency: + +`shards version {{path/to/dependency_folder}}` diff --git a/pages.cn/common/shc.md b/pages.cn/common/shc.md new file mode 100644 index 0000000000..5303d33ddc --- /dev/null +++ b/pages.cn/common/shc.md @@ -0,0 +1,19 @@ +# shc + +> Generic shell script compiler. + +- Compile a shell script: + +`shc -f {{script}}` + +- Compile a shell script and specify an output binary file: + +`shc -f {{script}} -o {{binary}}` + +- Compile a shell script and set an expiration date for the executable: + +`shc -f {{script}} -e {{dd/mm/yyyy}}` + +- Compile a shell script and set a message to display upon expiration: + +`shc -f {{script}} -e {{dd/mm/yyyy}} -m {{"Please contact your provider"}}` diff --git a/pages.cn/common/shellcheck.md b/pages.cn/common/shellcheck.md new file mode 100644 index 0000000000..b2c729daaf --- /dev/null +++ b/pages.cn/common/shellcheck.md @@ -0,0 +1,19 @@ +# shellcheck + +> Shell script static analysis tool. + +- Check a shell script: + +`shellcheck {{file.sh}}` + +- Override script's shebang: + +`shellcheck --shell {{sh|bash|ksh}} {{file.sh}}` + +- Ignore certain errors: + +`shellcheck --exclude {{SC1009}} {{file.sh}}` + +- Ignore multiple errors: + +`shellcheck --exclude {{SC1009,SC1073}} {{file.sh}}` diff --git a/pages.cn/common/shopt.md b/pages.cn/common/shopt.md new file mode 100644 index 0000000000..5e1d13599f --- /dev/null +++ b/pages.cn/common/shopt.md @@ -0,0 +1,24 @@ +# shopt + +> Manage Bash shell options: variables (stored in `$BASHOPTS`) that control behavior specific to the Bash shell. +> Generic POSIX shell variables (stored in `$SHELLOPTS`) are managed with the `set` command instead. + +- List of all settable options and whether they are set: + +`shopt` + +- Set an option: + +`shopt -s {{option_name}}` + +- Unset an option: + +`shopt -u {{option_name}}` + +- Print a list of all options and their status formatted as runnable `shopt` commands: + +`shopt -p` + +- Show help for the command: + +`help shopt` diff --git a/pages.cn/common/shred.md b/pages.cn/common/shred.md new file mode 100644 index 0000000000..544a84be25 --- /dev/null +++ b/pages.cn/common/shred.md @@ -0,0 +1,19 @@ +# shred + +> Overwrite files to securely delete data. + +- Overwrite a file: + +`shred {{file}}` + +- Overwrite a file, leaving zeroes instead of random data: + +`shred --zero {{file}}` + +- Overwrite a file 25 times: + +`shred -n25 {{file}}` + +- Overwrite a file and remove it: + +`shred --remove {{file}}` diff --git a/pages.cn/common/shuf.md b/pages.cn/common/shuf.md new file mode 100644 index 0000000000..5912275e2a --- /dev/null +++ b/pages.cn/common/shuf.md @@ -0,0 +1,19 @@ +# shuf + +> Generate random permutations. + +- Randomize the order of lines in a file and output the result: + +`shuf {{filename}}` + +- Only output the first 5 entries of the result: + +`shuf -n {{5}} {{filename}}` + +- Write the output to another file: + +`shuf {{filename}} -o {{output_filename}}` + +- Generate random numbers in range: + +`shuf -i {{1-10}}` diff --git a/pages.cn/common/singularity.md b/pages.cn/common/singularity.md new file mode 100644 index 0000000000..b5663b4e7c --- /dev/null +++ b/pages.cn/common/singularity.md @@ -0,0 +1,27 @@ +# singularity + +> Manage Singularity containers and images. + +- Download a remote image: + +`singularity pull --name {{container.simg}} {{shub://vsoch/hello-world}}` + +- Rebuild a remote image using latest Singularity image format: + +`singularity build {{container.simg}} {{docker://godlovedc/lolcow}}` + +- Start a container from an image and get a shell inside of it: + +`singularity shell {{container.simg}}` + +- Start a container from an image and run a command: + +`singularity exec {{container.simg}} {{command}}` + +- Start a container from an image and execute the internal runscript: + +`singularity run {{container.simg}}` + +- Build a singularity image from a recipe file: + +`sudo singularity build {{container.simg}} {{recipe}}` diff --git a/pages.cn/common/skicka.md b/pages.cn/common/skicka.md new file mode 100644 index 0000000000..e75d8a6db7 --- /dev/null +++ b/pages.cn/common/skicka.md @@ -0,0 +1,27 @@ +# skicka + +> Manage your Google Drive. + +- Upload a file/folder to Google Drive: + +`skicka upload {{path/to/local}} {{path/to/remote}}` + +- Download a file/folder from Google Drive: + +`skicka download {{path/to/remote}} {{path/to/local}}` + +- List files: + +`skicka ls {{path/to/folder}}` + +- Show amount of space used by children folders: + +`skicka du {{path/to/parent/folder}}` + +- Create a folder: + +`skicka mkdir {{path/to/folder}}` + +- Delete a file: + +`skicka rm {{path/to/file}}` diff --git a/pages.cn/common/sl.md b/pages.cn/common/sl.md new file mode 100644 index 0000000000..50efa461aa --- /dev/null +++ b/pages.cn/common/sl.md @@ -0,0 +1,23 @@ +# sl + +> Steam locomotive running through your terminal. + +- Let a steam locomotive run through your terminal: + +`sl` + +- The train burns, people scream: + +`sl -a` + +- Let the train fly: + +`sl -F` + +- Make the train little: + +`sl -l` + +- Let the user exit (CTRL + C): + +`sl -e` diff --git a/pages.cn/common/slackcat.md b/pages.cn/common/slackcat.md new file mode 100644 index 0000000000..868261ad43 --- /dev/null +++ b/pages.cn/common/slackcat.md @@ -0,0 +1,19 @@ +# slackcat + +> Utility for passing files and command output to Slack. + +- Post a file to Slack: + +`slackcat --channel {{channel_name}} {{path/to/file}}` + +- Post a file to Slack with a custom filename: + +`slackcat --channel {{channel_name}} --filename={{filename}} {{path/to/file}}` + +- Pipe command output to Slack as a text snippet: + +`{{command}} | slackcat --channel {{channel_name}} --filename={{snippet_name}}` + +- Stream command output to Slack continuously: + +`{{command}} | slackcat --channel {{channel_name}} --stream` diff --git a/pages.cn/common/sleep.md b/pages.cn/common/sleep.md new file mode 100644 index 0000000000..2d0e8475f6 --- /dev/null +++ b/pages.cn/common/sleep.md @@ -0,0 +1,15 @@ +# sleep + +> Delay for a specified amount of time. + +- Delay in seconds: + +`sleep {{seconds}}` + +- Delay in minutes: + +`sleep {{minutes}}m` + +- Delay in hours: + +`sleep {{hours}}h` diff --git a/pages.cn/common/slimrb.md b/pages.cn/common/slimrb.md new file mode 100644 index 0000000000..975cc975be --- /dev/null +++ b/pages.cn/common/slimrb.md @@ -0,0 +1,15 @@ +# slimrb + +> Convert Slim files to HTML. + +- Convert a Slim file to HTML: + +`slimrb {{input.slim}} {{output.html}}` + +- Convert a Slim file and output to prettified HTML: + +`slimrb --pretty {{input.slim}} {{output.html}}` + +- Convert a Slim file to ERB: + +`slimrb --erb {{input.slim}} {{output.erb}}` diff --git a/pages.cn/common/smartctl.md b/pages.cn/common/smartctl.md new file mode 100644 index 0000000000..58e672dd3e --- /dev/null +++ b/pages.cn/common/smartctl.md @@ -0,0 +1,24 @@ +# smartctl + +> View a disk's SMART data and other information. +> See https://en.wikipedia.org/wiki/S.M.A.R.T for more information. + +- View SMART health summary: + +`sudo smartctl --health {{/dev/sda}}` + +- View device information: + +`sudo smartctl --info {{/dev/sda}}` + +- Begin a short self-test: + +`sudo smartctl --test short {{/dev/sda}}` + +- View current/last self-test status and other SMART capabilities: + +`sudo smartctl --capabilities {{/dev/sda}}` + +- View SMART self-test log (if supported): + +`sudo smartctl --log selftest {{/dev/sda}}` diff --git a/pages.cn/common/socat.md b/pages.cn/common/socat.md new file mode 100644 index 0000000000..421b002e5f --- /dev/null +++ b/pages.cn/common/socat.md @@ -0,0 +1,15 @@ +# socat + +> Multipurpose relay (SOcket CAT). + +- Listen to a port, wait for an incoming connection and transfer data to STDIO: + +`socat - TCP-LISTEN:8080,fork` + +- Create a connection to a host and port, transfer data in STDIO to connected host: + +`socat - TCP4:www.domain.com:80` + +- Forward incoming data of a local port to another host and port: + +`socat TCP-LISTEN:80,fork TCP4:www.domain.com:80` diff --git a/pages.cn/common/sort.md b/pages.cn/common/sort.md new file mode 100644 index 0000000000..f20a49c71b --- /dev/null +++ b/pages.cn/common/sort.md @@ -0,0 +1,31 @@ +# sort + +> Sort lines of text files. + +- Sort a file in ascending order: + +`sort {{filename}}` + +- Sort a file in descending order: + +`sort -r {{filename}}` + +- Sort a file in case-insensitive way: + +`sort --ignore-case {{filename}}` + +- Sort a file using numeric rather than alphabetic order: + +`sort -n {{filename}}` + +- Sort the passwd file by the 3rd field, numerically: + +`sort -t: -k 3n /etc/passwd` + +- Sort a file preserving only unique lines: + +`sort -u {{filename}}` + +- Sort human-readable numbers (in this case the 5th field of `ls -lh`): + +`ls -lh | sort -h -k 5` diff --git a/pages.cn/common/source.md b/pages.cn/common/source.md new file mode 100644 index 0000000000..b5cbb04d8a --- /dev/null +++ b/pages.cn/common/source.md @@ -0,0 +1,7 @@ +# source + +> Execute commands from a file in the current shell. + +- Evaluate contents of a given file: + +`source {{path/to/file}}` diff --git a/pages.cn/common/sox.md b/pages.cn/common/sox.md new file mode 100644 index 0000000000..74b0623626 --- /dev/null +++ b/pages.cn/common/sox.md @@ -0,0 +1,28 @@ +# sox + +> Sound eXchange: play, record and convert audio files. +> Audio formats are identified by the extension. + +- Merge two audio files into one: + +`sox -m {{input_audiofile1}} {{input_audiofile2}} {{output_audiofile}}` + +- Trim an audio file to the specified times: + +`sox {{input_audiofile}} {{output_audiofile}} trim {{start}} {{end}}` + +- Normalize an audio file (adjust volume to the maximum peak level, without clipping): + +`sox --norm {{input_audiofile}} {{output_audiofile}}` + +- Reverse and save an audio file: + +`sox {{input_audiofile}} {{output_audiofile}} reverse` + +- Print statistical data of an audio file: + +`sox {{input_audiofile}} -n stat` + +- Increase the volume of an audio file by 2x: + +`sox -v 2.0 {{input_audiofile}} {{output_audiofile}}` diff --git a/pages.cn/common/spatial.md b/pages.cn/common/spatial.md new file mode 100644 index 0000000000..f6b525b9eb --- /dev/null +++ b/pages.cn/common/spatial.md @@ -0,0 +1,35 @@ +# spatial + +> A set of commands for managing and developing SpatialOS projects. + +- Run this when you use a project for the first time: + +`spatial worker build` + +- Build workers for local deployment on Unity on macOS: + +`spatial worker build --target=development --target=Osx` + +- Build workers for local deployment on Unreal on Windows: + +`spatial worker build --target=local --target=Windows` + +- Deploy locally: + +`spatial local launch {{launch_config}} --snapshot={{snapshot_file}}` + +- Launch a local worker to connect to your local deployment: + +`spatial local worker launch {{worker_type}} {{launch_config}}` + +- Upload an assembly to use for cloud deployments: + +`spatial cloud upload {{assembly_name}}` + +- Launch a cloud deployment: + +`spatial cloud launch {{assembly_name}} {{launch_config}} {{deployment_name}}` + +- Clean worker directories: + +`spatial worker clean` diff --git a/pages.cn/common/speedtest-cli.md b/pages.cn/common/speedtest-cli.md new file mode 100644 index 0000000000..dbcc211b04 --- /dev/null +++ b/pages.cn/common/speedtest-cli.md @@ -0,0 +1,19 @@ +# speedtest-cli + +> Command line interface for testing internet bandwidth using speedtest.net. + +- Run a speed test: + +`speedtest-cli` + +- Run a speed test and generate a shareable result picture: + +`speedtest-cli --share` + +- Print a list of all speedtest.net servers, sorted by distance, to file: + +`speedtest-cli --list > speedtest_servers.txt` + +- Run a speed test to the given speedtest.net server id: + +`speedtest-cli --server {{server_id}}` diff --git a/pages.cn/common/spike.md b/pages.cn/common/spike.md new file mode 100644 index 0000000000..803ee9d638 --- /dev/null +++ b/pages.cn/common/spike.md @@ -0,0 +1,19 @@ +# spike + +> A fully featured static website generator written in JavaScript. + +- Create a new project using the default template: + +`spike new {{project_name}}` + +- Compile your project, watch for changes, and auto-reload the browser: + +`spike watch` + +- Compile your project once to the "public" folder: + +`spike compile` + +- Remove the output directory: + +`spike clean` diff --git a/pages.cn/common/split.md b/pages.cn/common/split.md new file mode 100644 index 0000000000..85aeff2b9f --- /dev/null +++ b/pages.cn/common/split.md @@ -0,0 +1,19 @@ +# split + +> Split a file into pieces. + +- Split a file, each split having 10 lines (except the last split): + +`split -l {{10}} {{filename}}` + +- Split a file into 5 files. File is split such that each split has same size (except the last split): + +`split -n {{5}} {{filename}}` + +- Split a file with 512 bytes in each split (except the last split; use 512k for kilobytes and 512m for megabytes): + +`split -b {{512}} {{filename}}` + +- Split a file with at most 512 bytes in each split without breaking lines: + +`split -C {{512}} {{filename}}` diff --git a/pages.cn/common/sqlite3.md b/pages.cn/common/sqlite3.md new file mode 100644 index 0000000000..13ac4dca63 --- /dev/null +++ b/pages.cn/common/sqlite3.md @@ -0,0 +1,15 @@ +# sqlite3 + +> The command-line interface to SQLite 3, which is a self-contained file-based embedded SQL engine. + +- Start an interactive shell with a new database: + +`sqlite3` + +- Open an interactive shell against an existing database: + +`sqlite3 {{path/to/database.sqlite3}}` + +- Execute an SQL statement against a database and then exit: + +`sqlite3 {{path/to/database.sqlite3}} '{{SELECT * FROM some_table;}}'` diff --git a/pages.cn/common/sqlmap.md b/pages.cn/common/sqlmap.md new file mode 100644 index 0000000000..aaaa489525 --- /dev/null +++ b/pages.cn/common/sqlmap.md @@ -0,0 +1,23 @@ +# sqlmap + +> Detect and exploit SQL injection flaws. + +- Run sqlmap against a single target URL: + +`python sqlmap.py -u {{"http://www.target.com/vuln.php?id=1"}}` + +- Send data in a POST request (`--data` implies POST request): + +`python sqlmap.py -u {{"http://www.target.com/vuln.php" --data={{"id=1"}}` + +- Change the parameter delimiter (& is the default): + +`python sqlmap.py -u {{"http://www.target.com/vuln.php"}} --data={{"query=foobar;id=1"}} --param-del={{";"}}` + +- Select a random `User-Agent` from `./txt/user-agents.txt` and use it: + +`python sqlmap.py -u {{"http://www.target.com/vuln.php"}} --random-agent` + +- Provide user credentials for HTTP protocol authentication: + +`python sqlmap.py -u {{"http://www.target.com/vuln.php"}} --auth-type {{Basic}} --auth-cred {{"testuser:testpass"}}` diff --git a/pages.cn/common/sqsc.md b/pages.cn/common/sqsc.md new file mode 100644 index 0000000000..a24d565689 --- /dev/null +++ b/pages.cn/common/sqsc.md @@ -0,0 +1,31 @@ +# sqsc + +> A command line AWS Simple Queue Service client. + +- List all queues: + +`sqsc lq {{queue_prefix}}` + +- List all messages in a queue: + +`sqsc ls {{queue_name}}` + +- Copy all messages from one queue to another: + +`sqsc cp {{source_queue}} {{destination_queue}}` + +- Move all messages from one queue to another: + +`sqsc mv {{source_queue}} {{destination_queue}}` + +- Describe a queue: + +`sqsc describe {{queue_name}}` + +- Query a queue with SQL syntax: + +`sqsc query "SELECT body FROM {{queue_name}} WHERE body LIKE '%user%'"` + +- Pull all messages from a queue into a local sqlite database in your present working directory: + +`sqsc pull {{queue_name}}` diff --git a/pages.cn/common/srm.md b/pages.cn/common/srm.md new file mode 100644 index 0000000000..532c491ffa --- /dev/null +++ b/pages.cn/common/srm.md @@ -0,0 +1,20 @@ +# srm + +> Securely remove files or directories. +> Overwrites the existing data one or multiple times. Drop in replacement for rm. + +- Remove a file after a single-pass overwriting with random data: + +`srm -s {{/path/to/file}}` + +- Remove a file after seven passes of overwriting with random data: + +`srm -m {{/path/to/file}}` + +- Recursively remove a directory and its contents overwriting each file with a single-pass of random data: + +`srm -r -s {{/path/to/folder}}` + +- Prompt before every removal: + +`srm -i {{\*}}` diff --git a/pages.cn/common/ssh-copy-id.md b/pages.cn/common/ssh-copy-id.md new file mode 100644 index 0000000000..0e92ac500f --- /dev/null +++ b/pages.cn/common/ssh-copy-id.md @@ -0,0 +1,15 @@ +# ssh-copy-id + +> Install your public key in a remote machine's authorized_keys. + +- Copy your keys to the remote machine: + +`ssh-copy-id {{username@remote_host}}` + +- Copy the given public key to the remote: + +`ssh-copy-id -i {{path/to/certificate}} {{username}}@{{remote_host}}` + +- Copy the given public key to the remote with specific port: + +`ssh-copy-id -i {{path/to/certificate}} -p {{port}} {{username}}@{{remote_host}}` diff --git a/pages.cn/common/ssh-keygen.md b/pages.cn/common/ssh-keygen.md new file mode 100644 index 0000000000..2b5e311c9c --- /dev/null +++ b/pages.cn/common/ssh-keygen.md @@ -0,0 +1,31 @@ +# ssh-keygen + +> Generate ssh keys user for authentication, password-less logins, and other things. + +- Generate a key interactively: + +`ssh-keygen` + +- Specify file in which to save the key: + +`ssh-keygen -f ~/.ssh/{{filename}}` + +- Generate an ed25519 key with 100 key derivation function rounds: + +`ssh-keygen -t ed25519 -a 100` + +- Generate an RSA 4096 bit key with your email as a comment: + +`ssh-keygen -t rsa -b 4096 -C "{{email}}"` + +- Retrieve the key fingerprint from a host (useful for confirming the authenticity of the host when first connecting to it via SSH): + +`ssh-keygen -l -F {{remote_host}}` + +- Retrieve the fingerprint of a key in MD5 Hex: + +`ssh-keygen -l -E md5 -f ~/.ssh/{{filename}}` + +- Change the password of a key: + +`ssh-keygen -p -f ~/.ssh/{{filename}}` diff --git a/pages.cn/common/ssh.md b/pages.cn/common/ssh.md new file mode 100644 index 0000000000..a69a37ceca --- /dev/null +++ b/pages.cn/common/ssh.md @@ -0,0 +1,36 @@ +# ssh + +> Secure Shell is a protocol used to securely log onto remote systems. +> It can be used for logging or executing commands on a remote server. + +- Connect to a remote server: + +`ssh {{username}}@{{remote_host}}` + +- Connect to a remote server with a specific identity (private key): + +`ssh -i {{path/to/key_file}} {{username}}@{{remote_host}}` + +- Connect to a remote server using a specific port: + +`ssh {{username}}@{{remote_host}} -p {{2222}}` + +- Run a command on a remote server: + +`ssh {{remote_host}} {{command -with -flags}}` + +- SSH tunneling: Dynamic port forwarding (SOCKS proxy on localhost:9999): + +`ssh -D {{9999}} -C {{username}}@{{remote_host}}` + +- SSH tunneling: Forward a specific port (localhost:9999 to slashdot.org:80) along with disabling pseudo-[t]ty allocation and executio[n] of remote commands: + +`ssh -L {{9999}}:{{slashdot.org}}:{{80}} -N -T {{username}}@{{remote_host}}` + +- SSH jumping: Connect through a jumphost to a remote server (Multiple jump hops may be specified separated by comma characters): + +`ssh -J {{username}}@{{jump_host}} {{username}}@{{remote_host}}` + +- Agent forwarding: Forward the authentication information to the remote machine (see `man ssh_config` for available options): + +`ssh -A {{username}}@{{remote_host}}` diff --git a/pages.cn/common/sshfs.md b/pages.cn/common/sshfs.md new file mode 100644 index 0000000000..b999ba8c74 --- /dev/null +++ b/pages.cn/common/sshfs.md @@ -0,0 +1,23 @@ +# sshfs + +> Filesystem client based on ssh. + +- Mount remote directory: + +`sshfs {{username}}@{{remote_host}}:{{remote_directory}} {{mountpoint}}` + +- Unmount remote directory: + +`umount {{mountpoint}}` + +- Mount remote directory from server with specific port: + +`sshfs {{username}}@{{remote_host}}:{{remote_directory}} -p {{2222}}` + +- Use compression: + +`sshfs {{username}}@{{remote_host}}:{{remote_directory}} -C` + +- Follow symbolic links: + +`sshfs -o follow_symlinks {{username}}@{{remote_host}}:{{remote_directory}} {{mountpoint}}` diff --git a/pages.cn/common/sshpass.md b/pages.cn/common/sshpass.md new file mode 100644 index 0000000000..a7de6110b7 --- /dev/null +++ b/pages.cn/common/sshpass.md @@ -0,0 +1,16 @@ +# sshpass + +> An ssh password provider. +> It works by creating a TTY, feeding the password into it, and then redirecting stdin to the ssh session. + +- Connect to a remote server using a password supplied on a file descriptor (in this case, stdin): + +`sshpass -d {{0}} ssh {{user}}@{{hostname}}` + +- Connect to a remote server with the password supplied as an option, and automatically accept unknown ssh keys: + +`sshpass -p {{password}} ssh -o StrictHostKeyChecking=no {{user}}@{{hostname}}` + +- Connect to a remote server using the first line of a file as the password, automatically accept unknown ssh keys, and launch a command: + +`sshpass -f {{file}} ssh -o StrictHostKeyChecking=no {{user}}@{{hostname}} "{{command}}"` diff --git a/pages.cn/common/st-flash.md b/pages.cn/common/st-flash.md new file mode 100644 index 0000000000..957bb89306 --- /dev/null +++ b/pages.cn/common/st-flash.md @@ -0,0 +1,15 @@ +# st-flash + +> Flash binary files to STM32 ARM Cortex microcontrollers. + +- Read 4096 bytes from the device starting from 0x8000000: + +`st-flash read {{firmware}}.bin {{0x8000000}} {{4096}}` + +- Write firmware to device starting from 0x8000000: + +`st-flash write {{firmware}}.bin {{0x8000000}}` + +- Erase firmware from device: + +`st-flash erase` diff --git a/pages.cn/common/st-info.md b/pages.cn/common/st-info.md new file mode 100644 index 0000000000..3cfe37a407 --- /dev/null +++ b/pages.cn/common/st-info.md @@ -0,0 +1,15 @@ +# st-info + +> Provides information about connected STLink and STM32 devices. + +- Display amount of program memory available: + +`st-info --flash` + +- Display amount of sram memory available: + +`st-info --sram` + +- Display summarized information of the device: + +`st-info --probe` diff --git a/pages.cn/common/st-util.md b/pages.cn/common/st-util.md new file mode 100644 index 0000000000..4cef470cd2 --- /dev/null +++ b/pages.cn/common/st-util.md @@ -0,0 +1,15 @@ +# st-util + +> Run GDB (GNU Debugger) server to interact with STM32 ARM Cortex microcontoller. + +- Run GDB server on port 4500: + +`st-util -p {{4500}}` + +- Connect to GDB server: + +`(gdb) target extended-remote {{localhost}}:{{4500}}` + +- Write firmware to device: + +`(gdb) load {{firmware.elf}}` diff --git a/pages.cn/common/stack.md b/pages.cn/common/stack.md new file mode 100644 index 0000000000..8134636f9f --- /dev/null +++ b/pages.cn/common/stack.md @@ -0,0 +1,31 @@ +# stack + +> Tool for managing Haskell projects. + +- Create a new project: + +`stack new {{project_name}}` + +- Install all packages needed by a project: + +`stack install` + +- Compile a project: + +`stack build` + +- Run tests inside a project: + +`stack test` + +- Compile a project and re-compile every time a file changes: + +`stack build --file-watch` + +- Compile a project and execute a command after compilation: + +`stack build --exec "{{command}}"` + +- Run a program and pass an argument to it: + +`stack exec {{program_name}} -- {{argument}}` diff --git a/pages.cn/common/standard.md b/pages.cn/common/standard.md new file mode 100644 index 0000000000..10c2ccd9fa --- /dev/null +++ b/pages.cn/common/standard.md @@ -0,0 +1,31 @@ +# standard + +> The JavaScript Standard Style tool for linting and fixing JavaScript code. + +- Lint all JavaScript source files in the current directory: + +`standard` + +- Lint specific JavaScript file(s): + +`standard {{path/to/file(s)}}` + +- Apply automatic fixes during linting: + +`standard --fix` + +- Declare any available global variables: + +`standard --global {{variable}}` + +- Use a custom ESLint plugin when linting: + +`standard --plugin {{plugin}}` + +- Use a custom JS parser when linting: + +`standard --parser {{parser}}` + +- Use a custom ESLint environment when linting: + +`standard --env {{environment}}` diff --git a/pages.cn/common/stat.md b/pages.cn/common/stat.md new file mode 100644 index 0000000000..734d288732 --- /dev/null +++ b/pages.cn/common/stat.md @@ -0,0 +1,27 @@ +# stat + +> Display file and filesystem information. + +- Show file properties such as size, permissions, creation and access dates among others: + +`stat {{file}}` + +- Same as above but in a more concise way: + +`stat -t {{file}}` + +- Show filesystem information: + +`stat -f {{file}}` + +- Show only octal file permissions: + +`stat -c "%a %n" {{file}}` + +- Show owner and group of the file: + +`stat -c "%U %G" {{file}}` + +- Show the size of the file in bytes: + +`stat -c "%s %n" {{file}}` diff --git a/pages.cn/common/stdbuf.md b/pages.cn/common/stdbuf.md new file mode 100644 index 0000000000..33886266a8 --- /dev/null +++ b/pages.cn/common/stdbuf.md @@ -0,0 +1,15 @@ +# stdbuf + +> Run a command with modified buffering operations for its standard streams. + +- Change the standard input buffer size to 512 KiB: + +`stderr --input={{512K}} {{command}}` + +- Change the standard output buffer to line-buffered: + +`stdbuf --output={{L}} {{command}}` + +- Change the standard error buffer to unbuffered: + +`stdbuf --error={{0}} {{command}}` diff --git a/pages.cn/common/stolonctl.md b/pages.cn/common/stolonctl.md new file mode 100644 index 0000000000..24a639e7a5 --- /dev/null +++ b/pages.cn/common/stolonctl.md @@ -0,0 +1,19 @@ +# Stolon + +> A cloud native PostgreSQL manager for PostgreSQL high availability. + +- Get cluster status: + +`stolonctl --cluster-name {{cluster_name}} --store-backend {{store_backend}} --store-endpoints {{store_endpoints}} status` + +- Get cluster data: + +`stolonctl --cluster-name {{cluster_name}} --store-backend {{store_backend}} --store-endpoints {{store_endpoints}} clusterdata` + +- Get cluster specification: + +`stolonctl --cluster-name {{cluster_name}} --store-backend {{store_backend}} --store-endpoints {{store_endpoints}} spec` + +- Update cluster specification with a patch in json format: + +`stolonctl --cluster-name {{cluster_name}} --store-backend {{store_backend}} --store-endpoints {{store_endpoints}} update --patch '{{cluster_spec}}'` diff --git a/pages.cn/common/stow.md b/pages.cn/common/stow.md new file mode 100644 index 0000000000..a89e0163e2 --- /dev/null +++ b/pages.cn/common/stow.md @@ -0,0 +1,24 @@ +# stow + +> Symlink manager. +> Often used to manage dotfiles. + +- Symlink all files recursively to a given directory: + +`stow --target={{path/to/target_directory}} {{file1 folder1 file2 folder2}}` + +- Delete symlinks recursively from a given directory: + +`stow --delete --target={{path/to/target_directory}} {{file1 folder1 file2 folder2}}` + +- Simulate to see what the result would be like: + +`stow --simulate --target={{path/to/target_directory}} {{file1 folder1 file2 folder2}}` + +- Delete and resymlink: + +`stow --restow --target={{path/to/target_directory}} {{file1 folder1 file2 folder2}}` + +- Exclude files matching a regular expression: + +`stow --ignore={{regex}} --target={{path/to/target_directory}} {{file1 folder1 file2 folder2}}` diff --git a/pages.cn/common/strings.md b/pages.cn/common/strings.md new file mode 100644 index 0000000000..d430d3b979 --- /dev/null +++ b/pages.cn/common/strings.md @@ -0,0 +1,19 @@ +# strings + +> Find printable strings in an object file or binary. + +- Print all strings in a binary: + +`strings {{file}}` + +- Limit results to strings at least *length* characters long: + +`strings -n {{length}} {{file}}` + +- Prefix each result with its offset within the file: + +`strings -t d {{file}}` + +- Prefix each result with its offset within the file in hexadecimal: + +`strings -t x {{file}}` diff --git a/pages.cn/common/stty.md b/pages.cn/common/stty.md new file mode 100644 index 0000000000..51a85fee33 --- /dev/null +++ b/pages.cn/common/stty.md @@ -0,0 +1,23 @@ +# stty + +> Set options for a terminal device interface. + +- Display all settings for the current terminal: + +`stty -a` + +- Set the number of rows: + +`stty rows {{rows}}` + +- Set the number of columns: + +`stty cols {{cols}}` + +- Get the actual transfer speed of a device: + +`stty -f {{path/to/device_file}} speed` + +- Reset all modes to reasonable values for the current terminal: + +`stty sane` diff --git a/pages.cn/common/su.md b/pages.cn/common/su.md new file mode 100644 index 0000000000..65f167d39c --- /dev/null +++ b/pages.cn/common/su.md @@ -0,0 +1,15 @@ +# su + +> Switch shell to another user. + +- Switch to user {{username}} (password required): + +`su {{username}}` + +- Switch to superuser (admin password required): + +`su` + +- Switch to user {{username}} and simulate a full login shell: + +`su - {{username}}` diff --git a/pages.cn/common/subfinder.md b/pages.cn/common/subfinder.md new file mode 100644 index 0000000000..7ed836f416 --- /dev/null +++ b/pages.cn/common/subfinder.md @@ -0,0 +1,24 @@ +# subfinder + +> A subdomain discovery tool that discovers valid subdomains for websites. +> Designed as a passive framework to be useful for bug bounties and safe for penetration testing. + +- Find subdomains for a specific domain: + +`subfinder -d {{example.com}}` + +- Show only the subdomains found: + +`subfinder --silent -d {{example.com}}` + +- Use bruteforcing to find subdomains: + +`subfinder -d {{example.com}} -b` + +- Remove wildcard subdomains: + +`subfinder -nW -d {{example.com}}` + +- Use a given comma-separated list of resolvers: + +`subfinder -r {{8.8.8.8}},{{1.1.1.1}} -d {{example.com}}` diff --git a/pages.cn/common/subl.md b/pages.cn/common/subl.md new file mode 100644 index 0000000000..765c998be7 --- /dev/null +++ b/pages.cn/common/subl.md @@ -0,0 +1,19 @@ +# subl + +> Sublime Text editor. + +- Open the current directory in Sublime Text: + +`subl {{.}}` + +- Open a file or directory in Sublime Text: + +`subl {{path/to/file_or_folder}}` + +- Open a file or directory in the currently open window: + +`subl -a {{path/to/file}}` + +- Open a file or directory in a new window: + +`subl -n {{path/to/file}}` diff --git a/pages.cn/common/subliminal.md b/pages.cn/common/subliminal.md new file mode 100644 index 0000000000..46f15c2813 --- /dev/null +++ b/pages.cn/common/subliminal.md @@ -0,0 +1,7 @@ +# subliminal + +> Python-based subtitle downloader. + +- Download English subtitles for a video: + +`subliminal download -l {{en}} {{video.ext}}` diff --git a/pages.cn/common/sudo.md b/pages.cn/common/sudo.md new file mode 100644 index 0000000000..8a85014dc2 --- /dev/null +++ b/pages.cn/common/sudo.md @@ -0,0 +1,23 @@ +# sudo + +> Executes a single command as the superuser or another user. + +- Run a command as the superuser: + +`sudo {{less /var/log/syslog}}` + +- Edit a file as the superuser with your default editor: + +`sudo -e {{/etc/fstab}}` + +- Run a command as another user and/or group: + +`sudo -u {{user}} -g {{group}} {{id -a}}` + +- Repeat the last command prefixed with "sudo" (only in bash, zsh, etc.): + +`sudo !!` + +- Launch the default shell with superuser privileges: + +`sudo -i` diff --git a/pages.cn/common/sum.md b/pages.cn/common/sum.md new file mode 100644 index 0000000000..23ee6817a6 --- /dev/null +++ b/pages.cn/common/sum.md @@ -0,0 +1,12 @@ +# sum + +> Compute checksums and the number of blocks for a file. +> A predecessor to the more modern `cksum`. + +- Compute a checksum with BSD-compatible algorithm and 1024-byte blocks: + +`sum {{file}}` + +- Compute a checksum with System V-compatible algorithm and 512-byte blocks: + +`sum --sysv {{file}}` diff --git a/pages.cn/common/supervisorctl.md b/pages.cn/common/supervisorctl.md new file mode 100644 index 0000000000..1eb5a0f3ad --- /dev/null +++ b/pages.cn/common/supervisorctl.md @@ -0,0 +1,24 @@ +# supervisorctl + +> Supervisor is a client/server system that allows its users to control a number of processes on UNIX-like operating systems. +> Supervisorctl is the command-line client piece of the supervisor which provides a shell-like interface. + +- Start/stop/restart a process: + +`supervisorctl {{start|stop|restart}} {{process_name}}` + +- Start/stop/restart all processes in a group: + +`supervisorctl {{start|stop|restart}} {{group_name}}:*` + +- Show last 100 **bytes** of process stderr: + +`supervisorctl tail -100 {{process_name}} stderr` + +- Keep displaying stdout of a process: + +`supervisorctl tail -f {{process_name}} stdout` + +- Reload process config file to add/remove processes as necessary: + +`supervisorctl update` diff --git a/pages.cn/common/supervisord.md b/pages.cn/common/supervisord.md new file mode 100644 index 0000000000..9a58ddbceb --- /dev/null +++ b/pages.cn/common/supervisord.md @@ -0,0 +1,12 @@ +# supervisord + +> Supervisor is a client/server system for controlling some processes on UNIX-like operating systems. +> Supervisord is the server part of supervisor; it is primarily managed via a configuration file. + +- Start supervisord with specified configuration file: + +`supervisord -c {{path/to/file}}` + +- Run supervisord in the foreground: + +`supervisord -n` diff --git a/pages.cn/common/surge.md b/pages.cn/common/surge.md new file mode 100644 index 0000000000..832a383479 --- /dev/null +++ b/pages.cn/common/surge.md @@ -0,0 +1,19 @@ +# surge + +> Simple command line web publishing. + +- Upload a new site to surge.sh: + +`surge {{path/to/my_project}}` + +- Deploy site to custom domain (note that the DNS records must point to the surge.sh subdomain): + +`surge {{path/to/my_project}} {{my_custom_domain.com}}` + +- List your surge projects: + +`surge list` + +- Remove a project: + +`surge teardown {{my_custom_domain.com}}` diff --git a/pages.cn/common/svgcleaner.md b/pages.cn/common/svgcleaner.md new file mode 100644 index 0000000000..f741c1f127 --- /dev/null +++ b/pages.cn/common/svgcleaner.md @@ -0,0 +1,11 @@ +# svgcleaner + +> SVG image optimizing utility. + +- Optimize an SVG image: + +`svgcleaner {{input.svg}} {{output.svg}}` + +- Optimize an SVG image multiple times: + +`svgcleaner --multipass {{input.svg}} {{output.svg}}` diff --git a/pages.cn/common/svgo.md b/pages.cn/common/svgo.md new file mode 100644 index 0000000000..75a920d95c --- /dev/null +++ b/pages.cn/common/svgo.md @@ -0,0 +1,36 @@ +# svgo + +> SVG Optimizer: a Nodejs-based tool for optimizing Scalable Vector Graphics files. +> It applies a series of transformation rules (plugins), which can be toggled individually. + +- Optimize a file using the default plugins (overwrites the original file): + +`svgo {{test.svg}}` + +- Optimize a file and save the result to another file: + +`svgo {{test.svg}} {{test.min.svg}}` + +- Optimize all SVG files within a folder (overwrites the original files): + +`svgo -f {{path/to/folder/with/svg/files}}` + +- Optimize all SVG files within a folder and save the resulting files to another folder: + +`svgo -f {{path/to/input/folder}} -o {{path/to/output/folder}}` + +- Optimize SVG content passed from another command, and save the result to a file: + +`{{cat test.svg}} | svgo -i - -o {{test.min.svg}}` + +- Optimize a file and print out the result: + +`svgo {{test.svg}} -o -` + +- Optimize a file making sure a given plugin is enabled: + +`svgo --enable={{plugin_name}}` + +- Show available plugins: + +`svgo --show-plugins` diff --git a/pages.cn/common/svn.md b/pages.cn/common/svn.md new file mode 100644 index 0000000000..192cacd3ce --- /dev/null +++ b/pages.cn/common/svn.md @@ -0,0 +1,27 @@ +# svn + +> Subversion command line client tool. + +- Check out a working copy from a repository: + +`svn co {{url/to/repository}}` + +- Bring changes from the repository into the working copy: + +`svn up` + +- Put files and directories under version control, scheduling them for addition to repository. They will be added in next commit: + +`svn add PATH...` + +- Send changes from your working copy to the repository: + +`svn ci -m {{commit log message}} {{[PATH...]}}` + +- Display changes from the last 10 revisions, showing modified files for each revision: + +`svn log -vl {{10}}` + +- Show detailed help: + +`svn help` diff --git a/pages.cn/common/swagger-codegen.md b/pages.cn/common/swagger-codegen.md new file mode 100644 index 0000000000..851c6d632f --- /dev/null +++ b/pages.cn/common/swagger-codegen.md @@ -0,0 +1,19 @@ +# swagger-codegen + +> Generate code and documentation for your REST api from a OpenAPI/swagger definition. + +- Generate documentation and code from an OpenAPI/swagger file: + +`swagger-codegen generate -i {{swagger_file}} -l {{language}}` + +- Generate java code using the library retrofit2 and the option useRxJava2: + +`swagger-codegen generate -i {{http://petstore.swagger.io/v2/swagger.json}} -l {{java}} --library {{retrofit2}} -D{{useRxJava2}}={{true}}` + +- List available languages: + +`swagger-codegen langs` + +- Display help options for the generate command: + +`swagger-codegen help {{generate}}` diff --git a/pages.cn/common/swift.md b/pages.cn/common/swift.md new file mode 100644 index 0000000000..6e7a4aa02e --- /dev/null +++ b/pages.cn/common/swift.md @@ -0,0 +1,27 @@ +# swift + +> Create, run and build Swift projects. + +- Invoke the interactive interpreter (REPL): + +`swift` + +- Execute a program: + +`swift {{file.swift}}` + +- Start a new project with the package manager: + +`swift package init` + +- Generate an Xcode project file: + +`swift package generate-xcodeproj` + +- Update dependencies: + +`swift package update` + +- Compile project for release: + +`swift build -c release` diff --git a/pages.cn/common/sync.md b/pages.cn/common/sync.md new file mode 100644 index 0000000000..a5faab24c3 --- /dev/null +++ b/pages.cn/common/sync.md @@ -0,0 +1,11 @@ +# sync + +> Flushes all pending write operations to the appropriate disks. + +- Flush all pending write operations on all disks: + +`sync` + +- Flush all pending write operations on a single file to disk: + +`sync {{path/to/file}}` diff --git a/pages.cn/common/tabula.md b/pages.cn/common/tabula.md new file mode 100644 index 0000000000..58d0bde68a --- /dev/null +++ b/pages.cn/common/tabula.md @@ -0,0 +1,27 @@ +# tabula + +> Extract tables from PDF files. + +- Extract all tables from a PDF to a CSV file: + +`tabula -o {{file.csv}} {{file.pdf}}` + +- Extract all tables from a PDF to a JSON file: + +`tabula --format JSON -o {{file.json}} {{file.pdf}}` + +- Extract tables from pages 1, 2, 3, and 6 of a PDF: + +`tabula --pages {{1-3,6}} {{file.pdf}}` + +- Extract tables from page 1 of a PDF, guessing which portion of the page to examine: + +`tabula --guess --pages {{1}} {{file.pdf}}` + +- Extract all tables from a PDF, using ruling lines to determine cell boundaries: + +`tabula --spreadsheet {{file.pdf}}` + +- Extract all tables from a PDF, using blank space to determine cell boundaries: + +`tabula --no-spreadsheet {{file.pdf}}` diff --git a/pages.cn/common/tac.md b/pages.cn/common/tac.md new file mode 100644 index 0000000000..cbdd9c2b1d --- /dev/null +++ b/pages.cn/common/tac.md @@ -0,0 +1,11 @@ +# tac + +> Print and concatenate files in reverse. + +- Print the contents of *file1* reversed to the standard output: + +`tac {{file1}}` + +- Concatenate several files reversed into the target file: + +`tac {{file1}} {{file2}} > {{target_file}}` diff --git a/pages.cn/common/tail.md b/pages.cn/common/tail.md new file mode 100644 index 0000000000..1c6f82aee9 --- /dev/null +++ b/pages.cn/common/tail.md @@ -0,0 +1,23 @@ +# tail + +> Display the last part of a file. + +- Show last 'num' lines in file: + +`tail -n {{num}} {{file}}` + +- Show all file since line 'num': + +`tail -n +{{num}} {{file}}` + +- Show last 'num' bytes in file: + +`tail -c {{num}} {{file}}` + +- Keep reading file until `Ctrl + C`: + +`tail -f {{file}}` + +- Keep reading file until `Ctrl + C`, even if the file is rotated: + +`tail -F {{file}}` diff --git a/pages.cn/common/tar.md b/pages.cn/common/tar.md new file mode 100644 index 0000000000..9e41fb0403 --- /dev/null +++ b/pages.cn/common/tar.md @@ -0,0 +1,36 @@ +# tar + +> Archiving utility. +> Often combined with a compression method, such as gzip or bzip. + +- Create an archive from files: + +`tar cf {{target.tar}} {{file1 file2 file3}}` + +- Create a gzipped archive: + +`tar czf {{target.tar.gz}} {{file1 file2 file3}}` + +- Extract an archive in a target folder: + +`tar xf {{source.tar}} -C {{folder}}` + +- Extract a gzipped archive in the current directory: + +`tar xzf {{source.tar.gz}}` + +- Extract a bzipped archive in the current directory: + +`tar xjf {{source.tar.bz2}}` + +- Create a compressed archive, using archive suffix to determine the compression program: + +`tar caf {{target.tar.xz}} {{file1 file2 file3}}` + +- List the contents of a tar file: + +`tar tvf {{source.tar}}` + +- Extract files matching a pattern: + +`tar xf {{source.tar}} --wildcards {{"*.html"}}` diff --git a/pages.cn/common/task.md b/pages.cn/common/task.md new file mode 100644 index 0000000000..8f5d5ac99d --- /dev/null +++ b/pages.cn/common/task.md @@ -0,0 +1,23 @@ +# task + +> TODO list manager. + +- Add new task: + +`task add {{thing_to_do}}` + +- List tasks: + +`task list` + +- Mark task as completed: + +`task {{task_id}} done` + +- Modify task: + +`task {{task_id}} modify {{new_thing_to_do}}` + +- Delete task: + +`task {{task_id}} delete` diff --git a/pages.cn/common/tb.md b/pages.cn/common/tb.md new file mode 100644 index 0000000000..635ee04451 --- /dev/null +++ b/pages.cn/common/tb.md @@ -0,0 +1,27 @@ +# tb + +> CLI for managing tasks and notes across multiple boards. + +- Add a new task to a board: + +`tb --task {{task description}} @{{board_name}}` + +- Add a new note to a board: + +`tb --note {{note description}} @{{board_name}}` + +- Edit item's priority: + +`tb --priority @{{item_id}} {{priority}}` + +- Check/uncheck item: + +`tb --check {{item_id}}` + +- Archive all checked items: + +`tb --clear` + +- Move item to a board: + +`tb --move @{{item_id}} {{board_name}}` diff --git a/pages.cn/common/tcpdump.md b/pages.cn/common/tcpdump.md new file mode 100644 index 0000000000..5eb6baca2f --- /dev/null +++ b/pages.cn/common/tcpdump.md @@ -0,0 +1,35 @@ +# tcpdump + +> Dump traffic on a network. + +- List available network interfaces: + +`tcpdump -D` + +- Capture the traffic of a specific interface: + +`tcpdump -i {{eth0}}` + +- Capture all TCP traffic showing contents (ASCII) in console: + +`tcpdump -A tcp` + +- Capture the traffic from or to a host: + +`tcpdump host {{www.example.com}}` + +- Capture the traffic from a specific interface, source, destination and destination port: + +`tcpdump -i {{eth0}} src {{192.168.1.1}} and dst {{192.168.1.2}} and dst port {{80}}` + +- Capture the traffic of a network: + +`tcpdump net {{192.168.1.0/24}}` + +- Capture all traffic except traffic over port 22 and save to a dump file: + +`tcpdump -w {{dumpfile.pcap}} not port {{22}}` + +- Read from a given dump file: + +`tcpdump -r {{dumpfile.pcap}}` diff --git a/pages.cn/common/tee.md b/pages.cn/common/tee.md new file mode 100644 index 0000000000..e29eabd215 --- /dev/null +++ b/pages.cn/common/tee.md @@ -0,0 +1,19 @@ +# tee + +> Read from standard input and write to standard output and files (or commands). + +- Copy standard input to each FILE, and also to standard output: + +`echo "example" | tee {{FILE}}` + +- Append to the given FILEs, do not overwrite: + +`echo "example" | tee -a {{FILE}}` + +- Print standard input to the terminal, and also pipe it into another program for further processing: + +`echo "example" | tee {{/dev/tty}} | {{xargs printf "[%s]"}}` + +- Create a folder called "example", count the number of characters in "example" and write "example" to the terminal: + +`echo "example" | tee >(xargs mkdir) >(wc -c)` diff --git a/pages.cn/common/telnet.md b/pages.cn/common/telnet.md new file mode 100644 index 0000000000..ba4ebcddf1 --- /dev/null +++ b/pages.cn/common/telnet.md @@ -0,0 +1,23 @@ +# telnet + +> Connect to a specified port of a host using the telnet protocol. + +- Telnet to the default port of a host: + +`telnet {{host}}` + +- Telnet to a specific port of a host: + +`telnet {{ip_address}} {{port}}` + +- Exit a telnet session: + +`quit` + +- Emit the default escape character combination for terminating the session: + +`Ctrl + ]` + +- Start telnet with "x" as the session termination character: + +`telnet -e {{x}} {{ip_address}} {{port}}` diff --git a/pages.cn/common/terraform.md b/pages.cn/common/terraform.md new file mode 100644 index 0000000000..0736cf62a6 --- /dev/null +++ b/pages.cn/common/terraform.md @@ -0,0 +1,19 @@ +# terraform + +> Create and deploy infrastructure as code to cloud providers. + +- Initialize a new or existing Terraform configuration: + +`terraform init` + +- Generate and show an execution plan: + +`terraform plan` + +- Build or change infrastructure: + +`terraform apply` + +- Destroy Terraform-managed infrastructure: + +`terraform destroy` diff --git a/pages.cn/common/tesseract.md b/pages.cn/common/tesseract.md new file mode 100644 index 0000000000..7e49b3092c --- /dev/null +++ b/pages.cn/common/tesseract.md @@ -0,0 +1,23 @@ +# tesseract + +> OCR (Optical Character Recognition) engine. + +- Recognize text in an image and save it to `output.txt` (the '.txt' extension is added automatically): + +`tesseract {{image.png}} {{output}}` + +- Specify a custom language (default is English) with an ISO 639-2 code (e.g. deu = Deutsch = German): + +`tesseract -l deu {{image.png}} {{output}}` + +- List the ISO 639-2 codes of available languages: + +`tesseract --list-langs` + +- Specify a custom page segmentation mode (default is 3): + +`tesseract -psm {{0_to_10}} {{image.png}} {{output}}` + +- List page segmentation modes and their descriptions: + +`tesseract --help-psm` diff --git a/pages.cn/common/test.md b/pages.cn/common/test.md new file mode 100644 index 0000000000..ade6a44e79 --- /dev/null +++ b/pages.cn/common/test.md @@ -0,0 +1,24 @@ +# test + +> Evaluate condition. +> If it is true, returns 0 exit status, otherwise returns 1. + +- Test if given variable is equal to given string: + +`test $MY_VAR == '/bin/zsh'` + +- Test if given variable is empty: + +`test -z $GIT_BRANCH` + +- Test if file exists: + +`test -e {{filename}}` + +- Test if directory not exists: + +`test ! -d {{path/to/directory}}` + +- If-else statement: + +`test {{condition}} && echo "true" || echo "false"` diff --git a/pages.cn/common/tig.md b/pages.cn/common/tig.md new file mode 100644 index 0000000000..eb4b4df47d --- /dev/null +++ b/pages.cn/common/tig.md @@ -0,0 +1,27 @@ +# tig + +> A text-mode interface for Git. + +- Show the sequence of commits starting from the current one in reverse chronological order: + +`tig` + +- Show the history of a specific branch: + +`tig {{branch}}` + +- Show the history of specific files or directories: + +`tig {{path1}} {{path2}} ...` + +- Show the difference between two references (such as branches or tags): + +`tig {{base_ref}}..{{compared_ref}}` + +- Display commits from all branches and stashes: + +`tig --all` + +- Start in stash view, displaying all saved stashes: + +`tig stash` diff --git a/pages.cn/common/time.md b/pages.cn/common/time.md new file mode 100644 index 0000000000..d4dd058bcf --- /dev/null +++ b/pages.cn/common/time.md @@ -0,0 +1,7 @@ +# time + +> See how long a command takes. + +- Time "ls": + +`time ls` diff --git a/pages.cn/common/timeout.md b/pages.cn/common/timeout.md new file mode 100644 index 0000000000..642734a188 --- /dev/null +++ b/pages.cn/common/timeout.md @@ -0,0 +1,11 @@ +# timeout + +> Run a command with a time limit. + +- Run `sleep 10` and kill it, if it's running after 3 seconds: + +`timeout {{3s}} {{sleep 10}}` + +- Specify the signal to be sent to the command after the time limit expires. (By default, TERM is sent): + +`timeout --signal {{INT}} {{5s}} {{sleep 10}}` diff --git a/pages.cn/common/timew.md b/pages.cn/common/timew.md new file mode 100644 index 0000000000..c758fd223b --- /dev/null +++ b/pages.cn/common/timew.md @@ -0,0 +1,23 @@ +# timew + +> A time tracking tool used to measure the duration of activities. + +- Start a new stopwatch, giving a tag name to the activity being tracked: + +`timew start {{activity_tag}}` + +- View running stopwatches: + +`timew` + +- Stop the stopwatch with a given tag name: + +`timew stop {{activity_tag}}` + +- Stop all running stopwatches: + +`timew stop` + +- View tracked items: + +`timew summary` diff --git a/pages.cn/common/tldr.md b/pages.cn/common/tldr.md new file mode 100644 index 0000000000..2c7b1e100e --- /dev/null +++ b/pages.cn/common/tldr.md @@ -0,0 +1,7 @@ +# tldr + +> Simplified man pages. + +- Get typical usages of a command (hint: this is how you got here!): + +`tldr {{command}}` diff --git a/pages.cn/common/tldrl.md b/pages.cn/common/tldrl.md new file mode 100644 index 0000000000..7bee9a64a1 --- /dev/null +++ b/pages.cn/common/tldrl.md @@ -0,0 +1,15 @@ +# tldrl + +> Lint and format TLDR pages. + +- Lint all pages: + +`tldrl {{pages_directory}}` + +- Format a specific page to stdout: + +`tldrl -f {{page.md}}` + +- Format all pages in place: + +`tldrl -fi {{pages_directory}}` diff --git a/pages.cn/common/tmux.md b/pages.cn/common/tmux.md new file mode 100644 index 0000000000..e375187463 --- /dev/null +++ b/pages.cn/common/tmux.md @@ -0,0 +1,35 @@ +# tmux + +> Multiplex several virtual consoles. + +- Start a new tmux session: + +`tmux` + +- Start a new named tmux session: + +`tmux new -s {{name}}` + +- List sessions: + +`tmux ls` + +- Attach to a session: + +`tmux a` + +- Attach to a named session: + +`tmux a -t {{name}}` + +- Detach from session: + +`Ctrl + B, D` + +- Kill session: + +`tmux kill-session -t {{name}}` + +- Kill session when attached: + +`Ctrl + B, x (then hit 'y' for yes)` diff --git a/pages.cn/common/tokei.md b/pages.cn/common/tokei.md new file mode 100644 index 0000000000..2090b2d863 --- /dev/null +++ b/pages.cn/common/tokei.md @@ -0,0 +1,19 @@ +# tokei + +> A program that prints out statistics about code. + +- Get a report on the code in a folder and all subfolders: + +`tokei {{path/to/folder}}` + +- Get a report for a folder excluding `.min.js` files: + +`tokei {{path/to/folder}} -e {{*.min.js}}` + +- Print out statistics for individual files in a folder: + +`tokei {{path/to/folder}} --files` + +- Get a report for all files of type Rust and Markdown: + +`tokei {{path/to/folder}} -t={{Rust}},{{Markdown}}` diff --git a/pages.cn/common/touch.md b/pages.cn/common/touch.md new file mode 100644 index 0000000000..87efa390cc --- /dev/null +++ b/pages.cn/common/touch.md @@ -0,0 +1,15 @@ +# touch + +> Change a file access and modification times (atime, mtime). + +- Create a new empty file(s) or change the times for existing file(s) to current time: + +`touch {{filename}}` + +- Set the times on a file to a specific date and time: + +`touch -t {{YYYYMMDDHHMM.SS}} {{filename}}` + +- Use the times from a file to set the times on a second file: + +`touch -r {{filename}} {{filename2}}` diff --git a/pages.cn/common/tox.md b/pages.cn/common/tox.md new file mode 100644 index 0000000000..7794df9eaa --- /dev/null +++ b/pages.cn/common/tox.md @@ -0,0 +1,24 @@ +# tox + +> Automate Python testing across multiple Python versions. +> Use tox.ini to configure environments and test command. + +- Run tests on all test environments: + +`tox` + +- Create a tox.ini configuration: + +`tox-quickstart` + +- List the available environments: + +`tox --listenvs-all` + +- Run tests on a specific environment (e.g. python 3.6): + +`tox -e {{py36}}` + +- Force the virtual environment to be recreated: + +`tox --recreate -e {{py27}}` diff --git a/pages.cn/common/tpp.md b/pages.cn/common/tpp.md new file mode 100644 index 0000000000..45b12bf09a --- /dev/null +++ b/pages.cn/common/tpp.md @@ -0,0 +1,11 @@ +# tpp + +> Command-Line based presentation tool. + +- View a presentation: + +`tpp {{filename}}` + +- Output a presentation: + +`tpp -t {{type}} -o {{outputname}} {{filename}}` diff --git a/pages.cn/common/tput.md b/pages.cn/common/tput.md new file mode 100644 index 0000000000..f1f9279b2b --- /dev/null +++ b/pages.cn/common/tput.md @@ -0,0 +1,27 @@ +# tput + +> View and modify terminal settings and capabilities. + +- Move the cursor to a screen location: + +`tput cup {{y_coordinate}} {{x_coordinate}}` + +- Set foreground (af) or background (ab) color: + +`tput {{setaf|setab}} {{ansi_color_code}}` + +- Show number of columns, lines, or colors: + +`tput {{cols|lines|colors}}` + +- Ring the terminal bell: + +`tput bel` + +- Reset all terminal attributes: + +`tput sgr0` + +- Enable / Disable word wrap: + +`tput {{smam|rmam}}` diff --git a/pages.cn/common/tr.md b/pages.cn/common/tr.md new file mode 100644 index 0000000000..024d128cea --- /dev/null +++ b/pages.cn/common/tr.md @@ -0,0 +1,27 @@ +# tr + +> Translate characters - run replacements based on single characters and character sets. + +- Replace all occurrences of a character in a file, and print the result: + +`tr {{find_characters}} {{replace_characters}} < {{filename}}` + +- Map each character of the first set to the corresponding character of the second set: + +`tr 'abcd' 'jkmn' < {{filename}}` + +- Delete all occurrences of the specified set of characters from the input: + +`tr -d '{{input_characters}}'` + +- Compress a series of identical characters to a single character: + +`tr -s '{{input_characters}}'` + +- Translate the contents of the file to upper-case and print result: + +`tr "[:lower:]" "[:upper:]" < {{filename}}` + +- Strip out non-printable characters from the file and print result: + +`tr -cd "[:print:]" < {{filename}}` diff --git a/pages.cn/common/traceroute.md b/pages.cn/common/traceroute.md new file mode 100644 index 0000000000..fc57488f5a --- /dev/null +++ b/pages.cn/common/traceroute.md @@ -0,0 +1,23 @@ +# traceroute + +> Print the route packets trace to network host. + +- Traceroute to a host: + +`traceroute {{host}}` + +- Disable IP address and host name mapping: + +`traceroute -n {{host}}` + +- Specify wait time for response: + +`traceroute -w {{0.5}} {{host}}` + +- Specify number of queries per hop: + +`traceroute -q {{5}} {{host}}` + +- Specify size in bytes of probing packet: + +`traceroute {{host}} {{42}}` diff --git a/pages.cn/common/traefik.md b/pages.cn/common/traefik.md new file mode 100644 index 0000000000..3ea707de03 --- /dev/null +++ b/pages.cn/common/traefik.md @@ -0,0 +1,19 @@ +# traefik + +> A HTTP reverse proxy and load balancer. + +- Start server with default config: + +`traefik` + +- Start server with a custom config file: + +`traefik --c {{config_file}}.toml` + +- Start server with cluster mode enabled: + +`traefik --cluster` + +- Start server with web UI enabled: + +`traefik --web` diff --git a/pages.cn/common/trans.md b/pages.cn/common/trans.md new file mode 100644 index 0000000000..244273cc5e --- /dev/null +++ b/pages.cn/common/trans.md @@ -0,0 +1,23 @@ +# trans + +> Translate Shell is a command-line translator. + +- Translate a word (language is detected automatically): + +`trans "{{word_or_sentence_to_translate}}"` + +- Get a brief translation: + +`trans --brief "{{word_or_sentence_to_translate}}"` + +- Translate a word into french: + +`trans :{{fr}} {{word}}` + +- Translate a word from German to English: + +`trans {{de}}:{{en}} {{Schmetterling}}` + +- Behave like a dictionary to get the meaning of a word: + +`trans -d {{word}}` diff --git a/pages.cn/common/transcode.md b/pages.cn/common/transcode.md new file mode 100644 index 0000000000..63a83a5f29 --- /dev/null +++ b/pages.cn/common/transcode.md @@ -0,0 +1,15 @@ +# transcode + +> Transcode video and audio codecs, and convert between media formats. + +- Create stabilisation file to be able to remove camera shakes: + +`transcode -J stabilize -i {{input_file}}` + +- Remove camera shakes after creating stabilisation file, transform video using xvid: + +`transcode -J transform -i {{input_file}} -y xvid -o {{output_file}}` + +- Resize the video to 640x480 pixels and convert to MPEG4 codec using xvid: + +`transcode -Z 640x480 -i {{input_file}} -y xvid -o {{output_file}}` diff --git a/pages.cn/common/trash-cli.md b/pages.cn/common/trash-cli.md new file mode 100644 index 0000000000..611ead3ffb --- /dev/null +++ b/pages.cn/common/trash-cli.md @@ -0,0 +1,23 @@ +# trash-cli + +> A command line interface to the trashcan APIs. + +- Trash files and directories: + +`trash-put {{file_name}}` + +- Empty the trashcan: + +`trash-empty` + +- List trashed files: + +`trash-list` + +- Restore a trashed file by choosing a number from the list that results from this command: + +`trash-restore` + +- Remove individual files from the trashcan: + +`trash-rm {{file_name}}` diff --git a/pages.cn/common/true.md b/pages.cn/common/true.md new file mode 100644 index 0000000000..cb25e15fcc --- /dev/null +++ b/pages.cn/common/true.md @@ -0,0 +1,8 @@ +# true + +> Returns a successful exit status code of 0. +> Use this with the || operator to make a command always exit with 0. + +- Return a successful exit code: + +`true` diff --git a/pages.cn/common/truncate.md b/pages.cn/common/truncate.md new file mode 100644 index 0000000000..6112b574a8 --- /dev/null +++ b/pages.cn/common/truncate.md @@ -0,0 +1,15 @@ +# truncate + +> Shrink or extend the size of a file to the specified size. + +- Set a size of 10 GB to an exsting file, or create a new file with the specified size: + +`truncate -s {{10G}} {{filename}}` + +- Extend the file size by 50M, fill with holes (which reads as zero bytes): + +`truncate -s +{{50M}} {{filename}}` + +- Shrink the file by 2GiB, by removing data from the end of file: + +`truncate -s -{{2G}} {{filename}` diff --git a/pages.cn/common/tslint.md b/pages.cn/common/tslint.md new file mode 100644 index 0000000000..dc838bd88f --- /dev/null +++ b/pages.cn/common/tslint.md @@ -0,0 +1,19 @@ +# tslint + +> A pluggable linting utility for TypeScript. + +- Create tslint config: + +`tslint --init` + +- Lint on a given set of files: + +`tslint {{filename}}.js {{filename1}}.js` + +- Fix lint issues: + +`tslint --fix` + +- Lint with the config file in the project root: + +`tslint --project {{path/to/project_root}}` diff --git a/pages.cn/common/tsort.md b/pages.cn/common/tsort.md new file mode 100644 index 0000000000..a8fafc6eda --- /dev/null +++ b/pages.cn/common/tsort.md @@ -0,0 +1,8 @@ +# tsort + +> Perform a topological sort. +> A common use is to show the dependency order of nodes in a directed acyclic graph. + +- Perform a topological sort consistent with a partial sort per line of input separated by blanks: + +`tsort {{file}}` diff --git a/pages.cn/common/tty.md b/pages.cn/common/tty.md new file mode 100644 index 0000000000..7ec909dbc8 --- /dev/null +++ b/pages.cn/common/tty.md @@ -0,0 +1,7 @@ +# tty + +> Returns terminal name. + +- Print the file name of this terminal: + +`tty` diff --git a/pages.cn/common/ufraw-batch.md b/pages.cn/common/ufraw-batch.md new file mode 100644 index 0000000000..cfa20658a9 --- /dev/null +++ b/pages.cn/common/ufraw-batch.md @@ -0,0 +1,19 @@ +# ufraw-batch + +> Convert RAW files from cameras into standard image files. + +- Simply convert RAW files to jpg: + +`ufraw-batch --out-type=jpg {{input_file(s)}}` + +- Simply convert RAW files to png: + +`ufraw-batch --out-type=png {{input_file(s)}}` + +- Extract the preview image from the raw file: + +`ufraw-batch --embedded-image {{input_file(s)}}` + +- Save the file with size up to the given maximums MAX1 and MAX2: + +`ufraw-batch --size=MAX1,MAX2 {{input_file(s)}}` diff --git a/pages.cn/common/umount.md b/pages.cn/common/umount.md new file mode 100644 index 0000000000..710cc650fd --- /dev/null +++ b/pages.cn/common/umount.md @@ -0,0 +1,16 @@ +# umount + +> Unlink a filesystem from its mount point, making it no longer accessible. +> A filesystem cannot be unmounted when it is busy. + +- Unmount a filesystem, by passing the path to the source it is mounted from: + +`umount {{path/to/device_file}}` + +- Unmount a filesystem, by passing the path to the target where it is mounted: + +`umount {{path/to/mounted_directory}}` + +- Unmount all mounted filesystems (except the `proc` filesystem): + +`umount -a` diff --git a/pages.cn/common/uname.md b/pages.cn/common/uname.md new file mode 100644 index 0000000000..1bc3143be6 --- /dev/null +++ b/pages.cn/common/uname.md @@ -0,0 +1,20 @@ +# uname + +> Print details about the current machine and the operating system running on it. +> Note: for additional information about the operating system, try the `lsb_release` command. + +- Print hardware-related information: machine and processor: + +`uname -mp` + +- Print software-related information: operating system, release number, and version: + +`uname -srv` + +- Print the nodename (hostname) of the system: + +`uname -n` + +- Print all available system information (hardware, software, nodename): + +`uname -a` diff --git a/pages.cn/common/unar.md b/pages.cn/common/unar.md new file mode 100644 index 0000000000..e5cfcf2e78 --- /dev/null +++ b/pages.cn/common/unar.md @@ -0,0 +1,23 @@ +# unar + +> Extract contents from archive files. + +- Extract an archive to the current directory: + +`unar {{archive}}` + +- Extract an archive to the specified directory: + +`unar -o {{path/to/directory}} {{archive}}` + +- Force overwrite if files to be unpacked already exist: + +`unar -f {{archive}}` + +- Force rename if files to be unpacked already exist: + +`unar -r {{archive}}` + +- Force skip if files to be unpacked already exist: + +`unar -s {{archive}}` diff --git a/pages.cn/common/unexpand.md b/pages.cn/common/unexpand.md new file mode 100644 index 0000000000..be29d3973e --- /dev/null +++ b/pages.cn/common/unexpand.md @@ -0,0 +1,23 @@ +# unexpand + +> Convert spaces to tabs. + +- Convert blanks in each file to tabs, writing to standard output: + +`unexpand {{file}}` + +- Convert blanks to tabs, reading from standard output: + +`unexpand` + +- Convert all blanks, instead of just initial blanks: + +`unexpand -a {{file}}` + +- Convert only leading sequences of blanks (overrides -a): + +`unexpand --first-only {{file}}` + +- Have tabs a certain number of characters apart, not 8 (enables -a): + +`unexpand -t {{number}} {{file}}` diff --git a/pages.cn/common/uniq.md b/pages.cn/common/uniq.md new file mode 100644 index 0000000000..d39c0b267e --- /dev/null +++ b/pages.cn/common/uniq.md @@ -0,0 +1,24 @@ +# uniq + +> Output the unique lines from the given input or file. +> Since it does not detect repeated lines unless they are adjacent, we need to sort them first. + +- Display each line once: + +`sort {{file}} | uniq` + +- Display only unique lines: + +`sort {{file}} | uniq -u` + +- Display only duplicate lines: + +`sort {{file}} | uniq -d` + +- Display number of occurrences of each line along with that line: + +`sort {{file}} | uniq -c` + +- Display number of occurrences of each line, sorted by the most frequent: + +`sort {{file}} | uniq -c | sort -nr` diff --git a/pages.cn/common/unlink.md b/pages.cn/common/unlink.md new file mode 100644 index 0000000000..c5f796bd28 --- /dev/null +++ b/pages.cn/common/unlink.md @@ -0,0 +1,8 @@ +# unlink + +> Remove a link to a file from the filesystem. +> The file contents is lost if the link is the last one to the file. + +- Remove the specified file if it is the last link: + +`unlink {{path/to/file}}` diff --git a/pages.cn/common/unrar.md b/pages.cn/common/unrar.md new file mode 100644 index 0000000000..30fbce9ece --- /dev/null +++ b/pages.cn/common/unrar.md @@ -0,0 +1,19 @@ +# unrar + +> Extract RAR archives. + +- Extract files with original directory structure: + +`unrar x {{compressed.rar}}` + +- Extract files into current directory, losing directory structure in the archive: + +`unrar e {{compressed.rar}}` + +- Test integrity of each file inside the archive file: + +`unrar t {{compressed.rar}}` + +- List files inside the archive file without decompressing it: + +`unrar l {{compressed.rar}}` diff --git a/pages.cn/common/unzip.md b/pages.cn/common/unzip.md new file mode 100644 index 0000000000..d3ac12e1da --- /dev/null +++ b/pages.cn/common/unzip.md @@ -0,0 +1,23 @@ +# unzip + +> Extract compressed files in a ZIP archive. + +- Extract zip file(s) (for multiple files, separate file paths by spaces): + +`unzip {{file(s)}}` + +- Extract zip files(s) to given path: + +`unzip {{compressed_file(s)}} -d {{/path/to/put/extracted_file(s)}}` + +- List the contents of a zip file without extracting: + +`unzip -l {{file.zip}}` + +- Extract the contents of the file(s) to stdout alongside the extracted file names: + +`unzip -c {{file.zip}}` + +- Extract a zip file created in windows, containing files with non-ascii (chinese) filenames: + +`unzip -O {{gbk}} {{file.zip}}` diff --git a/pages.cn/common/uptime.md b/pages.cn/common/uptime.md new file mode 100644 index 0000000000..3c956d01de --- /dev/null +++ b/pages.cn/common/uptime.md @@ -0,0 +1,19 @@ +# uptime + +> Tell how long the system has been running and other information. + +- Print current time, uptime, number of logged-in users and other information: + +`uptime` + +- Show only the amount of time the system has been booted for: + +`uptime --pretty` + +- Print the date and time the system booted up at: + +`uptime --since` + +- Show version information: + +`uptime --version` diff --git a/pages.cn/common/upx.md b/pages.cn/common/upx.md new file mode 100644 index 0000000000..826d255c72 --- /dev/null +++ b/pages.cn/common/upx.md @@ -0,0 +1,15 @@ +# upx + +> Compress or decompress executables. + +- Compress executable: + +`upx {{file}}` + +- Decompress executable: + +`upx -d {{file}}` + +- Detailed help: + +`upx --help` diff --git a/pages.cn/common/users.md b/pages.cn/common/users.md new file mode 100644 index 0000000000..7adc2886f6 --- /dev/null +++ b/pages.cn/common/users.md @@ -0,0 +1,11 @@ +# users + +> Display a list of logged in users. + +- Display a list of logged in users: + +`users` + +- Display a list of logged in users according to a specific file: + +`users {{/var/log/wmtp}}` diff --git a/pages.cn/common/vagrant.md b/pages.cn/common/vagrant.md new file mode 100644 index 0000000000..bca3d5fb11 --- /dev/null +++ b/pages.cn/common/vagrant.md @@ -0,0 +1,23 @@ +# vagrant + +> Manage lightweight, reproducible, and portable development environments. + +- Create Vagrantfile in current folder with the base Vagrant box: + +`vagrant init` + +- Create Vagrantfile with the Ubuntu 14.04 (Trusty Tahr) box from HashiCorp Atlas: + +`vagrant init ubuntu/trusty32` + +- Start and provision the vagrant environment: + +`vagrant up` + +- Suspend the machine: + +`vagrant suspend` + +- Connect to machine via SSH: + +`vagrant ssh` diff --git a/pages.cn/common/valgrind.md b/pages.cn/common/valgrind.md new file mode 100644 index 0000000000..6cc7c554a6 --- /dev/null +++ b/pages.cn/common/valgrind.md @@ -0,0 +1,20 @@ +# valgrind + +> Wrapper for a set of expert tools for profiling, optimizing and debugging programs. +> Commonly used tools include `memcheck`, `cachegrind`, `callgrind`, `massif`, `helgrind`, and `drd`. + +- Use the (default) Memcheck tool to show a diagnostic of memory usage by `program`: + +`valgrind {{program}}` + +- Use Memcheck to report all possible memory leaks of `program` in full detail: + +`valgrind --leak-check=full --show-leak-kinds=all {{program}}` + +- Use the Cachegrind tool to profile and log CPU cache operations of `program`: + +`valgrind --tool=cachegrind {{program}}` + +- Use the Massif tool to profile and log heap memory and stack usage of `program`: + +`valgrind --tool=massif --stacks=yes {{program}}` diff --git a/pages.cn/common/vault.md b/pages.cn/common/vault.md new file mode 100644 index 0000000000..7202bfc66f --- /dev/null +++ b/pages.cn/common/vault.md @@ -0,0 +1,27 @@ +# vault + +> A CLI to interact with HashiCorp Vault. + +- Connect to a Vault server and initialize a new encrypted data store: + +`vault init` + +- Unseal (unlock) the vault, by providing one of the key shares needed to access the encrypted data store: + +`vault unseal {{key-share-x}}` + +- Authenticate the CLI client against the Vault server, using an authentication token: + +`vault auth {{authentication_token}}` + +- Store a new secret in the vault, using the generic back-end called "secret": + +`vault write secret/{{hello}} value={{world}}` + +- Read a value from the vault, using the generic back-end called "secret": + +`vault read secret/{{hello}}` + +- Seal (lock) the Vault server, by removing the encryption key of the data store from memory: + +`vault seal` diff --git a/pages.cn/common/vcsh.md b/pages.cn/common/vcsh.md new file mode 100644 index 0000000000..ca83d3e811 --- /dev/null +++ b/pages.cn/common/vcsh.md @@ -0,0 +1,27 @@ +# vcsh + +> Version Control System for the home directory using git repositories. + +- Initialize an (empty) repository: + +`vcsh init {{repository_name}}` + +- Clone a repository into a custom directory name: + +`vcsh clone {{git_url}} {{repository_name}}` + +- List all managed repositories: + +`vcsh list` + +- Execute a git command on a managed repository: + +`vcsh {{repository_name}} {{git_command}}` + +- Push/pull all managed repositories to/from remotes: + +`vcsh {{push|pull}}` + +- Write a custom .gitignore file for a managed repository: + +`vcsh write-gitignore {{repository_name}}` diff --git a/pages.cn/common/vegeta.md b/pages.cn/common/vegeta.md new file mode 100644 index 0000000000..a4322cd52f --- /dev/null +++ b/pages.cn/common/vegeta.md @@ -0,0 +1,28 @@ +# vegeta + +> Vegeta is both a command line utility and a library for HTTP load testing. +> See also `ab`. + +- Launch an attack lasting 30 seconds: + +`echo "{{GET https://example.com}}" | vegeta attack -duration={{30s}}` + +- Launch an attack on a server with a self-signed https certificate: + +`echo "{{GET https://example.com}}" | vegeta attack -insecure -duration={{30s}}` + +- Launch an attack with a rate of 10 requests per second: + +`echo "{{GET https://example.com}}" | vegeta attack -duration={{30s}} -rate={{10}}` + +- Launch an attack and display for a report: + +`echo "{{GET https://example.com}}" | vegeta attack -duration={{30s}} | vegeta report` + +- Launch an attack and plot the results on a graph (latency against time): + +`echo "{{GET https://example.com}}" | vegeta attack -duration={{30s}} | vegeta plot > {{path/to/results.html}}` + +- Launch an attack against multiple URLs from a file: + +`vegeta attack -duration={{30s}} -targets=requests.txt | vegeta report` diff --git a/pages.cn/common/view.md b/pages.cn/common/view.md new file mode 100644 index 0000000000..c3e8463007 --- /dev/null +++ b/pages.cn/common/view.md @@ -0,0 +1,8 @@ +# view + +> A read-only version of `vim`. +> This is equivalent to `vim -R`. + +- Open a file: + +`view {{file}}` diff --git a/pages.cn/common/vim.md b/pages.cn/common/vim.md new file mode 100644 index 0000000000..68a7afb425 --- /dev/null +++ b/pages.cn/common/vim.md @@ -0,0 +1,36 @@ +# vim + +> Vi IMproved, a programmer's text editor, provides several modes for different kinds of text manipulation. +> Pressing `i` enters edit mode. `` goes back to normal mode, which doesn't allow regular text insertion. + +- Open a file: + +`vim {{file}}` + +- Enter text editing mode (insert mode): + +`i` + +- Copy ("yank") or cut ("delete") the current line (paste it with `P`): + +`{{yy|dd}}` + +- Undo the last operation: + +`u` + +- Search for a pattern in the file (press `n`/`N` to go to next/previous match): + +`/{{search_pattern}}` + +- Perform a regex substitution in the whole file: + +`:%s/{{pattern}}/{{replacement}}/g` + +- Save (write) the file, and quit: + +`:wq` + +- Quit without saving: + +`:q!` diff --git a/pages.cn/common/vimdiff.md b/pages.cn/common/vimdiff.md new file mode 100644 index 0000000000..096be297ee --- /dev/null +++ b/pages.cn/common/vimdiff.md @@ -0,0 +1,16 @@ +# vimdiff + +> Open up to four files in vim and show the differences between them. +> See `vim` documentation for working with files and navigating within a window. + +- Open two files and show the differences (up to four files can be compared): + +`vimdiff {{file1}} {{file2}}` + +- Open two files using a horizontal window split instead of the default vertical split: + +`vimdiff -o {{file1}} {{file2}}` + +- Move the cursor to the window on the left|right|up|down: + +`Ctrl + w {{h|l|k|j}}` diff --git a/pages.cn/common/vimtutor.md b/pages.cn/common/vimtutor.md new file mode 100644 index 0000000000..e00e6d4254 --- /dev/null +++ b/pages.cn/common/vimtutor.md @@ -0,0 +1,11 @@ +# vimtutor + +> Vim tutor, teaching the basic vim commands. + +- Launch the vim tutor using the given language (en, fr, de, ...): + +`vimtutor {{language}}` + +- Exit the tutor: + +` :q ` diff --git a/pages.cn/common/virtualenv.md b/pages.cn/common/virtualenv.md new file mode 100644 index 0000000000..7804ae6fc2 --- /dev/null +++ b/pages.cn/common/virtualenv.md @@ -0,0 +1,19 @@ +# virtualenv + +> Create virtual isolated Python environments. + +- Create a new environment: + +`virtualenv {{path/to/venv}}` + +- Customize the prompt prefix: + +`virtualenv --prompt={{prompt_prefix}} {{path/to/venv}}` + +- Start (select) the environment: + +`source {{path/to/venv}}/bin/activate` + +- Stop the environment: + +`deactivate` diff --git a/pages.cn/common/visudo.md b/pages.cn/common/visudo.md new file mode 100644 index 0000000000..724b8436fe --- /dev/null +++ b/pages.cn/common/visudo.md @@ -0,0 +1,11 @@ +# visudo + +> Safely edit the sudoers file. + +- Edit sudoers file: + +`sudo visudo` + +- Check sudoers file for errors: + +`sudo visudo -c` diff --git a/pages.cn/common/vsce.md b/pages.cn/common/vsce.md new file mode 100644 index 0000000000..726ebcffa0 --- /dev/null +++ b/pages.cn/common/vsce.md @@ -0,0 +1,23 @@ +# vsce + +> Extension manager for Visual Studio Code. + +- List all the extensions created by a publisher: + +`vsce list {{publisher}}` + +- Publish an extension as major, minor or patch version: + +`vsce publish {{major|minor|patch}}` + +- Unpublish an extension: + +`vsce unpublish {{extension_id}}` + +- Package the current working directory as .vsix file: + +`vsce package` + +- Show the metadata associated with an extension: + +`vsce show {{extension_id}}` diff --git a/pages.cn/common/vue.md b/pages.cn/common/vue.md new file mode 100644 index 0000000000..d96829befe --- /dev/null +++ b/pages.cn/common/vue.md @@ -0,0 +1,16 @@ +# vue-cli + +> Simple CLI for scaffolding Vue.js projects. +> Official templates include: webpack, webpack-simple, browserify, browserify-simple, simple. + +- Create a new vue project: + +`vue init {{template}} {{project_name}}` + +- Create a new project with a local template: + +`vue init {{path/to/template_folder}} {{project_name}}` + +- Create project using template on GitHub: + +`vue init {{username}}/{{repo}} {{project_name}}` diff --git a/pages.cn/common/w.md b/pages.cn/common/w.md new file mode 100644 index 0000000000..606db59b86 --- /dev/null +++ b/pages.cn/common/w.md @@ -0,0 +1,12 @@ +# w + +> Show who is logged on and what they are doing. +> Print user login, TTY, remote host, login time, idle time, current process. + +- Show logged-in users info: + +`w` + +- Show logged-in users info without a header: + +`w -h` diff --git a/pages.cn/common/w3m.md b/pages.cn/common/w3m.md new file mode 100644 index 0000000000..63cb22cac5 --- /dev/null +++ b/pages.cn/common/w3m.md @@ -0,0 +1,11 @@ +# w3m + +> A text-based web browser. + +- Open an URL: + +`w3m {{http://example.com}}` + +- Quit w3m: + +`'q' then 'y'` diff --git a/pages.cn/common/wait.md b/pages.cn/common/wait.md new file mode 100644 index 0000000000..672f2d528e --- /dev/null +++ b/pages.cn/common/wait.md @@ -0,0 +1,11 @@ +# wait + +> Wait for a process to complete before proceeding. + +- Wait for a process to finish given its process ID (PID) and return its exit status: + +`wait {{pid}}` + +- Wait for all processes known to the invoking shell to finish: + +`wait` diff --git a/pages.cn/common/waitress-serve.md b/pages.cn/common/waitress-serve.md new file mode 100644 index 0000000000..8eebc41fbd --- /dev/null +++ b/pages.cn/common/waitress-serve.md @@ -0,0 +1,27 @@ +# waitress-serve + +> Pure Python WSGI HTTP Server. + +- Run a Python web app: + +`waitress-serve {{import.path:wsgi_func}}` + +- Listen on port 8080 on localhost: + +`waitress-serve --listen={{localhost}}:{{8080}} {{import.path:wsgi_func}}` + +- Start waitress on a Unix socket: + +`waitress-serve --unix-socket={{path/to/socket}} {{import.path:wsgi_func}}` + +- Use 4 threads to process requests: + +`waitress-serve --threads={{4}} {{import.path:wsgifunc}}` + +- Call a factory method that returns a WSGI object: + +`waitress-serve --call {{import.path.wsgi_factory}}` + +- Set the URL scheme to https: + +`waitress-serve --url-scheme={{https}} {{import.path:wsgi_func}}` diff --git a/pages.cn/common/wasm-objdump.md b/pages.cn/common/wasm-objdump.md new file mode 100644 index 0000000000..1741660b4e --- /dev/null +++ b/pages.cn/common/wasm-objdump.md @@ -0,0 +1,19 @@ +# wasm-objdump + +> Display information from WebAssembly binaries. + +- Display the section headers of a given binary: + +`wasm-objdump -h {{file.wasm}}` + +- Display the entire disassembled output of a given binary: + +`wasm-objdump -d {{file.wasm}}` + +- Display the details of each section: + +`wasm-objdump --details {{file.wasm}}` + +- Display the details of a given section: + +`wasm-objdump --section '{{import}}' --details {{file.wasm}}` diff --git a/pages.cn/common/wasm-opt.md b/pages.cn/common/wasm-opt.md new file mode 100644 index 0000000000..f5d9036b24 --- /dev/null +++ b/pages.cn/common/wasm-opt.md @@ -0,0 +1,19 @@ +# wasm-opt + +> Optimize WebAssembly binary files. + +- Apply default optimizations and write to a given file: + +`wasm-opt -O {{input.wasm}} -o {{output.wasm}}` + +- Apply all optimizations and write to a given file (takes more time, but generates optimal code): + +`wasm-opt -O4 {{input.wasm}} -o {{output.wasm}}` + +- Optimize a file for size: + +`wasm-opt -Oz {{input.wasm}} -o {{output.wasm}}` + +- Print the textual representation of the binary to console: + +`wasm-opt {{input.wasm}} --print` diff --git a/pages.cn/common/wasm2c.md b/pages.cn/common/wasm2c.md new file mode 100644 index 0000000000..c40ba907ed --- /dev/null +++ b/pages.cn/common/wasm2c.md @@ -0,0 +1,11 @@ +# wasm2c + +> Convert a file from the WebAssembly binary format to a C source file and header. + +- Convert a file to a C source file and header and display it to the console: + +`wasm2c {{file.wasm}}` + +- Write the output to a given file (file.h gets additionally generated): + +`wasm2c {{file.wasm}} -o {{file.c}}` diff --git a/pages.cn/common/wasm2wat.md b/pages.cn/common/wasm2wat.md new file mode 100644 index 0000000000..230d5554a1 --- /dev/null +++ b/pages.cn/common/wasm2wat.md @@ -0,0 +1,11 @@ +# wasm2wat + +> Convert a file from the WebAssembly binary format to the text format. + +- Convert a file to the text format and display it to the console: + +`wasm2wat {{file.wasm}}` + +- Write the output to a given file: + +`wasm2wat {{file.wasm}} -o {{file.wat}}` diff --git a/pages.cn/common/wat2wasm.md b/pages.cn/common/wat2wasm.md new file mode 100644 index 0000000000..fcbec72ed8 --- /dev/null +++ b/pages.cn/common/wat2wasm.md @@ -0,0 +1,15 @@ +# wat2wasm + +> Convert a file from the WebAssembly text format to the binary format. + +- Parse and check a file for errors: + +`wat2wasm {{file.wat}}` + +- Write the output binary to a given file: + +`wat2wasm {{file.wat}} -o {{file.wasm}}` + +- Display simplified representation of every byte: + +`wat2wasm -v {{file.wat}}` diff --git a/pages.cn/common/watch.md b/pages.cn/common/watch.md new file mode 100644 index 0000000000..457d45be4f --- /dev/null +++ b/pages.cn/common/watch.md @@ -0,0 +1,15 @@ +# watch + +> Execute a program periodically, showing output fullscreen. + +- Repeatedly run a command and show the result: + +`watch {{command}}` + +- Re-run a command every 60 seconds: + +`watch -n {{60}} {{command}}` + +- Monitor the contents of a directory, highlighting differences as they appear: + +`watch -d {{ls -l}}` diff --git a/pages.cn/common/wc.md b/pages.cn/common/wc.md new file mode 100644 index 0000000000..81a0ccb1b3 --- /dev/null +++ b/pages.cn/common/wc.md @@ -0,0 +1,19 @@ +# wc + +> Count words, bytes, or lines. + +- Count lines in file: + +`wc -l {{file}}` + +- Count words in file: + +`wc -w {{file}}` + +- Count characters (bytes) in file: + +`wc -c {{file}}` + +- Count characters in file (taking multi-byte character sets into account): + +`wc -m {{file}}` diff --git a/pages.cn/common/weasyprint.md b/pages.cn/common/weasyprint.md new file mode 100644 index 0000000000..7e1115b3b0 --- /dev/null +++ b/pages.cn/common/weasyprint.md @@ -0,0 +1,23 @@ +# weasyprint + +> Render HTML to PDF or PNG. + +- Render a HTML file to PDF: + +`weasyprint {{path/to/input.html}} {{path/to/output}}.pdf` + +- Render a HTML file to PNG, including an additional user stylesheet: + +`weasyprint {{path/to/input.html}} {{path/to/output}}.png --stylesheet {{path/to/stylesheet.css}}` + +- Output additional debugging information when rendering: + +`weasyprint {{path/to/input.html}} {{path/to/output}}.pdf --verbose` + +- Specify a custom resolution when outputting to PNG: + +`weasyprint {{path/to/input.html}} {{path/to/output}}.png --resolution {{300}}` + +- Specify a base url for relative urls in the input HTML file: + +`weasyprint {{path/to/input.html}} {{path/to/output}}.png --base-url {{url_or_filename}}` diff --git a/pages.cn/common/webpack.md b/pages.cn/common/webpack.md new file mode 100644 index 0000000000..af536272dc --- /dev/null +++ b/pages.cn/common/webpack.md @@ -0,0 +1,19 @@ +# webpack + +> Bundle a web project's js files and other assets into a single output file. + +- Create a single output file from an entry point file: + +`webpack {{app.js}} {{bundle.js}}` + +- Load css files too from the js file (this uses the css loader for .css files): + +`webpack {{app.js}} {{bundle.js}} --module-bind 'css=css'` + +- Pass a config file (with eg. the entry script and the output filename) and show compilation progress: + +`webpack --config {{webpack.config.js}} --progress` + +- Automatically recompile on changes to project files: + +`webpack --watch {{app.js}} {{bundle.js}}` diff --git a/pages.cn/common/wget.md b/pages.cn/common/wget.md new file mode 100644 index 0000000000..a4dda8b0d0 --- /dev/null +++ b/pages.cn/common/wget.md @@ -0,0 +1,36 @@ +# wget + +> Download files from the Web. +> Supports HTTP, HTTPS, and FTP. + +- Download the contents of an URL to a file (named "foo" in this case): + +`wget {{https://example.com/foo}}` + +- Download the contents of an URL to a file (named "bar" in this case): + +`wget -O {{bar}} {{https://example.com/foo}}` + +- Download a single web page and all its resources (scripts, stylesheets, images, etc.): + +`wget --page-requisites --convert-links {{https://example.com/somepage.html}}` + +- Download a full website, with 3-second intervals between requests: + +`wget --mirror --page-requisites --convert-links --wait=3 {{https://example.com}}` + +- Download all listed files within a directory and its sub-directories (does not download embedded page elements): + +`wget --mirror --no-parent {{https://example.com/somepath/}}` + +- Download the contents of an URL via authenticated FTP: + +`wget --ftp-user={{username}} --ftp-password={{password}} {{ftp://example.com}}` + +- Continue an incomplete download: + +`wget -c {{https://example.com}}` + +- Enable quiet mode to suppress output: + +`wget -q {{https://example.com}}` diff --git a/pages.cn/common/where.md b/pages.cn/common/where.md new file mode 100644 index 0000000000..61f6128a4d --- /dev/null +++ b/pages.cn/common/where.md @@ -0,0 +1,8 @@ +# where + +> Reports all known instances of a command. +> It could be an executable in the PATH environment variable, an alias, or a shell builtin. + +- Find all instances of a command: + +`where {{command}}` diff --git a/pages.cn/common/which.md b/pages.cn/common/which.md new file mode 100644 index 0000000000..36d39414dd --- /dev/null +++ b/pages.cn/common/which.md @@ -0,0 +1,11 @@ +# which + +> Locate a program in the user's path. + +- Search the PATH environment variable and display the location of any matching executables: + +`which {{executable}}` + +- If there are multiple executables which match, display all: + +`which -a {{executable}}` diff --git a/pages.cn/common/while.md b/pages.cn/common/while.md new file mode 100644 index 0000000000..066290c91b --- /dev/null +++ b/pages.cn/common/while.md @@ -0,0 +1,11 @@ +# while + +> Simple shell loop. + +- Read stdin and perform an action on every line: + +`while read line; do echo "$line"; done` + +- Execute a command forever once every second: + +`while :; do {{command}}; sleep 1; done` diff --git a/pages.cn/common/who.md b/pages.cn/common/who.md new file mode 100644 index 0000000000..24b6ceee0d --- /dev/null +++ b/pages.cn/common/who.md @@ -0,0 +1,19 @@ +# who + +> Display who is logged in and related data (processes, boot time). + +- Display the username, line, and time of all currently logged-in sessions: + +`who` + +- Display information only for the current terminal session: + +`who am i` + +- Display all available information: + +`who -a` + +- Display all available information with table headers: + +`who -a -H` diff --git a/pages.cn/common/whoami.md b/pages.cn/common/whoami.md new file mode 100644 index 0000000000..137fd8fed5 --- /dev/null +++ b/pages.cn/common/whoami.md @@ -0,0 +1,11 @@ +# whoami + +> Print the username associated with the current effective user ID. + +- Display currently logged username: + +`whoami` + +- Display the username after a change in the user ID: + +`sudo whoami` diff --git a/pages.cn/common/wordgrinder.md b/pages.cn/common/wordgrinder.md new file mode 100644 index 0000000000..2c60ef3936 --- /dev/null +++ b/pages.cn/common/wordgrinder.md @@ -0,0 +1,15 @@ +# wordgrinder + +> Command-line word processor. + +- Start wordgrinder (loads a blank document by default): + +`wordgrinder` + +- Open a given file: + +`wordgrinder {{filename}}` + +- Show the menu: + +`Alt + M` diff --git a/pages.cn/common/wpa_supplicant.md b/pages.cn/common/wpa_supplicant.md new file mode 100644 index 0000000000..7757bb7a5c --- /dev/null +++ b/pages.cn/common/wpa_supplicant.md @@ -0,0 +1,11 @@ +# wpa_supplicant + +> Manage protected wireless networks. + +- Join a protected wireless network: + +`wpa_supplicant -i {{interface}} -c {{path/to/wpa_supplicant_conf.conf}}` + +- Join a protected wireless network and run it in a daemon: + +`wpa_supplicant -B -i {{interface}} -c {{path/to/wpa_supplicant_conf.conf}}` diff --git a/pages.cn/common/wuzz.md b/pages.cn/common/wuzz.md new file mode 100644 index 0000000000..ca28a44488 --- /dev/null +++ b/pages.cn/common/wuzz.md @@ -0,0 +1,23 @@ +# wuzz + +> Tool to interactively inspect HTTP requests and responses. + +- Start wuzz: + +`wuzz` + +- Display help information: + +`F1` + +- Send an HTTP request: + +`Ctrl + R` + +- Switch to the next view: + +`Ctrl + J, Tab` + +- Switch to the previous view: + +`Ctrl + K, Shift + Tab` diff --git a/pages.cn/common/x_x.md b/pages.cn/common/x_x.md new file mode 100644 index 0000000000..ad99cd84fe --- /dev/null +++ b/pages.cn/common/x_x.md @@ -0,0 +1,15 @@ +# x_x + +> View Excel and CSV files from the command-line. + +- View an XLSX or CSV file: + +`x_x {{file.xlsx|file.csv}}` + +- View an XLSX or CSV file, using the first row as table headers: + +`x_x -h {{0}} {{file.xlsx|file.csv}}` + +- View a CSV file with unconventional delimiters: + +`x_x --delimiter={{';'}} --quotechar={{'|'}} {{file.csv}}` diff --git a/pages.cn/common/xargs.md b/pages.cn/common/xargs.md new file mode 100644 index 0000000000..d3a1f8466b --- /dev/null +++ b/pages.cn/common/xargs.md @@ -0,0 +1,16 @@ +# xargs + +> Execute a command with piped arguments coming from another command, a file, etc. +> The input is treated as a single block of text and split into separate arguments on spaces, tabs, newlines and end-of-file. + +- Main usage pattern: + +`{{arguments_source}} | xargs {{command}}` + +- Delete all files with a `.backup` extension. `-print0` on find uses a null character to split the files, and `-0` changes the delimiter to the null character (useful if there's whitespace in filenames): + +`find . -name {{'*.backup'}} -print0 | xargs -0 rm -v` + +- Execute the command once for each input line, replacing any occurrences of the placeholder (here marked as `_`) with the input line: + +`{{arguments_source}} | xargs -I _ {{command}} _ {{optional_extra_arguments}}` diff --git a/pages.cn/common/xcv.md b/pages.cn/common/xcv.md new file mode 100644 index 0000000000..ba7fcab4ae --- /dev/null +++ b/pages.cn/common/xcv.md @@ -0,0 +1,19 @@ +# xcv + +> Cut, copy, and paste in the command-line. + +- Cut a file: + +`xcv x {{input_file}}` + +- Copy a file: + +`xcv c {{input_file}}` + +- Paste a file: + +`xcv v {{output_file}}` + +- List files available for pasting: + +`xcv l` diff --git a/pages.cn/common/xmllint.md b/pages.cn/common/xmllint.md new file mode 100644 index 0000000000..8dbb2767a9 --- /dev/null +++ b/pages.cn/common/xmllint.md @@ -0,0 +1,27 @@ +# xmllint + +> XML parser and linter that supports XPath, a syntax for navigating XML trees. + +- Return all nodes (tags) named "foo": + +`xmllint --xpath "//{{foo}}" {{source_file.xml}}` + +- Return the contents of the first node named "foo" as a string: + +`xmllint --xpath "string(//{{foo}})" {{source_file.xml}}` + +- Return the href attribute of the second anchor element in an html file: + +`xmllint --html --xpath "string(//a[2]/@href)" webpage.xhtml` + +- Return human-readable (indented) XML from file: + +`xmllint --format {{source_file.xml}}` + +- Check that a XML file meets the requirements of its DOCTYPE declaration: + +`xmllint --valid {{source_file.xml}}` + +- Validate XML against DTD schema hosted online: + +`xmllint --dtdvalid {{URL}} {{source_file.xml}}` diff --git a/pages.cn/common/xo.md b/pages.cn/common/xo.md new file mode 100644 index 0000000000..cfc931100b --- /dev/null +++ b/pages.cn/common/xo.md @@ -0,0 +1,23 @@ +# xo + +> A pluggable zero configuration linting utility for JavaScript. + +- Lint files in "src": + +`xo` + +- Lint on a gives set of files: + +`xo {{filename}}.js {{filename1}}.js` + +- Fix lint issues: + +`xo --fix` + +- Lint with spaces as indentation instead of tabs: + +`xo --space` + +- Lint with prettier code style: + +`xo --prettier` diff --git a/pages.cn/common/xsv.md b/pages.cn/common/xsv.md new file mode 100644 index 0000000000..115d88de1a --- /dev/null +++ b/pages.cn/common/xsv.md @@ -0,0 +1,27 @@ +# xsv + +> A fast CSV command line toolkit written in Rust. + +- Inspect the headers of a file: + +`xsv headers {{path/to/file.csv}}` + +- Count the number of entries: + +`xsv count {{path/to/file.csv}}` + +- Get an overview of the shape of entries: + +`xsv stats {{path/to/file.csv}} | xsv table` + +- Select a few columns: + +`xsv select {{column_a,column_b}} {{path/to/file.csv}}` + +- Show 10 random entries: + +`xsv sample {{10}} {{path/to/file.csv}}` + +- Join a column from one file to another: + +`xsv join --no-case {{column_a}} {{path/to/file/a.csv}} {{column_b}} {{path/to/file/b.csv}} | xsv table` diff --git a/pages.cn/common/xxd.md b/pages.cn/common/xxd.md new file mode 100644 index 0000000000..4b6b81f437 --- /dev/null +++ b/pages.cn/common/xxd.md @@ -0,0 +1,27 @@ +# xxd + +> Create a hexadecimal representation (hexdump) from a binary file, or vice-versa. + +- Generate a hexdump from a binary file and display the output: + +`xxd {{input_file}}` + +- Generate a hexdump from a binary file and save it as a text file: + +`xxd {{input_file}} {{output_file}}` + +- Display the output with 10 columns of one octet (byte) each: + +`xxd -c {{10}} {{input_file}}` + +- Display output only upto a length of 32 bytes: + +`xxd -l {{32}} {{input_file}}` + +- Display the output in plain mode, without any gaps between the columns: + +`xxd -p {{input_file}}` + +- Revert a plaintext hexdump back into binary, and save it as a binary file: + +`xxd -r -p {{input_file}} {{output_file}}` diff --git a/pages.cn/common/xz.md b/pages.cn/common/xz.md new file mode 100644 index 0000000000..7ab564e06b --- /dev/null +++ b/pages.cn/common/xz.md @@ -0,0 +1,27 @@ +# xz + +> Compress or decompress .xz and .lzma files. + +- Compress a file: + +`xz {{file}}` + +- Decompress a file: + +`xz -d {{file.xz}}` + +- Decompress a file and write to stdout: + +`xz -dc {{file.xz}}` + +- Compress a file, but don't delete the original: + +`xz -k {{file}}` + +- Compress a file using the fastest compression: + +`xz -0 {{file}}` + +- Compress a file using the best compression: + +`xz -9 {{file}}` diff --git a/pages.cn/common/yarn.md b/pages.cn/common/yarn.md new file mode 100644 index 0000000000..3852b7f1c0 --- /dev/null +++ b/pages.cn/common/yarn.md @@ -0,0 +1,27 @@ +# yarn + +> JavaScript and Node.js package manager alternative. + +- Install a module globally: + +`yarn global add {{module_name}}` + +- Install all dependencies referenced in the `package.json` file (the `install` is optional): + +`yarn install` + +- Install a module and save it as a dependency to the `package.json` file (add `--dev` to save as a dev dependency): + +`yarn add {{module_name}}@{{version}}` + +- Uninstall a module and remove it from the `package.json` file: + +`yarn remove {{module_name}}` + +- Interactively create a `package.json` file: + +`yarn init` + +- Identify whether a module is a dependency and list other modules that depend upon it: + +`yarn why {{module_name}}` diff --git a/pages.cn/common/yes.md b/pages.cn/common/yes.md new file mode 100644 index 0000000000..4533c980e5 --- /dev/null +++ b/pages.cn/common/yes.md @@ -0,0 +1,11 @@ +# yes + +> Output something repeatedly. + +- Repeatedly output "message": + +`yes {{message}}` + +- Repeatedly output "y": + +`yes` diff --git a/pages.cn/common/yesod.md b/pages.cn/common/yesod.md new file mode 100644 index 0000000000..b3cb5fc221 --- /dev/null +++ b/pages.cn/common/yesod.md @@ -0,0 +1,24 @@ +# yesod + +> Helper tool for Yesod, a Haskell-based web framework. +> All Yesod commands are invoked through the `stack` project manager. + +- Create a new scaffolded site, with sqlite as backend, in the "my-project" directory: + +`stack new {{my-project}} {{yesod-sqlite}}` + +- Install the Yesod CLI tool within a Yesod scaffolded site: + +`stack build yesod-bin cabal-install --install-ghc` + +- Start development server: + +`stack exec -- yesod devel` + +- Touch files with altered Template Haskell dependencies: + +`stack exec -- yesod touch` + +- Deploy application using Keter (Yesod's deployment manager): + +`stack exec -- yesod keter` diff --git a/pages.cn/common/youtube-dl.md b/pages.cn/common/youtube-dl.md new file mode 100644 index 0000000000..3983f56ec9 --- /dev/null +++ b/pages.cn/common/youtube-dl.md @@ -0,0 +1,23 @@ +# youtube-dl + +> Download videos from YouTube and other websites. + +- Download a video or playlist: + +`youtube-dl {{https://www.youtube.com/watch?v=oHg5SJYRHA0}}` + +- Download the audio from a video and convert it to an MP3: + +`youtube-dl -x --audio-format {{mp3}} {{url}}` + +- Download video(s) as MP4 files with custom filenames: + +`youtube-dl --format {{mp4}} --output {{"%(title) by %(uploader) on %(upload_date) in %(playlist).%(ext)"}} {{url}}` + +- Download a video and save its description, metadata, annotations, subtitles, and thumbnail: + +`youtube-dl --write-description --write-info-json --write-annotations --write-sub --write-thumbnail {{url}}` + +- From a playlist, download all "Let's Play" videos that aren't marked "NSFW" or age-restricted for 7 year-olds: + +`youtube-dl --match-title {{"let's play"}} --age-limit {{7}} --reject-title {{"nsfw"}} {{playlist_url}}` diff --git a/pages.cn/common/z.md b/pages.cn/common/z.md new file mode 100644 index 0000000000..fa85f73190 --- /dev/null +++ b/pages.cn/common/z.md @@ -0,0 +1,27 @@ +# z + +> Tracks the most used directories and enables quickly navigating to them using string or regex patterns. + +- Go to a directory that contains "foo" in the name: + +`z {{foo}}` + +- Go to a directory that contains "foo" and then "bar": + +`z {{foo}} {{bar}}` + +- Go to the highest-ranked directory matching "foo": + +`z -r {{foo}}` + +- Go to the most recently accessed directory matching "foo": + +`z -t {{foo}}` + +- List all directories in `z`'s database matching "foo": + +`z -l {{foo}}` + +- Remove the current directory from `z`'s database: + +`z -x .` diff --git a/pages.cn/common/zbarimg.md b/pages.cn/common/zbarimg.md new file mode 100644 index 0000000000..0b247c9970 --- /dev/null +++ b/pages.cn/common/zbarimg.md @@ -0,0 +1,7 @@ +# zbarimg + +> Scan and decode bar codes from image file(s). + +- Process an image file: + +`zbarimg {{image_file}}` diff --git a/pages.cn/common/zcat.md b/pages.cn/common/zcat.md new file mode 100644 index 0000000000..14a0ab1cb5 --- /dev/null +++ b/pages.cn/common/zcat.md @@ -0,0 +1,7 @@ +# zcat + +> Print data from gzip compressed files. + +- Print the uncompressed contents of a gzipped file to the standard output: + +`zcat {{file.txt.gz}}` diff --git a/pages.cn/common/zdb.md b/pages.cn/common/zdb.md new file mode 100644 index 0000000000..a1726c8362 --- /dev/null +++ b/pages.cn/common/zdb.md @@ -0,0 +1,15 @@ +# zdb + +> ZFS debugger. + +- Show detailed configuration of all mounted ZFS zpools: + +`zdb` + +- Show detailed configuration for a specific ZFS pool: + +`zdb -C {{poolname}}` + +- Show statistics about number, size and deduplication of blocks: + +`zdb -b {{poolname}}` diff --git a/pages.cn/common/zfs.md b/pages.cn/common/zfs.md new file mode 100644 index 0000000000..a387343407 --- /dev/null +++ b/pages.cn/common/zfs.md @@ -0,0 +1,27 @@ +# zfs + +> Manage ZFS filesystems. + +- List all available zfs filesystems: + +`zfs list` + +- Create a new ZFS filesystem: + +`zfs create {{pool_name/filesystem_name}}` + +- Delete a ZFS filesystem: + +`zfs destroy {{pool_name/filesystem_name}}` + +- Create a Snapshot of a ZFS filesystem: + +`zfs snapshot {{pool_name/filesystem_name}}@{{snapshot_name}}` + +- Enable compression on a filesystem: + +`zfs set compression=on {{pool_name/filesystem_name}}` + +- Change mountpoint for a filesystem: + +`zfs set mountpoint={{/my/mount/path}} {{pool_name/filesystem_name}}` diff --git a/pages.cn/common/zip.md b/pages.cn/common/zip.md new file mode 100644 index 0000000000..e4d6c6ff05 --- /dev/null +++ b/pages.cn/common/zip.md @@ -0,0 +1,35 @@ +# zip + +> Package and compress (archive) files into zip file. + +- Package and compress a directory and its contents, [r]ecursively: + +`zip -r {{compressed.zip}} {{/path/to/dir}}` + +- E[x]clude unwanted files from being added to the compressed archive: + +`zip -r {{compressed.zip}} {{path/to/dir}} -x {{path/to/exclude}}` + +- Archive a directory and its contents with the highest level [9] of compression: + +`zip -r -{{9}} {{compressed.zip}} {{/path/to/dir}}` + +- Package and compress multiple directories and files: + +`zip -r {{compressed.zip}} {{/path/to/dir1 /path/to/dir2 /path/to/file}}` + +- Create an encrypted archive (user will be prompted for a password): + +`zip -e -r {{compressed.zip}} {{path/to/dir}}` + +- Add files to an existing zip file: + +`zip {{compressed.zip}} {{path/to/file}}` + +- Delete files from an existing zip file: + +`zip -d {{compressed.zip}} "{{foo/*.tmp}}"` + +- Archive a directory and its contents to a multi-part [s]plit zip file (e.g. 3GB parts): + +`zip -r -s {{3g}} {{compressed.zip}} {{path/to/dir}}` diff --git a/pages.cn/common/zless.md b/pages.cn/common/zless.md new file mode 100644 index 0000000000..19188479e4 --- /dev/null +++ b/pages.cn/common/zless.md @@ -0,0 +1,7 @@ +# zless + +> View compressed files. + +- Page through a compressed archive with `less`: + +`zless {{file.txt.gz}}` diff --git a/pages.cn/common/zopflipng.md b/pages.cn/common/zopflipng.md new file mode 100644 index 0000000000..c4510a41fc --- /dev/null +++ b/pages.cn/common/zopflipng.md @@ -0,0 +1,11 @@ +# zopflipng + +> PNG image compression utility. + +- Optimize a PNG image: + +`zopflipng {{input.png}} {{output.png}}` + +- Optimize several PNG images and save with given prefix: + +`zopflipng --prefix={{prefix}} {{image1.png}} {{image2.png}} {{image3.png}}` diff --git a/pages.cn/common/zpool.md b/pages.cn/common/zpool.md new file mode 100644 index 0000000000..edeecc2ffa --- /dev/null +++ b/pages.cn/common/zpool.md @@ -0,0 +1,31 @@ +# zpool + +> Manage ZFS pools. + +- Show the configuration and status of all ZFS zpools: + +`zpool status` + +- Check a ZFS pool for errors (verifies the checksum of EVERY block). Very CPU and disk intensive: + +`zpool scrub {{pool_name}}` + +- List zpools available for import: + +`zpool import` + +- Import a zpool: + +`zpool import {{pool_name}}` + +- Export a zpool (unmount all filesystems): + +`zpool export {{pool_name}}` + +- Show the history of all pool operations: + +`zpool history {{pool_name}}` + +- Create a mirrored pool: + +`zpool create {{pool_name}} mirror {{disk1}} {{disk2}} mirror {{disk3}} {{disk4}}` diff --git a/pages.cn/common/zsh.md b/pages.cn/common/zsh.md new file mode 100644 index 0000000000..aeaee72e80 --- /dev/null +++ b/pages.cn/common/zsh.md @@ -0,0 +1,20 @@ +# zsh + +> Z SHell. +> `bash` and `sh`-compatible command line interpreter. + +- Start interactive command line interpreter: + +`zsh` + +- Execute command passed as parameter: + +`zsh -c {{command}}` + +- Run commands from file (script): + +`zsh {{file}}` + +- Run commands from file and print them as they are executed: + +`zsh -x {{file}}` diff --git a/pages.cn/common/zstd.md b/pages.cn/common/zstd.md new file mode 100644 index 0000000000..f6bffaa7dc --- /dev/null +++ b/pages.cn/common/zstd.md @@ -0,0 +1,23 @@ +# zstd + +> Compress or decompress files with Zstandard compression. + +- Compress a file into a new file with the .zst suffix: + +`zstd {{file}}` + +- Decompress a file: + +`zstd -d {{file}}.zst` + +- Decompress to stdout: + +`zstd -dc {{file}}.zst` + +- Compress a file, while specifing the compression level. 0 = Worst, 19 = Best (Default level is 3): + +`zstd -{{level}} {{file}}` + +- Use more memory (both when compressing and decompressing) to achieve a higher compression ratio: + +`zstd --ultra -{{level}} {{file}}` diff --git a/pages.cn/linux/add-apt-repository.md b/pages.cn/linux/add-apt-repository.md new file mode 100644 index 0000000000..a9bc7381fa --- /dev/null +++ b/pages.cn/linux/add-apt-repository.md @@ -0,0 +1,19 @@ +# add-apt-repository + +> apt仓库管理. + +- 添加一个新的apt仓库: + +`add-apt-repository {{repository_spec}}` + +- 移除一个apt仓库: + +`add-apt-repository --remove {{repository_spec}}` + +- 添加一个仓库并更新缓存: + +`add-apt-repository --update {{repository_spec}}` + +- 允许从指定仓库下载源码: + +`add-apt-repository --enable-source {{repository_spec}}` diff --git a/pages.cn/linux/adduser.md b/pages.cn/linux/adduser.md new file mode 100644 index 0000000000..fa5d9db691 --- /dev/null +++ b/pages.cn/linux/adduser.md @@ -0,0 +1,23 @@ +# adduser + +> User addition utility. + +- Create a new user with a default home directory and prompt the user to set a password: + +`adduser {{username}}` + +- Create a new user without a home directory: + +`adduser --no-create-home {{username}}` + +- Create a new user with a home directory at the specified path: + +`adduser --home {{path/to/home}} {{username}}` + +- Create a new user with the specified shell set as the login shell: + +`adduser --shell {{path/to/shell}} {{username}}` + +- Create a new user belonging to the specified group: + +`adduser --ingroup {{group}} {{username}}` diff --git a/pages.cn/linux/alpine.md b/pages.cn/linux/alpine.md new file mode 100644 index 0000000000..baf1b6ac5d --- /dev/null +++ b/pages.cn/linux/alpine.md @@ -0,0 +1,16 @@ +# alpine + +> An email client and Usenet newsgroup program with a pico/nano-inspired interface. +> Supports most modern email services through IMAP. + +- Open alpine normally: + +`alpine` + +- Open alpine directly to the message composition screen to send an email to a given email address: + +`alpine {{email@example.net}}` + +- Quit alpine: + +`'q' then 'y'` diff --git a/pages.cn/linux/apache2ctl.md b/pages.cn/linux/apache2ctl.md new file mode 100644 index 0000000000..98aebbb301 --- /dev/null +++ b/pages.cn/linux/apache2ctl.md @@ -0,0 +1,24 @@ +# apache2ctl + +> The CLI tool to administrate HTTP web server Apache. +> This commmand comes with Debian based OSes, for RHEL based ones see `httpd`. + +- Start the Apache daemon. Throw a message if it is already running: + +`sudo apache2ctl start` + +- Stop the Apache daemon: + +`sudo apache2ctl stop` + +- Restart the Apache daemon: + +`sudo apache2ctl restart` + +- Test syntax of the configuration file: + +`sudo apache2ctl -t` + +- List loaded modules: + +`sudo apache2ctl -M` diff --git a/pages.cn/linux/apk.md b/pages.cn/linux/apk.md new file mode 100644 index 0000000000..b2f9324bcc --- /dev/null +++ b/pages.cn/linux/apk.md @@ -0,0 +1,27 @@ +# apk + +> Alpine Linux package management tool. + +- Update repository indexes from all remote repositories: + +`apk update` + +- Install a new package: + +`apk add {{package}}` + +- Remove a package: + +`apk del {{package}}` + +- Repair package or upgrade it without modifying main dependencies: + +`apk fix {{package}}` + +- Search package via keyword: + +`apk search {{keyword}}` + +- Get info about a specific package: + +`apk info {{package}}` diff --git a/pages.cn/linux/apt-cache.md b/pages.cn/linux/apt-cache.md new file mode 100644 index 0000000000..2f4d3c6be5 --- /dev/null +++ b/pages.cn/linux/apt-cache.md @@ -0,0 +1,23 @@ +# apt-cache + +> Debian and Ubuntu package query tool. + +- Search for a package in your current sources: + +`apt-cache search {{query}}` + +- Show information about a package: + +`apt-cache show {{package}}` + +- Show whether a package is installed and up to date: + +`apt-cache policy {{package}}` + +- Show dependencies for a package: + +`apt-cache depends {{package}}` + +- Show packages that depend on a particular package: + +`apt-cache rdepends {{package}}` diff --git a/pages.cn/linux/apt-file.md b/pages.cn/linux/apt-file.md new file mode 100644 index 0000000000..0fc9cbe326 --- /dev/null +++ b/pages.cn/linux/apt-file.md @@ -0,0 +1,15 @@ +# apt-file + +> Search for files in apt packages, including ones not yet installed. + +- Update the metadata database: + +`sudo apt update` + +- Search for packages that contain the specified file or path: + +`apt-file search {{part/of/filename}}` + +- List the contents of a specific package: + +`apt-file list {{package_name}}` diff --git a/pages.cn/linux/apt-get.md b/pages.cn/linux/apt-get.md new file mode 100644 index 0000000000..c56c27c555 --- /dev/null +++ b/pages.cn/linux/apt-get.md @@ -0,0 +1,28 @@ +# apt-get + +> Debian and Ubuntu package management utility. +> Search for packages using `apt-cache`. + +- Update the list of available packages and versions (it's recommended to run this before other `apt-get` commands): + +`apt-get update` + +- Install a package, or update it to the latest available version: + +`apt-get install {{package}}` + +- Remove a package: + +`apt-get remove {{package}}` + +- Upgrade all installed packages to their newest available versions: + +`apt-get upgrade` + +- Remove all packages that are no longer needed: + +`apt-get autoremove` + +- Upgrade installed packages (like `upgrade`), but remove obsolete packages and install additional packages to meet new dependencies: + +`apt-get dist-upgrade` diff --git a/pages.cn/linux/apt-key.md b/pages.cn/linux/apt-key.md new file mode 100644 index 0000000000..13f7feb8aa --- /dev/null +++ b/pages.cn/linux/apt-key.md @@ -0,0 +1,23 @@ +# apt-key + +> Key management utility for the APT Package Manager on Debian and Ubuntu. + +- List trusted keys: + +`apt-key list` + +- Add a key to the trusted keystore: + +`apt-key add {{public_key_file.asc}}` + +- Delete a key from the trusted keystore: + +`apt-key del {{key_id}}` + +- Add a remote key to the trusted keystore: + +`wget -qO - {{https://host.tld/filename.key}} | apt-key add -` + +- Add a key from keyserver with only key id: + +`apt-key adv --keyserver {{pgp.mit.edu}} --recv {{KEYID}}` diff --git a/pages.cn/linux/apt-mark.md b/pages.cn/linux/apt-mark.md new file mode 100644 index 0000000000..296d56f088 --- /dev/null +++ b/pages.cn/linux/apt-mark.md @@ -0,0 +1,23 @@ +# apt-mark + +> Utility to change the status of installed packages. + +- Mark a package as automatically installed: + +`sudo apt-mark auto {{package_name}}` + +- Hold a package at its current version and prevent updates to it: + +`sudo apt-mark hold {{package_name}}` + +- Allow a package to be updated again: + +`sudo apt-mark unhold {{package_name}}` + +- Show manually installed packages: + +`apt-mark showmanual` + +- Show held packages that aren't being updated: + +`apt-mark showhold` diff --git a/pages.cn/linux/apt.md b/pages.cn/linux/apt.md new file mode 100644 index 0000000000..17c92aadd0 --- /dev/null +++ b/pages.cn/linux/apt.md @@ -0,0 +1,27 @@ +# apt + +> Package management utility for Debian based distributions. + +- Update the list of available packages and versions (it's recommended to run this before other `apt` commands): + +`sudo apt update` + +- Search for a given package: + +`apt search {{package}}` + +- Show information for a package: + +`apt show {{package}}` + +- Install a package, or update it to the latest available version: + +`sudo apt install {{package}}` + +- Remove a package (using `purge` instead also removes its configuration files): + +`sudo apt remove {{package}}` + +- Upgrade all installed packages to their newest available versions: + +`sudo apt upgrade` diff --git a/pages.cn/linux/aptitude.md b/pages.cn/linux/aptitude.md new file mode 100644 index 0000000000..8c8f8c53ca --- /dev/null +++ b/pages.cn/linux/aptitude.md @@ -0,0 +1,27 @@ +# aptitude + +> Debian and Ubuntu package management utility. + +- Synchronize list of packages and versions available. This should be run first, before running subsequent aptitude commands: + +`aptitude update` + +- Install a new package and its dependencies: + +`aptitude install {{package}}` + +- Search for a package: + +`aptitude search {{package}}` + +- Remove a package and all packages depending on it: + +`aptitude remove {{package}}` + +- Upgrade installed packages to newest available versions: + +`aptitude upgrade` + +- Upgrade installed packages (like `aptitude upgrade`) including removing obsolete packages and installing additional packages to meet new package dependencies: + +`aptitude full-upgrade` diff --git a/pages.cn/linux/arch.md b/pages.cn/linux/arch.md new file mode 100644 index 0000000000..4aa9c3f070 --- /dev/null +++ b/pages.cn/linux/arch.md @@ -0,0 +1,8 @@ +# arch + +> Display the name of the system architecture. +> See also `uname`. + +- Display the system's architecture: + +`arch` diff --git a/pages.cn/linux/archey.md b/pages.cn/linux/archey.md new file mode 100644 index 0000000000..297fcc661d --- /dev/null +++ b/pages.cn/linux/archey.md @@ -0,0 +1,7 @@ +# archey + +> Simple tool for stylishly displaying system information. + +- Show system information: + +`archey` diff --git a/pages.cn/linux/arp-scan.md b/pages.cn/linux/arp-scan.md new file mode 100644 index 0000000000..6458744eb1 --- /dev/null +++ b/pages.cn/linux/arp-scan.md @@ -0,0 +1,19 @@ +# arp-scan + +> Send ARP packets to hosts (specified as IP addresses or hostnames) to scan the local network. + +- Scan the current local network: + +`arp-scan --localnet` + +- Scan an IP network with a custom bitmask: + +`arp-scan {{192.168.1.1}}/{{24}}` + +- Scan an IP network within a custom range: + +`arp-scan {{127.0.0.0}}-{{127.0.0.31}}` + +- Scan an IP network with a custom net mask: + +`arp-scan {{10.0.0.0}}:{{255.255.255.0}}` diff --git a/pages.cn/linux/as.md b/pages.cn/linux/as.md new file mode 100644 index 0000000000..683f797c24 --- /dev/null +++ b/pages.cn/linux/as.md @@ -0,0 +1,20 @@ +# as + +> Portable GNU assembler. +> Primarily intended to assemble output from `gcc` to be used by `ld`. + +- Assemble a file, writing the output to a.out: + +`as {{file.s}}` + +- Assemble the output to a given file: + +`as {{file.s}} -o {{out.o}}` + +- Generate output faster by skipping whitespace and comment preprocessing. (Should only be used for trusted compilers): + +`as -f {{file.s}}` + +- Include a given path to the list of directories to search for files specified in .include directives: + +`as -I {{path/to/directory}} {{file.s}}` diff --git a/pages.cn/linux/aspell.md b/pages.cn/linux/aspell.md new file mode 100644 index 0000000000..1f91f90321 --- /dev/null +++ b/pages.cn/linux/aspell.md @@ -0,0 +1,23 @@ +# aspell + +> Interactive spell checker. + +- Spell check a single file: + +`aspell check {{path/to/file}}` + +- List mispelled words from standard input: + +`cat {{file}} | aspell list` + +- Show available dictionary languages: + +`aspell dicts` + +- Run aspell with different language (takes two letter ISO 639 language code): + +`aspell --lang={{cs}}` + +- List mispelled words from standard input and ignore words from personal word list: + +`cat {{file}} | aspell --personal={{personal-word-list.pws}} {{list}}` diff --git a/pages.cn/linux/at.md b/pages.cn/linux/at.md new file mode 100644 index 0000000000..fc72d5d3b4 --- /dev/null +++ b/pages.cn/linux/at.md @@ -0,0 +1,15 @@ +# at + +> Executes commands at a specified time. + +- Open an `at` prompt to create a new set of scheduled commands, press `Ctrl + D` to save and exit: + +`at {{hh:mm:ss}}` + +- Execute the commands and email the result using a local mailing program such as sendmail: + +`at {{hh:mm:ss}} -m` + +- Execute a script at the given time: + +`at {{hh:mm:ss}} -f {{path/to/file}}` diff --git a/pages.cn/linux/authconfig.md b/pages.cn/linux/authconfig.md new file mode 100644 index 0000000000..90ff080600 --- /dev/null +++ b/pages.cn/linux/authconfig.md @@ -0,0 +1,35 @@ +# authconfig + +> A CLI interface for configuring system authentication resources. + +- Display the current configuration (or dry run): + +`authconfig --test` + +- Configure the server to use a different password hashing algorithm: + +`authconfig --update --passalgo={{algorithm}}` + +- Enable LDAP authentication: + +`authconfig --update --enableldapauth` + +- Disable LDAP authentication: + +`authconfig --update --disableldapauth` + +- Enable Network Information Service (NIS): + +`authconfig --update --enablenis` + +- Enable Kerberos: + +`authconfig --update --enablekrb5` + +- Enable Winbind (Active Directory) authentication: + +`authconfig --update --enablewinbindauth` + +- Enable local authorization: + +`authconfig --update --enablelocauthorize` diff --git a/pages.cn/linux/autorandr.md b/pages.cn/linux/autorandr.md new file mode 100644 index 0000000000..106fca3dde --- /dev/null +++ b/pages.cn/linux/autorandr.md @@ -0,0 +1,19 @@ +# autorandr + +> Automatically change screen layout. + +- Save the current screen layout: + +`autorandr -s {{profile_name}}` + +- Show the saved profiles: + +`autorandr` + +- Change the profile: + +`autorandr -l {{profile_name}}` + +- Set the default profile: + +`autorandr -d {{profile_name}}` diff --git a/pages.cn/linux/beep.md b/pages.cn/linux/beep.md new file mode 100644 index 0000000000..bb3127b4f1 --- /dev/null +++ b/pages.cn/linux/beep.md @@ -0,0 +1,23 @@ +# beep + +> A utility to beep the PC speaker. + +- Play a beep: + +`beep` + +- Play a beep that repeats: + +`beep -r {{repetitions}}` + +- Play a beep at a specified frequency (Hz) and duration (milliseconds): + +`beep -f {{frequency}} -l {{duration}}` + +- Play each new frequency and duration as a distinct beep: + +`beep -f {{frequency}} -l {{duration}} -n -f {{frequency}} -l {{duration}}` + +- Play the C major scale: + +`beep -f 262 -n -f 294 -n -f 330 -n -f 349 -n -f 392 -n -f 440 -n -f 494 -n -f 523` diff --git a/pages.cn/linux/bmon.md b/pages.cn/linux/bmon.md new file mode 100644 index 0000000000..6a5dd53b94 --- /dev/null +++ b/pages.cn/linux/bmon.md @@ -0,0 +1,19 @@ +# bmon + +> Monitor bandwidth and capture network related statistics. + +- Display the list of all the interfaces: + +`bmon -a` + +- Display data transfer rates in bits per second: + +`bmon -b` + +- Set policy to define which network interface(s) is/are displayed: + +`bmon -p {{interface_1,interface_2,interface_3}}` + +- Set interval (in seconds) in which rate per counter is calculated: + +`bmon -R {{2.0}}` diff --git a/pages.cn/linux/brew.md b/pages.cn/linux/brew.md new file mode 100644 index 0000000000..fc6a4d9126 --- /dev/null +++ b/pages.cn/linux/brew.md @@ -0,0 +1,35 @@ +# brew + +> The Homebrew package manager for Linux. + +- Search for available formulas: + +`brew search {{text}}` + +- Install the latest stable version of a formula (use `--devel` for development versions): + +`brew install {{formula}}` + +- List all installed formulae: + +`brew list` + +- Update an installed formula (if no formula name is given, all installed formulae are updated): + +`brew upgrade {{formula}}` + +- Fetch the newest version of Linuxbrew and all formulae from GitHub: + +`brew update` + +- Show formulae that have a more recent version available: + +`brew outdated` + +- Display information about a formula (version, installation path, dependencies, etc.): + +`brew info {{formula}}` + +- Check your Linuxbrew installation for potential problems: + +`brew doctor` diff --git a/pages.cn/linux/bzip2.md b/pages.cn/linux/bzip2.md new file mode 100644 index 0000000000..a172cc5638 --- /dev/null +++ b/pages.cn/linux/bzip2.md @@ -0,0 +1,15 @@ +# bzip2 + +> A block-sorting file compressor. + +- Compress file: + +`bzip2 {{path/to/file_to_compress}}` + +- Decompress file: + +`bzip2 -d {{path/to/compressed_file.bz2}}` + +- Decompress to console: + +`bzip2 -dc {{path/to/compressed_file.bz2}}` diff --git a/pages.cn/linux/cal.md b/pages.cn/linux/cal.md new file mode 100644 index 0000000000..eb4cafffd0 --- /dev/null +++ b/pages.cn/linux/cal.md @@ -0,0 +1,23 @@ +# cal + +> Prints calendar information, with the current day highlighted. + +- Display a calendar for the current month: + +`cal` + +- Display previous, current and next month: + +`cal --three` + +- Use monday as the first day of the week: + +`cal --monday` + +- Display a calendar for a specific year (4 digits): + +`cal {{year}}` + +- Display a calendar for a specific month and year: + +`cal {{month}} {{year}}` diff --git a/pages.cn/linux/calc.md b/pages.cn/linux/calc.md new file mode 100644 index 0000000000..e16afd303d --- /dev/null +++ b/pages.cn/linux/calc.md @@ -0,0 +1,11 @@ +# calc + +> An interactive arbitrary-precision calculator on the terminal. + +- Start calc in interactive mode: + +`calc` + +- Perform a calculation in non-interactive mode: + +`calc -p '{{85 * (36 / 4)}}'` diff --git a/pages.cn/linux/certbot.md b/pages.cn/linux/certbot.md new file mode 100644 index 0000000000..8331762230 --- /dev/null +++ b/pages.cn/linux/certbot.md @@ -0,0 +1,28 @@ +# certbot + +> The Let's Encrypt Agent for automatically obtaining and renewing TLS certificates. +> Successor to `letsencrypt`. + +- Obtain a new certificate via webroot authorization, but do not install it automatically: + +`sudo certbot certonly --webroot --webroot-path {{path/to/webroot}} --domain {{subdomain.example.com}}` + +- Obtain a new certificate via nginx authorization, installing the new certificate automatically: + +`sudo certbot --nginx --domain {{subdomain.example.com}}` + +- Obtain a new certificate via apache authorization, installing the new certificate automatically: + +`sudo certbot --apache --domain {{subdomain.example.com}}` + +- Renew all Let's Encrypt certificates that expire in 30 days or less (don't forget to restart any servers that use them afterwards): + +`sudo certbot renew` + +- Simulate the obtaining of a new certificate, but don't actually save any new certificates to disk: + +`sudo certbot --webroot --webroot-path {{path/to/webroot}} --domain {{subdomain.example.com}} --dry-run` + +- Obtain an untrusted test certificate instead: + +`sudo certbot --webroot --webroot-path {{path/to/webroot}} --domain {{subdomain.example.com}} --test-cert` diff --git a/pages.cn/linux/chage.md b/pages.cn/linux/chage.md new file mode 100644 index 0000000000..a05f725acd --- /dev/null +++ b/pages.cn/linux/chage.md @@ -0,0 +1,23 @@ +# chage + +> Change user account and password expiry information. + +- List password information for the user: + +`chage -l {{user_name}}` + +- Enable password expiration in 10 days: + +`sudo chage -M {{10}} {{user_name}}` + +- Disable password expiration: + +`sudo chage -M -1 {{user_name}}` + +- Set account expiration date: + +`sudo chage -E {{YYYY-MM-DD}}` + +- Force user to change password on next log in: + +`sudo chage -d 0` diff --git a/pages.cn/linux/chattr.md b/pages.cn/linux/chattr.md new file mode 100644 index 0000000000..694b50bb0f --- /dev/null +++ b/pages.cn/linux/chattr.md @@ -0,0 +1,15 @@ +# chattr + +> Change attributes of files or folders. + +- Make a file or folder immutable to changes and deletion, even by superuser: + +`chattr +i {{path}}` + +- Make a file or folder mutable: + +`chattr -i {{path}}` + +- Recursively make an entire folder and contents immutable: + +`chattr -R +i {{folder}}` diff --git a/pages.cn/linux/chkconfig.md b/pages.cn/linux/chkconfig.md new file mode 100644 index 0000000000..8ce18f285e --- /dev/null +++ b/pages.cn/linux/chkconfig.md @@ -0,0 +1,27 @@ +# chkconfig + +> Manage the runlevel of services on CentOS 6. + +- List services with runlevel: + +`chkconfig --list` + +- Show a service's runlevel: + +`chkconfig --list {{ntpd}}` + +- Enable service at boot: + +`chkconfig {{sshd}} on` + +- Enable service at boot for runlevels 2, 3, 4, and 5: + +`chkconfig --level {{2345}} {{sshd}} on` + +- Disable service at boot: + +`chkconfig {{ntpd}} off` + +- Disable service at boot for runlevel 3: + +`chkconfig --level {{3}} {{ntpd}} off` diff --git a/pages.cn/linux/cmus.md b/pages.cn/linux/cmus.md new file mode 100644 index 0000000000..c7d9fb22e1 --- /dev/null +++ b/pages.cn/linux/cmus.md @@ -0,0 +1,24 @@ +# cmus + +> Commandline Music Player. +> Use arrow keys to navigate, `` to select, and numbers 1-8 switch between different views. + +- Open cmus from specified directory: + +`cmus {{path/to/directory}}` + +- Add file/directory to library: + +`:add {{path/to/file_or_directory}}` + +- Pause/unpause current song: + +`c` + +- Toggle shuffle mode on/off: + +`s` + +- Quit cmus: + +`q` diff --git a/pages.cn/linux/command.md b/pages.cn/linux/command.md new file mode 100644 index 0000000000..1cd7922d9e --- /dev/null +++ b/pages.cn/linux/command.md @@ -0,0 +1,7 @@ +# command + +> Command forces the shell to execute the program and ignore any functions, builtins and aliases with the same name. + +- Execute the ls program literally, even if an ls alias exists: + +`command {{ls}}` diff --git a/pages.cn/linux/compgen.md b/pages.cn/linux/compgen.md new file mode 100644 index 0000000000..15e3505194 --- /dev/null +++ b/pages.cn/linux/compgen.md @@ -0,0 +1,23 @@ +# compgen + +> A built-in command for auto-completion in bash, which is called on pressing TAB key twice. + +- List all commands that you could run: + +`compgen -c` + +- List all aliases: + +`compgen -a` + +- List all functions that you could run: + +`compgen -A function` + +- Show shell reserved key words: + +`compgen -k` + +- See all available commands/aliases starting with 'ls': + +`compgen -ac {{ls}}` diff --git a/pages.cn/linux/compose.md b/pages.cn/linux/compose.md new file mode 100644 index 0000000000..84e02d54ca --- /dev/null +++ b/pages.cn/linux/compose.md @@ -0,0 +1,12 @@ +# compose + +> An alias to a `run-mailcap`'s action compose. +> Originally `run-mailcap` is used to mime-type/file. + +- Compose action can be used to compose any existing file or new on default mailcap edit tool: + +`compose {{filename}}` + +- With `run-mailcap`: + +`run-mailcap --action=compose {{filename}}` diff --git a/pages.cn/linux/conky.md b/pages.cn/linux/conky.md new file mode 100644 index 0000000000..d767be510e --- /dev/null +++ b/pages.cn/linux/conky.md @@ -0,0 +1,27 @@ +# conky + +> Light-weight system monitor for X. + +- Launch with default, built-in config: + +`conky` + +- Create a new default config: + +`conky -C > ~/.conkyrc` + +- Launch conky with a given config file: + +`conky -c {{path/to/config}}` + +- Start in the background (daemonize): + +`conky -d` + +- Align conky on the desktop: + +`conky -a {{{top,bottom,middle}_{left,right,middle}}}` + +- Pause for 5 seconds at startup before launching: + +`conky -p {{5}}` diff --git a/pages.cn/linux/cpufreq-aperf.md b/pages.cn/linux/cpufreq-aperf.md new file mode 100644 index 0000000000..f18f3e3c3f --- /dev/null +++ b/pages.cn/linux/cpufreq-aperf.md @@ -0,0 +1,20 @@ +# cpufreq-aperf + +> Calculate the average CPU frequency over a time period. +> Requires root privileges. + +- Start calculating, defaulting to all CPU cores and 1 second refresh interval: + +`sudo cpufreq-aperf` + +- Start calculating for CPU 1 only: + +`sudo cpufreq-aperf -c {{1}}` + +- Start calculating with a 3 seconds refresh interval for all CPU cores: + +`sudo cpufreq-aperf -i {{3}}` + +- Calculate only once: + +`sudo cpufreq-aperf -o` diff --git a/pages.cn/linux/cpufreq-info.md b/pages.cn/linux/cpufreq-info.md new file mode 100644 index 0000000000..af14d1a672 --- /dev/null +++ b/pages.cn/linux/cpufreq-info.md @@ -0,0 +1,31 @@ +# cpufreq-info + +> A tool to show CPU frequency information. + +- Show CPU frequency information for all CPUs: + +`cpufreq-info` + +- Show CPU frequency information for the specified CPU: + +`cpufreq-info -c {{cpu_number}}` + +- Show the allowed minimum and maximum CPU frequency: + +`cpufreq-info -l` + +- Show the current minimum and maximum CPU frequency and policy in table format: + +`cpufreq-info -o` + +- Show available CPU frequency policies: + +`cpufreq-info -g` + +- Show current CPU work frequency in a human-readable format, according to the cpufreq kernel module: + +`cpufreq-info -f -m` + +- Show current CPU work frequency in a human-readable format, by reading it from hardware (only available to root): + +`sudo cpufreq-info -w -m` diff --git a/pages.cn/linux/cpufreq-set.md b/pages.cn/linux/cpufreq-set.md new file mode 100644 index 0000000000..57e973857f --- /dev/null +++ b/pages.cn/linux/cpufreq-set.md @@ -0,0 +1,20 @@ +# cpufreq-set + +> A tool to modify CPU frequency settings. +> The frequency value should range between the output of command `cpufreq-info -l`. + +- Set the CPU frequency policy of CPU 1 to "userspace": + +`sudo cpufreq-set -c {{1}} -g {{userspace}}` + +- Set the current minimum CPU frequency of CPU 1: + +`sudo cpufreq-set -c {{1}} --min {{min_frequency}}` + +- Set the current maximum CPU frequency of CPU 1: + +`sudo cpufreq-set -c {{1}} --max {{max_frequency}}` + +- Set the current work frequency of CPU 1: + +`sudo cpufreq-set -c {{1}} -f {{work_frequency}}` diff --git a/pages.cn/linux/cpuid.md b/pages.cn/linux/cpuid.md new file mode 100644 index 0000000000..24d7c72731 --- /dev/null +++ b/pages.cn/linux/cpuid.md @@ -0,0 +1,15 @@ +# cpuid + +> Display detailed information about all CPUs. + +- Display information for all CPUs: + +`cpuid` + +- Display information only for the current CPU: + +`cpuid -1` + +- Display raw hex information with no decoding: + +`cpuid -r` diff --git a/pages.cn/linux/cryptsetup.md b/pages.cn/linux/cryptsetup.md new file mode 100644 index 0000000000..5e458fd6b2 --- /dev/null +++ b/pages.cn/linux/cryptsetup.md @@ -0,0 +1,19 @@ +# cryptsetup + +> Manage plain dm-crypt and LUKS (Linux Unified Key Setup) encrypted volumes. + +- Initialize a LUKS volume (overwrites all data on the partition): + +`cryptsetup luksFormat {{/dev/sda1}}` + +- Open a LUKS volume and create a decrypted mapping at /dev/mapper/{{target}}: + +`cryptsetup luksOpen {{/dev/sda1}} {{target}}` + +- Remove an existing mapping: + +`cryptsetup luksClose {{target}}` + +- Change the LUKS volume's passphrase: + +`cryptsetup luksChangeKey {{/dev/sda1}}` diff --git a/pages.cn/linux/csplit.md b/pages.cn/linux/csplit.md new file mode 100644 index 0000000000..be52a5912c --- /dev/null +++ b/pages.cn/linux/csplit.md @@ -0,0 +1,24 @@ +# csplit + +> Split a file into pieces. +> This generates files named "xx00", "xx01", and so on. + +- Split a file at lines 5 and 23: + +`csplit {{file}} {{5}} {{23}}` + +- Split a file every 5 lines (this will fail if the total number of lines is not divisible by 5): + +`csplit {{file}} {{5}} {*}` + +- Split a file every 5 lines, ignoring exact-division error: + +`csplit -k {{file}} {{5}} {*}` + +- Split a file at line 5 and use a custom prefix for the output files: + +`csplit {{file}} {{5}} -f {{prefix}}` + +- Split a file at a line matching a regular expression: + +`csplit {{file}} /{{regex}}/` diff --git a/pages.cn/linux/dash.md b/pages.cn/linux/dash.md new file mode 100644 index 0000000000..2a85bb0572 --- /dev/null +++ b/pages.cn/linux/dash.md @@ -0,0 +1,20 @@ +# dash + +> Debian Almquist Shell. +> Modern POSIX-compliant implementation of `sh` (isn't Bash compatible). + +- Start interactive shell: + +`dash` + +- Execute a command: + +`dash -c "{{command}}"` + +- Run commands from a file: + +`dash {{file.sh}}` + +- Run commands from a file, logging all commands executed to the terminal: + +`dash -x {{file.sh}}` diff --git a/pages.cn/linux/datamash.md b/pages.cn/linux/datamash.md new file mode 100644 index 0000000000..35fe08e3e9 --- /dev/null +++ b/pages.cn/linux/datamash.md @@ -0,0 +1,19 @@ +# datamash + +> Tool to perform basic numeric, textual and statistical operations on input textual data files. + +- Get max, min, mean and median of a single column of numbers: + +`seq 3 | datamash max 1 min 1 mean 1 median 1` + +- Get the mean of a single column of float numbers (floats must use "," and not "."): + +`echo -e '1.0\n2.5\n3.1\n4.3\n5.6\n5.7' | tr '.' ',' | datamash mean 1` + +- Get the mean of a single column of numbers with a given decimal precision: + +`echo -e '1\n2\n3\n4\n5\n5' | datamash -R {{number_of_decimals_wanted}} mean 1` + +- Get the mean of a single column of numbers ignoring "Na" and "NaN" (literal) strings: + +`echo -e '1\n2\nNa\n3\nNaN' | datamash --narm mean 1` diff --git a/pages.cn/linux/dbus-daemon.md b/pages.cn/linux/dbus-daemon.md new file mode 100644 index 0000000000..d8aee28dbd --- /dev/null +++ b/pages.cn/linux/dbus-daemon.md @@ -0,0 +1,27 @@ +# dbus-daemon + +> The D-Bus message daemon, allowing multiple programs to exchange messages. + +- Run the daemon with a configuration file: + +`dbus-daemon --config-file {{path/to/file}}` + +- Run the daemon with the standard per-login-session message bus configuration: + +`dbus-daemon --session` + +- Run the daemon with the standard systemwide message bus configuration: + +`dbus-daemon --system` + +- Set the address to listen on and override the configuration value for it: + +`dbus-daemon --address {{address}}` + +- Output the process id to stdout: + +`dbus-daemon --print-pid` + +- Force the message bus to write to the system log for messages: + +`dbus-daemon --syslog` diff --git a/pages.cn/linux/diff3.md b/pages.cn/linux/diff3.md new file mode 100644 index 0000000000..4f01f7d4f8 --- /dev/null +++ b/pages.cn/linux/diff3.md @@ -0,0 +1,11 @@ +# diff3 + +> Compare three files line by line. + +- Compare files: + +`diff3 {{file1}} {{file2}} {{file3}}` + +- Show all changes, outlining conflicts: + +`diff3 --show-all {{file1}} {{file2}} {{file3}}` diff --git a/pages.cn/linux/disown.md b/pages.cn/linux/disown.md new file mode 100644 index 0000000000..37e8d51655 --- /dev/null +++ b/pages.cn/linux/disown.md @@ -0,0 +1,16 @@ +# disown + +> Allow sub-processes to live beyond the shell that they are attached to. +> See also the `jobs` command. + +- Disown the current job: + +`disown` + +- Disown a specific job: + +`disown %{{job_number}}` + +- Disown all jobs: + +`disown -a` diff --git a/pages.cn/linux/dmesg.md b/pages.cn/linux/dmesg.md new file mode 100644 index 0000000000..777214951a --- /dev/null +++ b/pages.cn/linux/dmesg.md @@ -0,0 +1,23 @@ +# dmesg + +> Write the kernel messages to standard output. + +- Show kernel messages: + +`dmesg` + +- Show kernel error messages: + +`dmesg --level err` + +- Show kernel messages and keep reading new ones, similar to `tail -f` (available in kernels 3.5.0 and newer): + +`dmesg -w` + +- Show how much physical memory is available on this system: + +`dmesg | grep -i memory` + +- Show kernel messages 1 page at a time: + +`dmesg | less` diff --git a/pages.cn/linux/dmidecode.md b/pages.cn/linux/dmidecode.md new file mode 100644 index 0000000000..f23ce42bbb --- /dev/null +++ b/pages.cn/linux/dmidecode.md @@ -0,0 +1,28 @@ +# dmidecode + +> Display the DMI (alternatively known as SMBIOS) table contents in a human-readable format. +> Requires root privileges. + +- Show all DMI table contents: + +`sudo dmidecode` + +- Show the BIOS version: + +`sudo dmidecode -s bios-version` + +- Show the system's serial number: + +`sudo dmidecode -s system-serial-number` + +- Show BIOS information: + +`sudo dmidecode -t bios` + +- Show CPU information: + +`sudo dmidecode -t processor` + +- Show memory information: + +`sudo dmidecode -t memory` diff --git a/pages.cn/linux/dnf.md b/pages.cn/linux/dnf.md new file mode 100644 index 0000000000..8dc7f4946f --- /dev/null +++ b/pages.cn/linux/dnf.md @@ -0,0 +1,19 @@ +# dnf + +> Package management utility for RHEL, Fedora, and CentOS (replaces yum). + +- Install a new package: + +`sudo dnf install {{package}}` + +- Install a new package and assume yes to all questions: + +`sudo dnf -y install {{package}}` + +- Remove a package: + +`sudo dnf remove {{package}}` + +- Upgrade installed packages to newest available versions: + +`sudo dnf upgrade` diff --git a/pages.cn/linux/dpkg-query.md b/pages.cn/linux/dpkg-query.md new file mode 100644 index 0000000000..b6069ad9a7 --- /dev/null +++ b/pages.cn/linux/dpkg-query.md @@ -0,0 +1,19 @@ +# dpkg-query + +> A tool that shows information about installed packages. + +- List all installed packages: + +`dpkg-query -l` + +- List installed packages matching a pattern: + +`dpkg-query -l '{{pattern}}'` + +- List all files installed by a package: + +`dpkg-query -L {{package_name}}` + +- Show information about a package: + +`dpkg-query -s {{package_name}}` diff --git a/pages.cn/linux/dpkg.md b/pages.cn/linux/dpkg.md new file mode 100644 index 0000000000..c0821a6b59 --- /dev/null +++ b/pages.cn/linux/dpkg.md @@ -0,0 +1,27 @@ +# dpkg + +> Debian package manager. + +- Install a package: + +`dpkg -i {{path/to/file.deb}}` + +- Remove a package: + +`dpkg -r {{package_name}}` + +- List installed packages: + +`dpkg -l {{pattern}}` + +- List package contents: + +`dpkg -L {{package_name}}` + +- List contents of a local package file: + +`dpkg -c {{path/to/file.deb}}` + +- Find out which package owns a file: + +`dpkg -S {{file_name}}` diff --git a/pages.cn/linux/ebuild.md b/pages.cn/linux/ebuild.md new file mode 100644 index 0000000000..6ee5a3345c --- /dev/null +++ b/pages.cn/linux/ebuild.md @@ -0,0 +1,35 @@ +# ebuild + +> A low level interface to the Gentoo Portage system. + +- Create or update the package manifest: + +`ebuild {{path/to/file.ebuild}} manifest` + +- Clean the temporary build directories for the build file: + +`ebuild {{path/to/file.ebuild}} clean` + +- Fetch sources if they do not exist: + +`ebuild {{path/to/file.ebuild}} fetch` + +- Extract the sources to a temporary build directory: + +`ebuild {{path/to/file.ebuild}} unpack` + +- Compile the extracted sources: + +`ebuild {{path/to/file.ebuild}} compile` + +- Install the package to a temporary install directory: + +`ebuild {{path/to/file.ebuild}} install` + +- Install the temporary files to the live filesystem: + +`ebuild {{path/to/file.ebuild}} qmerge` + +- Fetch, unpack, compile, install and qmerge the specified ebuild file: + +`ebuild {{path/to/file.ebuild}} merge` diff --git a/pages.cn/linux/edit.md b/pages.cn/linux/edit.md new file mode 100644 index 0000000000..2b62046770 --- /dev/null +++ b/pages.cn/linux/edit.md @@ -0,0 +1,12 @@ +# edit + +> An alias to a `run-mailcap`'s action edit. +> Originally `run-mailcap` is used to process/edit mime-type/file. + +- Edit action can be used to view any file on default mailcap explorer: + +`edit {{filename}}` + +- With `run-mailcap`: + +`run-mailcap --action=edit {{filename}}` diff --git a/pages.cn/linux/edquota.md b/pages.cn/linux/edquota.md new file mode 100644 index 0000000000..4a60d9b9a8 --- /dev/null +++ b/pages.cn/linux/edquota.md @@ -0,0 +1,28 @@ +# edquota + +> Edit quotas for a user or group. By default it operates on all file systems with quotas. +> Quota information is stored permanently in the `quota.user` and `quota.group` files in the root of the filesystem. + +- Edit quota of the current user: + +`edquota --user $(whoami)` + +- Edit quota of a specific user: + +`sudo edquota --user {{username}}` + +- Edit quota for a group: + +`sudo edquota --group {{group}}` + +- Restrict operations to a given filesystem (by default edquota operates on all filesystems with quotas): + +`sudo edquota --file-system {{filesystem}}` + +- Edit the default grace period: + +`sudo edquota -t` + +- Duplicate a quota to other users: + +`sudo edquota -p {{reference_user}} {{destination_user1}} {{destination_user2}}` diff --git a/pages.cn/linux/eject.md b/pages.cn/linux/eject.md new file mode 100644 index 0000000000..11bf9ae552 --- /dev/null +++ b/pages.cn/linux/eject.md @@ -0,0 +1,31 @@ +# eject + +> Eject cds, floppy disks and tape drives. + +- Display the default device: + +`eject -d` + +- Eject the default device: + +`eject` + +- Eject a specific device (the default order is cd-rom, scsi, floppy and tape): + +`eject {{/dev/cdrom}}` + +- Toggle whether a device's tray is open or closed: + +`eject -T {{/dev/cdrom}}` + +- Eject a cd drive: + +`eject -r {{/dev/cdrom}}` + +- Eject a floppy drive: + +`eject -f {{/mnt/floppy}}` + +- Eject a tape drive: + +`eject -q {{/mnt/tape}}` diff --git a/pages.cn/linux/emerge.md b/pages.cn/linux/emerge.md new file mode 100644 index 0000000000..3eee53fd3a --- /dev/null +++ b/pages.cn/linux/emerge.md @@ -0,0 +1,31 @@ +# emerge + +> Gentoo Linux package manager utility. + +- Synchronize all packages: + +`emerge --sync` + +- Update all packages, including dependencies: + +`emerge -uDNav @world` + +- Resume a failed updated, skipping the failing package: + +`emerge --resume --skipfirst` + +- Install a new package, with confirmation: + +`emerge -av {{package_name}}` + +- Remove a package, with confirmation: + +`emerge -Cav {{package_name}}` + +- Remove orphaned packages (that were installed only as dependencies): + +`emerge -avc` + +- Search the package database for a keyword: + +`emerge -S {{keyword}}` diff --git a/pages.cn/linux/entr.md b/pages.cn/linux/entr.md new file mode 100644 index 0000000000..d4699c5de9 --- /dev/null +++ b/pages.cn/linux/entr.md @@ -0,0 +1,19 @@ +# entr + +> Run arbitrary commands when files change. + +- Rebuild with `make` if any files in any subfolders change: + +`{{ag -l}} | entr {{make}}` + +- Rebuild and test with `make` if any `.c` source files in the current directory change: + +`{{ls *.c}} | entr {{'make && make test'}}` + +- Send a `SIGTERM` to any previously spawned ruby subprocesses before executing `ruby main.rb`: + +`{{ls *.rb}} | entr -r {{ruby main.rb}}` + +- Run a command with the changed file (`/_`) as an argument: + +`{{ls *.sql}} | entr {{psql -f}} /_` diff --git a/pages.cn/linux/envsubst.md b/pages.cn/linux/envsubst.md new file mode 100644 index 0000000000..9c3ada8093 --- /dev/null +++ b/pages.cn/linux/envsubst.md @@ -0,0 +1,20 @@ +# envsubst + +> Substitutes shell format strings with environment variables in text. +> Strings to be replaced should be in either `${var}` or `$var` format. + +- Replace environment variables in stdin and output to stdout: + +`echo '{{$HOME}}' | envsubst` + +- Replace environment variables in an input file and output to stdout: + +`envsubst < {{path/to/input}}` + +- Replace environment variables in an input file and output to a file: + +`envsubst < {{path/to/input}} > {{path/to/output}}` + +- Replace environment variables in input from a space-separated list: + +`envsubst {{variables}} < {{path/to/input}}` diff --git a/pages.cn/linux/equery.md b/pages.cn/linux/equery.md new file mode 100644 index 0000000000..d785f1975a --- /dev/null +++ b/pages.cn/linux/equery.md @@ -0,0 +1,23 @@ +# equery + +> View information about Portage packages. + +- List all installed packages: + +`equery list '*'` + +- Search for installed packages in the Portage tree and in overlays: + +`equery list -po {{package_name}}` + +- List all packages that depend on a given package: + +`equery depends {{package_name}}` + +- List all packages that a given package depends on: + +`equery depgraph {{package_name}}` + +- List all files installed by a package: + +`equery files --tree {{package_name}}` diff --git a/pages.cn/linux/eval.md b/pages.cn/linux/eval.md new file mode 100644 index 0000000000..ee1135a91d --- /dev/null +++ b/pages.cn/linux/eval.md @@ -0,0 +1,11 @@ +# eval + +> Execute arguments as a single command in the current shell and return its result. + +- Call `echo` with the "foo" argument: + +`eval "{{echo foo}}"` + +- Set a variable in the current shell: + +`eval "{{foo=bar}}"` diff --git a/pages.cn/linux/export.md b/pages.cn/linux/export.md new file mode 100644 index 0000000000..06ebceb93b --- /dev/null +++ b/pages.cn/linux/export.md @@ -0,0 +1,19 @@ +# export + +> Command to mark shell variables in the current environment to be exported with any newly forked child processes. + +- Set a new environment variable: + +`export {{VARIABLE}}={{value}}` + +- Remove an environment variable: + +`export -n {{VARIABLE}}` + +- Mark a shell function for export: + +`export -f {{FUNCTION_NAME}}` + +- Append something to the PATH variable: + +`export PATH=$PATH:{{path/to/append}}` diff --git a/pages.cn/linux/eyeD3.md b/pages.cn/linux/eyeD3.md new file mode 100644 index 0000000000..90c3ecbd89 --- /dev/null +++ b/pages.cn/linux/eyeD3.md @@ -0,0 +1,19 @@ +# eyeD3 + +> Read and manipulate metadata of MP3 files. + +- View information about an MP3 file: + +`eyeD3 {{filename.mp3}}` + +- Set the title of an MP3 file: + +`eyeD3 --title {{"A Title"}} {{filename.mp3}}` + +- Set the album of all the MP3 files in a directory: + +`eyeD3 --album {{"Album Name"}} {{*.mp3}}` + +- Set the front cover art for an MP3 file: + +`eyeD3 --add-image {{front_cover.jpeg}}:FRONT_COVER: {{filename.mp3}}` diff --git a/pages.cn/linux/f5fpc.md b/pages.cn/linux/f5fpc.md new file mode 100644 index 0000000000..a9d32c8782 --- /dev/null +++ b/pages.cn/linux/f5fpc.md @@ -0,0 +1,23 @@ +# f5fpc + +> A proprietry commercial SSL VPN client by BIG-IP Edge. + +- Open a new VPN connection: + +`sudo f5fpc --start` + +- Open a new VPN connection to a specific host: + +`sudo f5fpc --start --host {{host.example.com}}` + +- Specify a username (user will be prompted for a password): + +`sudo f5fpc --start --host {{host.example.com}} --username {{user}}` + +- Show the current VPN status: + +`sudo f5fpc --info` + +- Shutdown the VPN connection: + +`sudo f5fpc --stop` diff --git a/pages.cn/linux/fallocate.md b/pages.cn/linux/fallocate.md new file mode 100644 index 0000000000..bce5d975b4 --- /dev/null +++ b/pages.cn/linux/fallocate.md @@ -0,0 +1,16 @@ +# fallocate + +> Reserve or deallocate disk space to files. +> The utility allocates space without zeroing. + +- Reserve a file taking up 700MB of disk space: + +`fallocate --length {{700M}} {{path/to/file}}` + +- Shrink an already allocated file by 200MB: + +`fallocate --collapse-range --length {{200M}} {{path/to/file}}` + +- Shrink 20MB of space after 100MB in a file: + +`fallocate --collapse-range --offset {{100M}} --length {{20M}} {{path/to/file}}` diff --git a/pages.cn/linux/fatlabel.md b/pages.cn/linux/fatlabel.md new file mode 100644 index 0000000000..9a742ce4de --- /dev/null +++ b/pages.cn/linux/fatlabel.md @@ -0,0 +1,11 @@ +# fatlabel + +> Sets or gets the label of a FAT32 partition. + +- Get the label of a FAT32 partition: + +`fatlabel {{/dev/sda1}}` + +- Set the label of a FAT32 partition: + +`fatlabel {{/dev/sdc3}} "{{new_label}}"` diff --git a/pages.cn/linux/fc-list.md b/pages.cn/linux/fc-list.md new file mode 100644 index 0000000000..c3dc233fa6 --- /dev/null +++ b/pages.cn/linux/fc-list.md @@ -0,0 +1,7 @@ +# fc-list + +> List available fonts installed on the system. + +- Return a list of installed fonts with given name: + +`fc-list | grep '{{DejaVu Serif}}'` diff --git a/pages.cn/linux/fc-match.md b/pages.cn/linux/fc-match.md new file mode 100644 index 0000000000..9af18eefba --- /dev/null +++ b/pages.cn/linux/fc-match.md @@ -0,0 +1,7 @@ +# fc-match + +> Match available fonts. + +- Return a sorted list of best matching fonts: + +`fc-match -s '{{DejaVu Serif}}'` diff --git a/pages.cn/linux/fc-pattern.md b/pages.cn/linux/fc-pattern.md new file mode 100644 index 0000000000..3ca45e60db --- /dev/null +++ b/pages.cn/linux/fc-pattern.md @@ -0,0 +1,7 @@ +# fc-pattern + +> Shows information about a font matching a pattern. + +- Display default information about a font: + +`fc-pattern -d '{{DejaVu Serif}}'` diff --git a/pages.cn/linux/fc.md b/pages.cn/linux/fc.md new file mode 100644 index 0000000000..7e6c464104 --- /dev/null +++ b/pages.cn/linux/fc.md @@ -0,0 +1,15 @@ +# fc + +> Open the most recent command and edit it. + +- Open in the default system editor: + +`fc` + +- Specify an editor to open with: + +`fc -e {{'emacs'}}` + +- List recent commands from history: + +`fc -l` diff --git a/pages.cn/linux/fdisk.md b/pages.cn/linux/fdisk.md new file mode 100644 index 0000000000..8404641ec2 --- /dev/null +++ b/pages.cn/linux/fdisk.md @@ -0,0 +1,11 @@ +# fdisk + +> A program for managing partition tables and partitions on a hard disk. + +- List partitions: + +`fdisk -l` + +- Start the partition manipulator: + +`fdisk {{/dev/sda}}` diff --git a/pages.cn/linux/feh.md b/pages.cn/linux/feh.md new file mode 100644 index 0000000000..3d3464c917 --- /dev/null +++ b/pages.cn/linux/feh.md @@ -0,0 +1,27 @@ +# feh + +> Lightweight image viewing utility. + +- View images locally or using a URL: + +`feh {{path/to/images}}` + +- View images recursively: + +`feh --recursive {{path/to/images}}` + +- View images without window borders: + +`feh --borderless {{path/to/images}}` + +- Exit after the last image: + +`feh --cycle-once {{path/to/images}}` + +- Set the slideshow cycle delay: + +`feh --slideshow-delay {{seconds}} {{path/to/images}}` + +- Set your wallpaper (centered, filled, maximized, scaled or tiled): + +`feh --bg-{{center|fill|max|scale|tile}} {{path/to/image}}` diff --git a/pages.cn/linux/figlet.md b/pages.cn/linux/figlet.md new file mode 100644 index 0000000000..50d39f07cd --- /dev/null +++ b/pages.cn/linux/figlet.md @@ -0,0 +1,19 @@ +# figlet + +> Generate ASCII banners from user input. + +- Generate by directly inputting text: + +`figlet {{input_text}}` + +- Use a custom font file: + +`figlet {{input_text}} -f {{font_file_name}}` + +- Pipe command output through figlet: + +`{{command}} | figlet` + +- Show available figlet fonts: + +`showfigfonts {{optional_string_to_display}}` diff --git a/pages.cn/linux/file.md b/pages.cn/linux/file.md new file mode 100644 index 0000000000..785cee746b --- /dev/null +++ b/pages.cn/linux/file.md @@ -0,0 +1,23 @@ +# file + +> Determine file type. + +- Give a description of the type of the specified file. Works fine for files with no file extension: + +`file {{filename}}` + +- Look inside a zipped file and determine the file type(s) inside: + +`file -z {{foo.zip}}` + +- Allow file to work with special or device files: + +`file -s {{filename}}` + +- Don't stop at first file type match; keep going until the end of the file: + +`file -k {{filename}}` + +- Determine the mime encoding type of a file: + +`file -i {{filename}}` diff --git a/pages.cn/linux/findmnt.md b/pages.cn/linux/findmnt.md new file mode 100644 index 0000000000..f3d7c3eb00 --- /dev/null +++ b/pages.cn/linux/findmnt.md @@ -0,0 +1,23 @@ +# findmnt + +> Find your filesystem. + +- List all mounted filesystems: + +`findmnt` + +- Search for a device: + +`findmnt {{/dev/sdb1}}` + +- Search for a mountpoint: + +`findmnt {{/}}` + +- Find filesystems in specific type: + +`findmnt -t {{ext4}}` + +- Find filesystems with specific label: + +`findmnt LABEL={{BigStorage}}` diff --git a/pages.cn/linux/firejail.md b/pages.cn/linux/firejail.md new file mode 100644 index 0000000000..4d98dd0359 --- /dev/null +++ b/pages.cn/linux/firejail.md @@ -0,0 +1,27 @@ +# firejail + +> Securely sandboxes processes to containers using built-in Linux capabilities. + +- Integrate firejail with your desktop environment: + +`sudo firecfg` + +- Open a restricted Mozilla Firefox: + +`firejail {{firefox}}` + +- Start a restricted Apache server on a known interface and address: + +`firejail --net={{eth0}} --ip={{192.168.1.244}} {{/etc/init.d/apache2}} {{start}}` + +- List running sandboxes: + +`firejail --list` + +- List network activity from running sandboxes: + +`firejail --netstats` + +- Shutdown a running sandbox: + +`firejail --shutdown={{7777}}` diff --git a/pages.cn/linux/firewall-cmd.md b/pages.cn/linux/firewall-cmd.md new file mode 100644 index 0000000000..beee7996cd --- /dev/null +++ b/pages.cn/linux/firewall-cmd.md @@ -0,0 +1,23 @@ +# firewall-cmd + +> The firewalld command line client. + +- View the available firewall zones: + +`firewall-cmd --get-active-zones` + +- View the rules which are currently applied: + +`firewall-cmd --list-all` + +- Permanently open the port for a service in the specified zone (like port `443` when in the `public` zone): + +`firewall-cmd --permanent --zone={{public}} --add-service={{https}}` + +- Permanently close the port for a service in the specified zone (like port `80` when in the `public` zone): + +`firewall-cmd --permanent --zone={{public}} --remove-service={{http}}` + +- Reload firewalld to force rule changes to take effect: + +`firewall-cmd --reload` diff --git a/pages.cn/linux/flatpak.md b/pages.cn/linux/flatpak.md new file mode 100644 index 0000000000..0be4361887 --- /dev/null +++ b/pages.cn/linux/flatpak.md @@ -0,0 +1,27 @@ +# flatpak + +> Build, install and run flatpak applications and runtimes. + +- Run an installed application: + +`flatpak run {{name}}` + +- Install an application from a remote source: + +`flatpak install {{remote}} {{name}}` + +- List all installed applications and runtimes: + +`flatpak list` + +- Update all installed applications and runtimes: + +`flatpak update` + +- Add a remote source: + +`flatpak remote-add --if-not-exists {{remote_name}} {{remote_url}}` + +- List all configured remote sources: + +`flatpak remote-list` diff --git a/pages.cn/linux/foreman.md b/pages.cn/linux/foreman.md new file mode 100644 index 0000000000..67c4e35ceb --- /dev/null +++ b/pages.cn/linux/foreman.md @@ -0,0 +1,27 @@ +# foreman + +> Manage Procfile-based applications. + +- Start an application with the Procfile in the current directory: + +`foreman start` + +- Start an application with a specified Procfile: + +`foreman start -f {{Procfile}}` + +- Start a specific application: + +`foreman start {{process}}` + +- Validate Procfile format: + +`foreman check` + +- Run one-off commands with the process's environment: + +`foreman run {{command}}` + +- Start all processes except the one named "worker": + +`foreman start -m all=1,{{worker}}=0` diff --git a/pages.cn/linux/free.md b/pages.cn/linux/free.md new file mode 100644 index 0000000000..405326a665 --- /dev/null +++ b/pages.cn/linux/free.md @@ -0,0 +1,19 @@ +# free + +> Display amount of free and used memory in the system. + +- Display system memory: + +`free` + +- Display memory in Bytes/KB/MB/GB: + +`free -{{b|k|m|g}}` + +- Display memory in human readable units: + +`free -h` + +- Refresh the output every 2 seconds: + +`free -s {{2}}` diff --git a/pages.cn/linux/fsck.md b/pages.cn/linux/fsck.md new file mode 100644 index 0000000000..6a8fdfd70a --- /dev/null +++ b/pages.cn/linux/fsck.md @@ -0,0 +1,15 @@ +# fsck + +> Check the integrity of a filesystem or repair it. The filesystem should be unmounted at the time the command is run. + +- Check filesystem /dev/sda, reporting any damaged blocks: + +`fsck {{/dev/sda}}` + +- Check filesystem /dev/sda, reporting any damaged blocks and interactively letting the user choose to repair each one: + +`fsck -r {{/dev/sda}}` + +- Check filesystem /dev/sda, reporting any damaged blocks and automatically repairing them: + +`fsck -a {{/dev/sda}}` diff --git a/pages.cn/linux/fuser.md b/pages.cn/linux/fuser.md new file mode 100644 index 0000000000..015c25b822 --- /dev/null +++ b/pages.cn/linux/fuser.md @@ -0,0 +1,8 @@ +# fuser + +> Display process IDs currently using files or sockets. +> Require admin privileges. + +- Identify process using a TCP socket: + +`fuser -n tcp {{port}}` diff --git a/pages.cn/linux/genkernel.md b/pages.cn/linux/genkernel.md new file mode 100644 index 0000000000..a988de52bf --- /dev/null +++ b/pages.cn/linux/genkernel.md @@ -0,0 +1,23 @@ +# genkernel + +> Gentoo Linux utility to compile and install kernels. + +- Automatically compile and install a generic kernel: + +`sudo genkernel all` + +- Build and install the bzImage|initramfs|kernel|ramdisk only: + +`sudo genkernel {{bzImage|initramfs|kernel|ramdisk}}` + +- Apply changes to the kernel configuration before compiling and installing: + +`sudo genkernel --menuconfig all` + +- Generate a kernel with a custom name: + +`sudo genkernel --kernname={{custom_name}} all` + +- Use a kernel source outside of the default directory /usr/src/linux: + +`sudo genkernel --kerneldir={{path/to/directory}} all` diff --git a/pages.cn/linux/getent.md b/pages.cn/linux/getent.md new file mode 100644 index 0000000000..f187ebdbc1 --- /dev/null +++ b/pages.cn/linux/getent.md @@ -0,0 +1,23 @@ +# getent + +> Get entries from Name Service Switch libraries. + +- Get list of all groups: + +`getent group` + +- See the members of a group: + +`getent group {{group_name}}` + +- Get list of all services: + +`getent services` + +- Find a username by UID: + +`getent passwd 1000` + +- Perform a reverse DNS lookup: + +`getent hosts {{host}}` diff --git a/pages.cn/linux/getfacl.md b/pages.cn/linux/getfacl.md new file mode 100644 index 0000000000..da962d8df4 --- /dev/null +++ b/pages.cn/linux/getfacl.md @@ -0,0 +1,15 @@ +# getfacl + +> Get file access control lists. + +- Display the file access control list: + +`getfacl {{path/to/file_or_folder}}` + +- Display the file access control list with numeric user and group IDs: + +`getfacl -n {{path/to/file_or_folder}}` + +- Display the file access control list with tabular output format: + +`getfacl -t {{path/to/file_or_folder}}` diff --git a/pages.cn/linux/gnome-terminal.md b/pages.cn/linux/gnome-terminal.md new file mode 100644 index 0000000000..cd9ccae432 --- /dev/null +++ b/pages.cn/linux/gnome-terminal.md @@ -0,0 +1,19 @@ +# gnome-terminal + +> The GNOME Terminal emulator. + +- Open a new GNOME terminal window: + +`gnome-terminal` + +- Run a specific command in a new terminal window: + +`gnome-terminal -- {{command}}` + +- Open a new tab in the last opened window instead: + +`gnome-terminal --tab` + +- Set the title of the new tab: + +`gnome-terminal --tab --title "{{title}}"` diff --git a/pages.cn/linux/gpasswd.md b/pages.cn/linux/gpasswd.md new file mode 100644 index 0000000000..524aac4ab1 --- /dev/null +++ b/pages.cn/linux/gpasswd.md @@ -0,0 +1,23 @@ +# gpasswd + +> Administer "/etc/group" and "/etc/gshadow". + +- Define group administrators: + +`sudo gpasswd -A {{user1,user2}} {{group}}` + +- Set the list of group members: + +`sudo gpasswd -M {{user1,user2}} {{group}}` + +- Create a password for the named group: + +`gpasswd {{group}}` + +- Add a user to the named group: + +`gpasswd -a {{user}} {{group}}` + +- Remove a user from the named group: + +`gpasswd -d {{user}} {{group}}` diff --git a/pages.cn/linux/groupadd.md b/pages.cn/linux/groupadd.md new file mode 100644 index 0000000000..54508ed410 --- /dev/null +++ b/pages.cn/linux/groupadd.md @@ -0,0 +1,11 @@ +# groupadd + +> Add user groups to the system. + +- Create a new Linux group: + +`groupadd {{group_name}}` + +- Create new group with a specific groupid: + +`groupadd {{group_name}} -g {{group_id}}` diff --git a/pages.cn/linux/groupdel.md b/pages.cn/linux/groupdel.md new file mode 100644 index 0000000000..aa11909f72 --- /dev/null +++ b/pages.cn/linux/groupdel.md @@ -0,0 +1,7 @@ +# groupdel + +> Delete existing user groups from the system. + +- Delete an existing group: + +`groupdel {{group_name}}` diff --git a/pages.cn/linux/groupmod.md b/pages.cn/linux/groupmod.md new file mode 100644 index 0000000000..7cb85b5363 --- /dev/null +++ b/pages.cn/linux/groupmod.md @@ -0,0 +1,11 @@ +# groupmod + +> Modify existing user groups in the system. + +- Change the group name: + +`groupmod -n {{new_group_name}} {{old_group_name}}` + +- Change the group id: + +`groupmod -g {{new_group_id}} {{old_group_name}}` diff --git a/pages.cn/linux/gs.md b/pages.cn/linux/gs.md new file mode 100644 index 0000000000..ed5d9de941 --- /dev/null +++ b/pages.cn/linux/gs.md @@ -0,0 +1,27 @@ +# gs + +> GhostScript is a PDF and PostScript interpreter. + +- To view a file: + +`gs -dQUIET -dBATCH {{file.pdf}}` + +- Reduce PDF file size to 150 dpi images for reading on a ebook device: + +`gs -dNOPAUSE -dQUIET -dBATCH -sDEVICE=pdfwrite -dPDFSETTINGS=/ebook -sOutputFile={{output.pdf}} {{input.pdf}}` + +- Convert PDF file (pages 1 through 3) to an image with 150 dpi resolution: + +`gs -dQUIET -dBATCH -dNOPAUSE -sDEVICE=jpeg -r150 -dFirstPage={{1}} -dLastPage={{3}} -sOutputFile={{output_%d.jpg}} {{input.pdf}}` + +- Extract pages from a PDF file: + +`gs -dQUIET -dBATCH -dNOPAUSE -sDEVICE=pdfwrite -sOutputFile={{output.pdf}} {{input.pdf}}` + +- Merge PDF files: + +`gs -dQUIET -dBATCH -dNOPAUSE -sDEVICE=pdfwrite -sOutputFile={{output.pdf}} {{input1.pdf}} {{input2.pdf}}` + +- Convert from PostScript file to PDF file: + +`gs -dQUIET -dBATCH -dNOPAUSE -sDEVICE=pdfwrite -sOutputFile={{output.pdf}} {{input.ps}}` diff --git a/pages.cn/linux/guix-package.md b/pages.cn/linux/guix-package.md new file mode 100644 index 0000000000..a3b054480e --- /dev/null +++ b/pages.cn/linux/guix-package.md @@ -0,0 +1,27 @@ +# guix package + +> Install, upgrade and remove Guix packages, or rollback to previous configurations. + +- Install a new package: + +`guix package -i {{package_name}}` + +- Remove a package: + +`guix package -r {{package_name}}` + +- Search the package database for a regular expression: + +`guix package -s "{{search_pattern}}"` + +- List installed packages: + +`guix package -I` + +- List generations: + +`guix package -l` + +- Roll back to the previous generation: + +`guix package --roll-back` diff --git a/pages.cn/linux/gunicorn.md b/pages.cn/linux/gunicorn.md new file mode 100644 index 0000000000..eaeaa68d83 --- /dev/null +++ b/pages.cn/linux/gunicorn.md @@ -0,0 +1,27 @@ +# gunicorn + +> Python WSGI HTTP Server. + +- Run Python web app: + +`gunicorn {{import.path:app_object}}` + +- Listen on port 8080 on localhost: + +`gunicorn --bind {{localhost}}:{{8080}} {{import.path:app_object}}` + +- Turn on live reload: + +`gunicorn --reload {{import.path:app_object}}` + +- Use 4 worker processes for handling requests: + +`gunicorn --workers {{4}} {{import.path:app_object}}` + +- Use 4 worker threads for handling requests: + +`gunicorn --threads {{4}} {{import.path:app_object}}` + +- Run app over HTTPS: + +`gunicorn --certfile {{cert.pem}} --keyfile {{key.pem}} {{import.path:app_object}}` diff --git a/pages.cn/linux/halt.md b/pages.cn/linux/halt.md new file mode 100644 index 0000000000..2a2f93f1aa --- /dev/null +++ b/pages.cn/linux/halt.md @@ -0,0 +1,11 @@ +# halt + +> Power off or reboot the machine. + +- Power the machine off: + +`halt` + +- Reboot the machine: + +`halt --reboot` diff --git a/pages.cn/linux/hardinfo.md b/pages.cn/linux/hardinfo.md new file mode 100644 index 0000000000..57deb9973a --- /dev/null +++ b/pages.cn/linux/hardinfo.md @@ -0,0 +1,15 @@ +# hardinfo + +> Show hardware information in GUI window. + +- Start hardinfo: + +`hardinfo` + +- Print report to standard output: + +`hardinfo -r` + +- Save report to HTML file: + +`hardinfo -r -f html > hardinfo.html` diff --git a/pages.cn/linux/hexdump.md b/pages.cn/linux/hexdump.md new file mode 100644 index 0000000000..b0463261cf --- /dev/null +++ b/pages.cn/linux/hexdump.md @@ -0,0 +1,15 @@ +# hexdump + +> An ASCII, decimal, hexadecimal, octal dump. + +- Print the hexadecimal representation of a file: + +`hexdump {{file}}` + +- Display the input offset in hexadecimal and its ASCII representation in two columns: + +`hexdump -C {{file}}` + +- Display the hexadecimal representation of a file, but interpret only n bytes of the input: + +`hexdump -C -n{{number_of_bytes}} {{file}}` diff --git a/pages.cn/linux/hostname.md b/pages.cn/linux/hostname.md new file mode 100644 index 0000000000..b336937a20 --- /dev/null +++ b/pages.cn/linux/hostname.md @@ -0,0 +1,23 @@ +# hostname + +> Show or set the system's host name. + +- Show current host name: + +`hostname` + +- Show the network address of the host name: + +`hostname -i` + +- Show all network addresses of the host: + +`hostname -I` + +- Show the FQDN (Fully Qualified Domain Name): + +`hostname --fqdn` + +- Set current host name: + +`hostname {{new_hostname}}` diff --git a/pages.cn/linux/hostnamectl.md b/pages.cn/linux/hostnamectl.md new file mode 100644 index 0000000000..de77a762ea --- /dev/null +++ b/pages.cn/linux/hostnamectl.md @@ -0,0 +1,11 @@ +# hostnamectl + +> Get or set the hostname of the computer. + +- Get the hostname of the computer: + +`hostnamectl` + +- Set the hostname of the computer: + +`sudo hostnamectl set-hostname "{{some_hostname}}"` diff --git a/pages.cn/linux/htop.md b/pages.cn/linux/htop.md new file mode 100644 index 0000000000..7f9514ac49 --- /dev/null +++ b/pages.cn/linux/htop.md @@ -0,0 +1,15 @@ +# htop + +> Display dynamic real-time information about running processes. An enhanced version of `top`. + +- Start htop: + +`htop` + +- Start htop displaying only processes owned by given user: + +`htop -u {{user_name}}` + +- Get help about interactive commands: + +`?` diff --git a/pages.cn/linux/http-prompt.md b/pages.cn/linux/http-prompt.md new file mode 100644 index 0000000000..d08a1b0d00 --- /dev/null +++ b/pages.cn/linux/http-prompt.md @@ -0,0 +1,15 @@ +# http-prompt + +> An interactive command-line HTTP client featuring autocomplete and syntax highlighting. + +- Launch a session targeting the default url of http://localhost:8000 or the previous session: + +`http-prompt` + +- Launch a session with a given url: + +`http-prompt {{http://example.com}}` + +- Launch a session with some initial options: + +`http-prompt {{localhost:8000/api}} --auth {{username:password}}` diff --git a/pages.cn/linux/httpie.md b/pages.cn/linux/httpie.md new file mode 100644 index 0000000000..e5791c8cd7 --- /dev/null +++ b/pages.cn/linux/httpie.md @@ -0,0 +1,31 @@ +# httpie + +> A user friendly command line HTTP tool. + +- Send a GET request (default method with no request data): + +`http {{https://example.com}}` + +- Send a POST request (default method with request data): + +`http {{https://example.com}} {{hello=World}}` + +- Send a POST request with redirected input: + +`http {{https://example.com}} < {{file.json}}` + +- Send a PUT request with a given json body: + +`http PUT {{https://example.com/todos/7}} {{hello=world}}` + +- Send a DELETE request with a given request header: + +`http DELETE {{https://example.com/todos/7}} {{API-Key:foo}}` + +- Show the whole HTTP exchange (both request and response): + +`http -v {{https://example.com}}` + +- Download a file: + +`http --download {{https://example.com}}` diff --git a/pages.cn/linux/hwclock.md b/pages.cn/linux/hwclock.md new file mode 100644 index 0000000000..4bfec0ad80 --- /dev/null +++ b/pages.cn/linux/hwclock.md @@ -0,0 +1,15 @@ +# hwclock + +> Used for reading or changing the hardware clock. Usually requires root. + +- Display the current time as reported by the hardware clock: + +`hwclock` + +- Write the current software clock time to the hardware clock (sometimes used during system setup): + +`hwclock --systohc` + +- Write the current hardware clock time to the software clock: + +`hwclock --hctosys` diff --git a/pages.cn/linux/i7z.md b/pages.cn/linux/i7z.md new file mode 100644 index 0000000000..f7ce938f40 --- /dev/null +++ b/pages.cn/linux/i7z.md @@ -0,0 +1,7 @@ +# i7z + +> An Intel CPU (only i3, i5 and i7) realtime reporting tool. + +- Start i7z (needs to be run in super user mode): + +`sudo i7z` diff --git a/pages.cn/linux/ifdown.md b/pages.cn/linux/ifdown.md new file mode 100644 index 0000000000..b4e8a1f76e --- /dev/null +++ b/pages.cn/linux/ifdown.md @@ -0,0 +1,11 @@ +# ifdown + +> Disable network interfaces. + +- Disable interface eth0: + +`ifdown {{eth0}}` + +- Disable all interfaces which are enabled: + +`ifdown -a` diff --git a/pages.cn/linux/ifup.md b/pages.cn/linux/ifup.md new file mode 100644 index 0000000000..198c4de34a --- /dev/null +++ b/pages.cn/linux/ifup.md @@ -0,0 +1,11 @@ +# ifup + +> Tool used to enable network interfaces. + +- Enable interface eth0: + +`ifup {{eth0}}` + +- Enable all the interfaces defined with "auto" in /etc/network/interfaces: + +`ifup -a` diff --git a/pages.cn/linux/imgp.md b/pages.cn/linux/imgp.md new file mode 100644 index 0000000000..028dd4b458 --- /dev/null +++ b/pages.cn/linux/imgp.md @@ -0,0 +1,15 @@ +# imgp + +> Command line image resizer and rotator for JPEG and PNG images. + +- Convert single images and/or whole directories containing valid image formats: + +`imgp -x {{1366x1000}} {{path/to/dir}} {{path/to/file}}` + +- Scale an image by 75% and overwrite the source image to a target resolution: + +`imgp -x {{75}} -w {{path/to/file}}` + +- Rotate an image clockwise by 90 degrees: + +`imgp -o {{90}} {{path/to/file}}` diff --git a/pages.cn/linux/inxi.md b/pages.cn/linux/inxi.md new file mode 100644 index 0000000000..aef106fd16 --- /dev/null +++ b/pages.cn/linux/inxi.md @@ -0,0 +1,11 @@ +# inxi + +> Print a summary of system information and resources for debugging purposes. + +- Print a short summary of CPU, memory, hard drive and kernel information: + +`inxi` + +- Print a full description of CPU, memory, disk, network and process information: + +`inxi -Fz` diff --git a/pages.cn/linux/iostat.md b/pages.cn/linux/iostat.md new file mode 100644 index 0000000000..4b50fdccbf --- /dev/null +++ b/pages.cn/linux/iostat.md @@ -0,0 +1,27 @@ +# iostat + +> Report statistics for devices and partitions. + +- Display a report of CPU and disk statistics since system startup: + +`iostat` + +- Display a report of CPU and disk statistics with units converted to megabytes: + +`iostat -m` + +- Display CPU statistics: + +`iostat -c` + +- Display disk statistics with disk names (including LVM): + +`iostat -N` + +- Display extended disk statistics with disk names for device "sda": + +`iostat -xN {{sda}}` + +- Display incremental reports of CPU and disk statistics every 2 seconds: + +`iostat {{2}}` diff --git a/pages.cn/linux/ip.md b/pages.cn/linux/ip.md new file mode 100644 index 0000000000..9476076112 --- /dev/null +++ b/pages.cn/linux/ip.md @@ -0,0 +1,27 @@ +# ip + +> Show / manipulate routing, devices, policy routing and tunnels. + +- List interfaces with detailed info: + +`ip a` + +- Display the routing table: + +`ip r` + +- Show neighbors (ARP table): + +`ip n` + +- Make an interface up/down: + +`ip link set {{interface}} up/down` + +- Add/Delete an ip address to an interface: + +`ip addr add/del {{ip}}/{{mask}} dev {{interface}}` + +- Add a default route: + +`ip route add default via {{ip}} dev {{interface}}` diff --git a/pages.cn/linux/ipcalc.md b/pages.cn/linux/ipcalc.md new file mode 100644 index 0000000000..01eab4f080 --- /dev/null +++ b/pages.cn/linux/ipcalc.md @@ -0,0 +1,23 @@ +# ipcalc + +> Perform simple operations and calculations on IP addresses and networks. + +- Show information about an address or network with a given subnet mask: + +`ipcalc {{1.2.3.4}} {{255.255.255.0}}` + +- Show information about an address or network in CIDR notation: + +`ipcalc {{1.2.3.4}}/{{24}}` + +- Show the broadcast address of an address or network: + +`ipcalc -b {{1.2.3.4}}/{{30}}` + +- Show the network address of provided IP address and netmask: + +`ipcalc -n {{1.2.3.4}}/{{24}}` + +- Display geographic information about a given IP address: + +`ipcalc -g {{1.2.3.4}}` diff --git a/pages.cn/linux/iptables.md b/pages.cn/linux/iptables.md new file mode 100644 index 0000000000..e65702206d --- /dev/null +++ b/pages.cn/linux/iptables.md @@ -0,0 +1,31 @@ +# iptables + +> Program that allows configuration of tables, chains and rules provided by the Linux kernel firewall. + +- View chains, rules, and packet/byte counters for all tables: + +`sudo iptables -vnL` + +- Set chain policy rule: + +`sudo iptables -P {{chain}} {{rule}}` + +- Append rule to chain policy for IP: + +`sudo iptables -A {{chain}} -s {{ip}} -j {{rule}}` + +- Append rule to chain policy for IP considering protocol and port: + +`sudo iptables -A {{chain}} -s {{ip}} -p {{protocol}} --dport {{port}} -j {{rule}}` + +- Delete chain rule: + +`sudo iptables -D {{chain}} {{rule_line_number}}` + +- Save iptables configuration of a given table to a file: + +`sudo iptables-save -t {{tablename}} > {{path/to/iptables_file}}` + +- Restore iptables configuration from a file: + +`sudo iptables-restore < {{path/to/iptables_file}}` diff --git a/pages.cn/linux/isoinfo.md b/pages.cn/linux/isoinfo.md new file mode 100644 index 0000000000..1d62fe9f9d --- /dev/null +++ b/pages.cn/linux/isoinfo.md @@ -0,0 +1,15 @@ +# isoinfo + +> Utility programs for dumping and verifying ISO disk images. + +- List all the files included in an ISO image: + +`isoinfo -f -i {{path/to/image.iso}}` + +- E[x]tract a specific file from an ISO image and send it out stdout: + +`isoinfo -i {{path/to/image.iso}} -x {{/PATH/TO/FILE/INSIDE/ISO.EXT}}` + +- Show header information for an ISO disk image: + +`isoinfo -d -i {{path/to/image.iso}}` diff --git a/pages.cn/linux/iw.md b/pages.cn/linux/iw.md new file mode 100644 index 0000000000..f9389d117e --- /dev/null +++ b/pages.cn/linux/iw.md @@ -0,0 +1,19 @@ +# iw + +> Show and manipulate wireless devices. + +- Scan for available wireless networks: + +`iw dev {{wlp}} scan` + +- Join an open wireless network: + +`iw dev {{wlp}} connect {{SSID}}` + +- Close the current connection: + +`iw dev {{wlp}} disconnect` + +- Show information about the current connection: + +`iw dev {{wlp}} link` diff --git a/pages.cn/linux/jobs.md b/pages.cn/linux/jobs.md new file mode 100644 index 0000000000..24a0331d87 --- /dev/null +++ b/pages.cn/linux/jobs.md @@ -0,0 +1,27 @@ +# jobs + +> BASH builtin for viewing information about processes spawned by the current shell. + +- View jobs spawned by the current shell: + +`jobs` + +- List jobs and their process ids: + +`jobs -l` + +- Display information about jobs with changed status: + +`jobs -n` + +- Display process id of process group leader: + +`jobs -p` + +- Display running processes: + +`jobs -r` + +- Display stopped processes: + +`jobs -s` diff --git a/pages.cn/linux/journalctl.md b/pages.cn/linux/journalctl.md new file mode 100644 index 0000000000..1e238842e6 --- /dev/null +++ b/pages.cn/linux/journalctl.md @@ -0,0 +1,27 @@ +# journalctl + +> Query the systemd journal. + +- Show all messages from this boot: + +`journalctl -b` + +- Show all messages from last boot: + +`journalctl -b -1` + +- Follow new messages (like `tail -f` for traditional syslog): + +`journalctl -f` + +- Show all messages by a specific unit: + +`journalctl -u {{unit}}` + +- Show all messages by a specific process: + +`journalctl _PID={{pid}}` + +- Show all messages by a specific executable: + +`journalctl {{path/to/executable}}` diff --git a/pages.cn/linux/kexec.md b/pages.cn/linux/kexec.md new file mode 100644 index 0000000000..eebac3cc88 --- /dev/null +++ b/pages.cn/linux/kexec.md @@ -0,0 +1,19 @@ +# kexec + +> Directly reboot into a new kernel. + +- Load a new kernel: + +`kexec -l {{path/to/kernel}} --initrd={{path/to/initrd}} --command-line={{arguments}}` + +- Load a new kernel with current boot parameters: + +`kexec -l {{path/to/kernel}} --initrd={{path/to/initrd}} --reuse-cmdline` + +- Execute a currently loaded kernel: + +`kexec -e` + +- Unload current kexec target kernel: + +`kexec -u` diff --git a/pages.cn/linux/lastlog.md b/pages.cn/linux/lastlog.md new file mode 100644 index 0000000000..6ea64247ca --- /dev/null +++ b/pages.cn/linux/lastlog.md @@ -0,0 +1,19 @@ +# lastlog + +> Show the most recent login of all users or of a given user. + +- Display the most recent login of all users: + +`lastlog` + +- Display lastlog record of the specified user: + +`lastlog -u {{username}}` + +- Display records before than 7 days: + +`lastlog -b {{7}}` + +- Display records more recent than 3 days: + +`lastlog -t {{3}}` diff --git a/pages.cn/linux/ldconfig.md b/pages.cn/linux/ldconfig.md new file mode 100644 index 0000000000..a8ee1d5a5e --- /dev/null +++ b/pages.cn/linux/ldconfig.md @@ -0,0 +1,15 @@ +# ldconfig + +> Configure symlinks and cache for shared library dependencies. + +- Update symlinks and rebuild the cache (usually run when a new library is installed): + +`sudo ldconfig` + +- Update the symlinks for a given directory: + +`sudo ldconfig -n {{path/to/directory}}` + +- Print the libraries in the cache and check whether a given library is present: + +`ldconfig -p | grep {{library_name}}` diff --git a/pages.cn/linux/ldd.md b/pages.cn/linux/ldd.md new file mode 100644 index 0000000000..a8cc72adde --- /dev/null +++ b/pages.cn/linux/ldd.md @@ -0,0 +1,11 @@ +# ldd + +> Display shared library dependencies. + +- Display shared library dependencies of a binary: + +`ldd {{path/to/binary}}` + +- Display unused direct dependencies: + +`ldd -u {{path/to/binary}}` diff --git a/pages.cn/linux/light.md b/pages.cn/linux/light.md new file mode 100644 index 0000000000..0421f7c2bd --- /dev/null +++ b/pages.cn/linux/light.md @@ -0,0 +1,19 @@ +# light + +> CLI to control the backlight of your screen. + +- Get the current backlight value in percent: + +`light` + +- Set the backlight value to 50 percent: + +`light -S {{50}}` + +- Reduce 20 percent from the current backlight value: + +`light -U {{20}}` + +- Add 20 percent to the current backlight value: + +`light -A {{20}}` diff --git a/pages.cn/linux/lldb.md b/pages.cn/linux/lldb.md new file mode 100644 index 0000000000..8255dc7e36 --- /dev/null +++ b/pages.cn/linux/lldb.md @@ -0,0 +1,15 @@ +# lldb + +> The LLVM Low-Level Debugger. + +- Debug an executable: + +`lldb {{executable}}` + +- Attach `lldb` to a running process with a given PID: + +`lldb -p {{pid}}` + +- Wait for a new process to launch with a given name, and attach to it: + +`lldb -w -n {{process_name}}` diff --git a/pages.cn/linux/locate.md b/pages.cn/linux/locate.md new file mode 100644 index 0000000000..ff8589a79a --- /dev/null +++ b/pages.cn/linux/locate.md @@ -0,0 +1,15 @@ +# locate + +> Find filenames quickly. + +- Look for pattern in the database. Note: the database is recomputed periodically (usually weekly or daily): + +`locate {{pattern}}` + +- Look for a file by its exact filename (a pattern containing no globbing characters is interpreted as `*pattern*`): + +`locate */{{filename}}` + +- Recompute the database. You need to do it if you want to find recently added files: + +`sudo updatedb` diff --git a/pages.cn/linux/logger.md b/pages.cn/linux/logger.md new file mode 100644 index 0000000000..c1fbb3debc --- /dev/null +++ b/pages.cn/linux/logger.md @@ -0,0 +1,23 @@ +# logger + +> Add messages to syslog (/var/log/syslog). + +- Log a message to syslog: + +`logger {{message}}` + +- Take input from stdin and log to syslog: + +`echo {{log_entry}} | logger` + +- Send the output to a remote syslog server running at a given port. Default port is 514: + +`echo {{log_entry}} | logger --server {{hostname}} --port {{port}}` + +- Use a specific tag for every line logged. Default is the name of logged in user: + +`echo {{log_entry}} | logger --tag {{tag}}` + +- Log messages with a given priority. Default is `user.notice`. See `man logger` for all priority options: + +`echo {{log_entry}} | logger --priority {{user.warning}}` diff --git a/pages.cn/linux/logwatch.md b/pages.cn/linux/logwatch.md new file mode 100644 index 0000000000..3d6aaa65c7 --- /dev/null +++ b/pages.cn/linux/logwatch.md @@ -0,0 +1,11 @@ +# logwatch + +> Summarizes many different logs for common services (e.g., apache, pam_unix, sshd, etc.) in a single report. + +- Analyze logs for a range of dates at certain level of detail: + +`logwatch --range {{yesterday|today|all|help}} --detail {{low|medium|others}}'` + +- Restrict report to only include information for a selected service: + +`logwatch --range {{all}} --service {{apache|pam_unix|etc}}` diff --git a/pages.cn/linux/losetup.md b/pages.cn/linux/losetup.md new file mode 100644 index 0000000000..2fc0aa2817 --- /dev/null +++ b/pages.cn/linux/losetup.md @@ -0,0 +1,19 @@ +# losetup + +> Set up and control loop devices. + +- List loop devices with detailed info: + +`losetup -a` + +- Attach a file to a given loop device: + +`sudo losetup /dev/{{loop}} /{{path/to/file}}` + +- Detach all loop devices: + +`sudo losetup -D` + +- Detach a given loop device: + +`sudo losetup -d /dev/{{loop}}` diff --git a/pages.cn/linux/lrunzip.md b/pages.cn/linux/lrunzip.md new file mode 100644 index 0000000000..69da8af000 --- /dev/null +++ b/pages.cn/linux/lrunzip.md @@ -0,0 +1,24 @@ +# lrunzip + +> A large file decompression program. +> See also `lrzip`, `lrztar`, `lrzuntar`. + +- Decompress a file: + +`lrunzip {{filename.lrz}}` + +- Decompress a file using a specific number of processor threads: + +`lrunzip -p {{8}} {{filename.lrz}}` + +- Decompress a file and silently overwrite files if they exist: + +`lrunzip -f {{filename.lrz}}` + +- Keep broken or damaged files instead of deleting them when decompressing: + +`lrunzip -K {{filename.lrz}}` + +- Specify output file name and/or path: + +`lrunzip -o {{outfilename}} {{filename.lrz}}` diff --git a/pages.cn/linux/lrzip.md b/pages.cn/linux/lrzip.md new file mode 100644 index 0000000000..d372db9a1d --- /dev/null +++ b/pages.cn/linux/lrzip.md @@ -0,0 +1,28 @@ +# lrzip + +> A large file compression program. +> See also `lrunzip`, `lrztar`, `lrzuntar`. + +- Compress a file with LZMA - slow compression, fast decompression: + +`lrzip {{filename}}` + +- Compress a file with BZIP2 - good middle ground for compression/speed: + +`lrzip -b {{filename}}` + +- Compress with ZPAQ - extreme compression, but very slow: + +`lrzip -z {{filename}}` + +- Compress with LZO - light compression, extremely fast decompression: + +`lrzip -l {{filename}}` + +- Compress a file and password protect/encrypt it: + +`lrzip -e {{filename}}` + +- Override the number of processor threads to use: + +`lrzip -p {{8}} {{filename}}` diff --git a/pages.cn/linux/lrztar.md b/pages.cn/linux/lrztar.md new file mode 100644 index 0000000000..233a51bd75 --- /dev/null +++ b/pages.cn/linux/lrztar.md @@ -0,0 +1,24 @@ +# lrztar + +> A wrapper for `lrzip` to simplify compression of directories. +> See also: `tar`, `lrzuntar`, `lrunzip`. + +- Archive a directory with `tar`, then compress: + +`lrztar {{path/to/directory}}` + +- Same as above, with ZPAQ - extreme compression, but very slow: + +`lrztar -z {{path/to/directory}}` + +- Specify the output file: + +`lrztar -o {{path/to/file}} {{path/to/directory}}` + +- Override the number of processor threads to use: + +`lrztar -p {{8}} {{path/to/directory}}` + +- Force overwriting of existing files: + +`lrztar -f {{path/to/directory}}` diff --git a/pages.cn/linux/lrzuntar.md b/pages.cn/linux/lrzuntar.md new file mode 100644 index 0000000000..e0d87688f0 --- /dev/null +++ b/pages.cn/linux/lrzuntar.md @@ -0,0 +1,24 @@ +# lrzuntar + +> A wrapper for `lrunzip` to simplify decompression of directories. +> See also: `lrztar`, `lrzip`. + +- Decompress from a file to the current directory: + +`lrzuntar {{path/to/archive.tar.lrz}}` + +- Decompress from a file to the current directory using a specific number of processor threads: + +`lrzuntar -p {{8}} {{path/to/archive.tar.lrz}}` + +- Decompress from a file to the current directory and silently overwrite items that already exist: + +`lrzuntar -f {{archive.tar.lrz}}` + +- Specify the output path: + +`lrzuntar -O {{path/to/directory}} {{archive.tar.lrz}}` + +- Delete the compressed file after decompression: + +`lrzuntar -D {{path/to/archive.tar.lrz}}` diff --git a/pages.cn/linux/lsattr.md b/pages.cn/linux/lsattr.md new file mode 100644 index 0000000000..ed0b524fab --- /dev/null +++ b/pages.cn/linux/lsattr.md @@ -0,0 +1,23 @@ +# lsattr + +> List file attributes on a Linux file system. + +- Display the attributes of the files in the current directory: + +`lsattr` + +- List the attributes of files in a particular path: + +`lsattr {{path}}` + +- List file attributes recursively in the current and subsequent directories: + +`lsattr -R` + +- Show attributes of all the files in the current directory, including hidden ones: + +`lsattr -a` + +- Display attributes of directories in the current directory: + +`lsattr -d` diff --git a/pages.cn/linux/lsb_release.md b/pages.cn/linux/lsb_release.md new file mode 100644 index 0000000000..4c831b9ce4 --- /dev/null +++ b/pages.cn/linux/lsb_release.md @@ -0,0 +1,19 @@ +# lsb_release + +> Provides certain LSB (Linux Standard Base) and distribution-specific information. + +- Print all available information: + +`lsb_release -a` + +- Print a description (usually the full name) of the operating system: + +`lsb_release -d` + +- Print only the operating system name (ID), suppressing the field name: + +`lsb_release -i -s` + +- Print the release number and codename of the distribution, suppressing the field names: + +`lsb_release -rcs` diff --git a/pages.cn/linux/lsblk.md b/pages.cn/linux/lsblk.md new file mode 100644 index 0000000000..ab473b1344 --- /dev/null +++ b/pages.cn/linux/lsblk.md @@ -0,0 +1,27 @@ +# lsblk + +> Lists information about devices. + +- List all storage devices in a tree-like format: + +`lsblk` + +- Also list empty devices: + +`lsblk -a` + +- Print the SIZE column in bytes rather than in a human-readable format: + +`lsblk -b` + +- Output info about filesystems: + +`lsblk -f` + +- Use ASCII characters for tree formatting: + +`lsblk -i` + +- Output info about block-device topology: + +`lsblk -t` diff --git a/pages.cn/linux/lscpu.md b/pages.cn/linux/lscpu.md new file mode 100644 index 0000000000..161bb68c13 --- /dev/null +++ b/pages.cn/linux/lscpu.md @@ -0,0 +1,15 @@ +# lscpu + +> Displays information about the CPU architecture. + +- Display information about all CPUs: + +`lscpu` + +- Display information in a table: + +`lscpu --extended` + +- Display only information about offline CPUs in a table: + +`lscpu --extended --offline` diff --git a/pages.cn/linux/lshw.md b/pages.cn/linux/lshw.md new file mode 100644 index 0000000000..8f8f27e704 --- /dev/null +++ b/pages.cn/linux/lshw.md @@ -0,0 +1,19 @@ +# lshw + +> List detailed information about hardware configurations as root user. + +- Launch the GUI: + +`sudo lshw -X` + +- List all hardwares in tabular format: + +`sudo lshw -short` + +- List all disks and storage controllers in tabular format: + +`sudo lshw -class disk -class storage -short` + +- Save all network interfaces to an HTML file: + +`sudo lshw -class network -html > {{interfaces.html}}` diff --git a/pages.cn/linux/lsmod.md b/pages.cn/linux/lsmod.md new file mode 100644 index 0000000000..4707703891 --- /dev/null +++ b/pages.cn/linux/lsmod.md @@ -0,0 +1,8 @@ +# lsmod + +> Shows the status of linux kernel modules. +> See also `modprobe`, which loads kernel modules. + +- List all currently loaded kernel modules: + +`lsmod` diff --git a/pages.cn/linux/lspci.md b/pages.cn/linux/lspci.md new file mode 100644 index 0000000000..f7ce0c76b9 --- /dev/null +++ b/pages.cn/linux/lspci.md @@ -0,0 +1,23 @@ +# lspci + +> List all PCI devices. + +- Show a brief list of devices: + +`lspci` + +- Display additional info: + +`lspci -v` + +- Display drivers and modules handling each device: + +`lspci -k` + +- Show a specific device: + +`lspci -s {{00:18.3}}` + +- Dump info in a readable form: + +`lspci -vm` diff --git a/pages.cn/linux/lsscsi.md b/pages.cn/linux/lsscsi.md new file mode 100644 index 0000000000..f640774a1e --- /dev/null +++ b/pages.cn/linux/lsscsi.md @@ -0,0 +1,15 @@ +# lsscsi + +> List SCSI devices (or hosts) and their attributes. + +- List all SCSI devices: + +`lsscsi` + +- List all SCSI devices with detailed attributes: + +`lsscsi -L` + +- List all SCSI devices with human readable disk capacity: + +`lsscsi -s` diff --git a/pages.cn/linux/lsusb.md b/pages.cn/linux/lsusb.md new file mode 100644 index 0000000000..c10dd871c4 --- /dev/null +++ b/pages.cn/linux/lsusb.md @@ -0,0 +1,23 @@ +# lsusb + +> Display information about USB buses and devices connected to them. + +- List all the USB devices available: + +`lsusb` + +- List the USB hierarchy as a tree: + +`lsusb -t` + +- List verbose information about USB devices: + +`lsusb --verbose` + +- List detailed information about a USB device: + +`lsusb -D {{device}}` + +- List devices with a specified vendor and product id only: + +`lsusb -d {{vendor}}:{{product}}` diff --git a/pages.cn/linux/ltrace.md b/pages.cn/linux/ltrace.md new file mode 100644 index 0000000000..6aefa204d6 --- /dev/null +++ b/pages.cn/linux/ltrace.md @@ -0,0 +1,19 @@ +# ltrace + +> Display dynamic library calls of a process. + +- Print (trace) library calls of a program binary: + +`ltrace ./{{program}}` + +- Count library calls. Print a handy summary at the bottom: + +`ltrace -c {{/path/to/program}}` + +- Trace calls to malloc and free, omit those done by libc: + +`ltrace -e malloc+free-@libc.so* {{/path/to/program}}` + +- Write to file instead of terminal: + +`ltrace -o {{file}} {{/path/to/program}}` diff --git a/pages.cn/linux/lvcreate.md b/pages.cn/linux/lvcreate.md new file mode 100644 index 0000000000..00be05dfa1 --- /dev/null +++ b/pages.cn/linux/lvcreate.md @@ -0,0 +1,20 @@ +# lvcreate + +> Creates a logical volume in an existing volume group. +> A volume group is a collection of logical and physical volumes. + +- Create a logical volume of 10 gigabytes in the volume group vg1: + +`lvcreate -L {{10G}} {{vg1}}` + +- Create a 1500 megabyte linear logical volume named mylv in the volume group vg1: + +`lvcreate -L {{1500}} -n {{mylv}} {{vg1}}` + +- Create a logical volume called mylv that uses 60% of the total space in volume group vg1: + +`lvcreate -l {{60%VG}} -n {{mylv}} {{vg1}}` + +- Create a logical volume called mylv that uses all of the unallocated space in the volume group vg1: + +`lvcreate -l {{100%FREE}} -n {{mylv}} {{vg1}}` diff --git a/pages.cn/linux/lxc.md b/pages.cn/linux/lxc.md new file mode 100644 index 0000000000..b6f571b909 --- /dev/null +++ b/pages.cn/linux/lxc.md @@ -0,0 +1,32 @@ +# lxc + +> Manage Linux containers using the lxd REST API. +> Any container names or patterns can be prefixed with the name of a remote server. + +- List local containers matching a string. Omit the string to list all local containers: + +`lxc list {{match_string}}` + +- List images matching a string. Omit the string to list all images: + +`lxc image list [{{remote}}:]{{match_string}}` + +- Create a new container from an image: + +`lxc launch [{{remote}}:]{{image}} {{container}}` + +- Start a container: + +`lxc start [{{remote}}:]{{container}}` + +- Stop a container: + +`lxc stop [{{remote}}:]{{container}}` + +- Show detailed info about a container: + +`lxc info [{{remote}}:]{{container}}` + +- Take a snapshot of a container: + +`lxc snapshot [{{remote}}:]{{container}} {{snapshot}}` diff --git a/pages.cn/linux/mdadm.md b/pages.cn/linux/mdadm.md new file mode 100644 index 0000000000..51e20cef0a --- /dev/null +++ b/pages.cn/linux/mdadm.md @@ -0,0 +1,27 @@ +# mdadm + +> RAID management utility. + +- Create array: + +`mdadm --create {{/path/to/raid_device_file}} --level {{raid_level}} --raid-devices {{number_of_disks}} {{/path/to/disk_device_file}}` + +- Stop array: + +`mdadm -S {{/path/to/raid_device_file}}` + +- Mark disk as failed: + +`mdadm {{/path/to/raid_device_file}} -f {{/path/to/disk_device_file}}` + +- Remove disk: + +`mdadm {{/path/to/raid_device_file}} -r {{/path/to/disk_device_file}}` + +- Add disk to array: + +`mdadm {{/path/to/raid_device_file}} -a {{/path/to/disk_device_file}}` + +- Show RAID info: + +`mdadm -D {{/path/to/raid_device_file}}` diff --git a/pages.cn/linux/microcom.md b/pages.cn/linux/microcom.md new file mode 100644 index 0000000000..460cd69de0 --- /dev/null +++ b/pages.cn/linux/microcom.md @@ -0,0 +1,11 @@ +# microcom + +> A minimalistic terminal program, used to access remote devices via a serial, CAN or telnet connection from the console. + +- Open a serial port using the specified baud rate: + +`microcom --port {{path/to/serial_port}} --speed {{baud_rate}}` + +- Establish a telnet connection to the specified host: + +`microcom --telnet {{hostname}}:{{port}}` diff --git a/pages.cn/linux/mke2fs.md b/pages.cn/linux/mke2fs.md new file mode 100644 index 0000000000..365f36a703 --- /dev/null +++ b/pages.cn/linux/mke2fs.md @@ -0,0 +1,15 @@ +# mke2fs + +> Creates a Linux filesystem inside a partition. + +- Create an ext2 filesystem in partition 1 of device b (`sdb1`): + +`mkfs.ext2 {{/dev/sdb1}}` + +- Create an ext3 filesystem in partition 1 of device b (`sdb1`): + +`mkfs.ext3 {{/dev/sdb1}}` + +- Create an ext3 filesystem in partition 1 of device b (`sdb1`): + +`mkfs.ext3 {{/dev/sdb1}}` diff --git a/pages.cn/linux/mkfs.cramfs.md b/pages.cn/linux/mkfs.cramfs.md new file mode 100644 index 0000000000..57f5cff84d --- /dev/null +++ b/pages.cn/linux/mkfs.cramfs.md @@ -0,0 +1,11 @@ +# mkfs.cramfs + +> Creates a ROM filesystem inside a partition. + +- Create a ROM filesystem inside partition 1 on device b (`sdb1`): + +`mkfs.cramfs {{/dev/sdb1}}` + +- Create a ROM filesystem with a volume-name: + +`mkfs.cramfs -n {{volume_name}} {{/dev/sdb1}}` diff --git a/pages.cn/linux/mkfs.exfat.md b/pages.cn/linux/mkfs.exfat.md new file mode 100644 index 0000000000..572ffe719d --- /dev/null +++ b/pages.cn/linux/mkfs.exfat.md @@ -0,0 +1,15 @@ +# mkfs.exfat + +> Creates an exfat filesystem inside a partition. + +- Create an exfat filesystem inside partition 1 on device b (`sdb1`): + +`mkfs.exfat {{/dev/sdb1}}` + +- Create filesystem with a volume-name: + +`mkfs.exfat -n {{volume_name}} {{/dev/sdb1}}` + +- Create filesystem with a volume-id: + +`mkfs.exfat -i {{volume_id}} {{/dev/sdb1}}` diff --git a/pages.cn/linux/mkfs.fat.md b/pages.cn/linux/mkfs.fat.md new file mode 100644 index 0000000000..d2d1d0673e --- /dev/null +++ b/pages.cn/linux/mkfs.fat.md @@ -0,0 +1,19 @@ +# mkfs.fat + +> Creates an MS-DOS filesystem inside a partition. + +- Create a fat filesystem inside partition 1 on device b (`sdb1`): + +`mkfs.fat {{/dev/sdb1}}` + +- Create filesystem with a volume-name: + +`mkfs.fat -n {{volume_name}} {{/dev/sdb1}}` + +- Create filesystem with a volume-id: + +`mkfs.fat -i {{volume_id}} {{/dev/sdb1}}` + +- Use 5 instead of 2 file allocation tables: + +`mkfs.fat -f 5 {{/dev/sdb1}}` diff --git a/pages.cn/linux/mkfs.minix.md b/pages.cn/linux/mkfs.minix.md new file mode 100644 index 0000000000..ce1fc15c6c --- /dev/null +++ b/pages.cn/linux/mkfs.minix.md @@ -0,0 +1,7 @@ +# mkfs.minix + +> Creates a Minix filesystem inside a partition. + +- Create a Minix filesystem inside partition 1 on device b (`sdb1`): + +`mkfs.minix {{/dev/sdb1}}` diff --git a/pages.cn/linux/mkfs.ntfs.md b/pages.cn/linux/mkfs.ntfs.md new file mode 100644 index 0000000000..33d26f879a --- /dev/null +++ b/pages.cn/linux/mkfs.ntfs.md @@ -0,0 +1,15 @@ +# mkfs.ntfs + +> Creates a NTFS filesystem inside a partition. + +- Create a NTFS filesystem inside partition 1 on device b (`sdb1`): + +`mkfs.ntfs {{/dev/sdb1}}` + +- Create filesystem with a volume-label: + +`mkfs.ntfs -L {{volume_label}} {{/dev/sdb1}}` + +- Create filesystem with specific UUID: + +`mkfs.ntfs -U {{UUID}} {{/dev/sdb1}}` diff --git a/pages.cn/linux/mkfs.vfat.md b/pages.cn/linux/mkfs.vfat.md new file mode 100644 index 0000000000..307b4cb154 --- /dev/null +++ b/pages.cn/linux/mkfs.vfat.md @@ -0,0 +1,19 @@ +# mkfs.vfat + +> Creates an MS-DOS filesystem inside a partition. + +- Create a.vfat filesystem inside partition 1 on device b (`sdb1`): + +`mkfs.vfat {{/dev/sdb1}}` + +- Create filesystem with a volume-name: + +`mkfs.vfat -n {{volume_name}} {{/dev/sdb1}}` + +- Create filesystem with a volume-id: + +`mkfs.vfat -i {{volume_id}} {{/dev/sdb1}}` + +- Use 5 instead of 2 file allocation tables: + +`mkfs.vfat -f 5 {{/dev/sdb1}}` diff --git a/pages.cn/linux/mkisofs.md b/pages.cn/linux/mkisofs.md new file mode 100644 index 0000000000..77a41debe7 --- /dev/null +++ b/pages.cn/linux/mkisofs.md @@ -0,0 +1,12 @@ +# mkisofs + +> Create ISO files from folders. +> Also aliased as `genisoimage`. + +- Create an ISO from a folder: + +`mkisofs -o {{filename.iso}} {{path/to/source_folder}}` + +- Set the disc label when creating an ISO: + +`mkisofs -o {{filename.iso}} -V {{"label_name"}} {{path/to/source_folder}}` diff --git a/pages.cn/linux/mknod.md b/pages.cn/linux/mknod.md new file mode 100644 index 0000000000..53e90446e0 --- /dev/null +++ b/pages.cn/linux/mknod.md @@ -0,0 +1,19 @@ +# mknod + +> Create block or character device special files. + +- Create a block device: + +`sudo mknod {{path/to/device_file}} b {{major_device_number}} {{minor_device_number}}` + +- Create a character device: + +`sudo mknod {{path/to/device_file}} c {{major_device_number}} {{minor_device_number}}` + +- Create a FIFO (queue) device: + +`sudo mknod {{path/to/device_file}} p` + +- Create a device file with default SELinux security context: + +`sudo mknod -Z {{path/to/device_file}} {{type}} {{major_device_number}} {{minor_device_number}}` diff --git a/pages.cn/linux/mkswap.md b/pages.cn/linux/mkswap.md new file mode 100644 index 0000000000..263afd6a36 --- /dev/null +++ b/pages.cn/linux/mkswap.md @@ -0,0 +1,19 @@ +# mkswap + +> Sets up a Linux swap area on a device or in a file. + +- Setup a given partition as swap area: + +`sudo mkswap {{/dev/sdb7}}` + +- Use a given file as swap area: + +`sudo mkswap {{path/to/file}}` + +- Check a partition for bad blocks before creating the swap area: + +`sudo mkswap -c {{/dev/sdb7}}` + +- Specify a label for the file (to allow `swapon` to use the label): + +`sudo mkswap -L {{swap1}} {{path/to/file}}` diff --git a/pages.cn/linux/modinfo.md b/pages.cn/linux/modinfo.md new file mode 100644 index 0000000000..a10d7a2ba6 --- /dev/null +++ b/pages.cn/linux/modinfo.md @@ -0,0 +1,11 @@ +# modinfo + +> Extract information about a Linux kernel module. + +- List all attributes of a kernel module: + +`modinfo {{kernel_module}}` + +- List the specified attribute only: + +`modinfo -F {{author|description|license|parm|filename}} {{kernel_module}}` diff --git a/pages.cn/linux/modprobe.md b/pages.cn/linux/modprobe.md new file mode 100644 index 0000000000..27c3d8b261 --- /dev/null +++ b/pages.cn/linux/modprobe.md @@ -0,0 +1,23 @@ +# modprobe + +> Add or remove modules from the Linux kernel. + +- Pretend to load a module into the kernel, but don't actually do it: + +`sudo modprobe --dry-run {{module_name}}` + +- Load a module into the kernel: + +`sudo modprobe {{module_name}}` + +- Remove a module from the kernel: + +`sudo modprobe --remove {{module_name}}` + +- Remove a module and those that depend on it from the kernel: + +`sudo modprobe --remove-dependencies {{module_name}}` + +- Show a kernel module's dependencies: + +`sudo modprobe --show-depends {{module_name}}` diff --git a/pages.cn/linux/mpstat.md b/pages.cn/linux/mpstat.md new file mode 100644 index 0000000000..8ca1319338 --- /dev/null +++ b/pages.cn/linux/mpstat.md @@ -0,0 +1,15 @@ +# mpstat + +> Report CPU statistics. + +- Display CPU statistics every 2 seconds: + +`mpstat {{2}}` + +- Display 5 reports, one by one, at 2 second intervals: + +`mpstat {{2}} {{5}}` + +- Display 5 reports, one by one, from a given processor, at 2 second intervals: + +`mpstat -P {{0}} {{2}} {{5}}` diff --git a/pages.cn/linux/mycli.md b/pages.cn/linux/mycli.md new file mode 100644 index 0000000000..72490483cd --- /dev/null +++ b/pages.cn/linux/mycli.md @@ -0,0 +1,15 @@ +# mycli + +> A CLI for MySQL, MariaDB, and Percona with auto-completion and syntax highlighting. + +- Connect to a database with the currently logged in user: + +`mycli {{database_name}}` + +- Connect to a database with the specified user: + +`mycli -u {{user}} {{database_name}}` + +- Connect to a database on the specified host with the specified user: + +`mycli -u {{user}} -h {{host}} {{database_name}}` diff --git a/pages.cn/linux/n.md b/pages.cn/linux/n.md new file mode 100644 index 0000000000..cc3db8f9f5 --- /dev/null +++ b/pages.cn/linux/n.md @@ -0,0 +1,23 @@ +# n + +> Tool to manage multiple node versions. + +- Install a given version of node. If the version is already installed, it will be activated: + +`n {{version}}` + +- Display installed versions and interactively activate one of them: + +`n` + +- Remove a version: + +`n rm {{version}}` + +- Execute a file with a given version: + +`n use {{version}} {{file.js}}` + +- Output binary path for a version: + +`n bin {{version}}` diff --git a/pages.cn/linux/namei.md b/pages.cn/linux/namei.md new file mode 100644 index 0000000000..211f24f585 --- /dev/null +++ b/pages.cn/linux/namei.md @@ -0,0 +1,24 @@ +# namei + +> Follows a pathname (which can be a symbolic link) until a terminal point is found (a file/directory/char device etc). +> This program is useful for finding "too many levels of symbolic links" problems. + +- Resolve the pathnames specified as the argument parameters: + +`namei {{path/to/a}} {{path/to/b}} {{path/to/c}}` + +- Display the results in a long-listing format: + +`namei --long {{path/to/a}} {{path/to/b}} {{path/to/c}}` + +- Show the mode bits of each file type in the style of `ls`: + +`namei --modes {{path/to/a}} {{path/to/b}} {{path/to/c}}` + +- Show owner and group name of each file: + +`namei --owners {{path/to/a}} {{path/to/b}} {{path/to/c}}` + +- Don't follow symlinks while resolving: + +`namei --nosymlinks {{path/to/a}} {{path/to/b}} {{path/to/c}}` diff --git a/pages.cn/linux/ncat.md b/pages.cn/linux/ncat.md new file mode 100644 index 0000000000..c8da3aad51 --- /dev/null +++ b/pages.cn/linux/ncat.md @@ -0,0 +1,15 @@ +# ncat + +> Use the normal `cat` functionality over networks. + +- Listen for input on the specified port and write it to the specified file: + +`ncat -l {{port}} > {{path/to/file}}` + +- Accept multiple connections and keep ncat open after they have been closed: + +`ncat -lk {{port}}` + +- Write output of specified file to the specified host on the specified port: + +`ncat {{address}} {{port}} < {{path/to/file}}` diff --git a/pages.cn/linux/ncdu.md b/pages.cn/linux/ncdu.md new file mode 100644 index 0000000000..f2c14616e1 --- /dev/null +++ b/pages.cn/linux/ncdu.md @@ -0,0 +1,19 @@ +# ncdu + +> Disk usage analyzer with an ncurses interface. + +- Analyze the current working directory: + +`ncdu` + +- Analyze a given directory: + +`ncdu {{path/to/directory}}` + +- Save results to a file: + +`ncdu -o {{path/to/file}}` + +- Exclude files that match a pattern, argument can be given multiple times to add more patterns: + +`ncdu --exclude '{{*.txt}}'` diff --git a/pages.cn/linux/ndctl.md b/pages.cn/linux/ndctl.md new file mode 100644 index 0000000000..d0c7fb29e6 --- /dev/null +++ b/pages.cn/linux/ndctl.md @@ -0,0 +1,31 @@ +# ndctl + +> Utility for managing Non-Volatile DIMMs. + +- Create an 'fsdax' mode namespace: + +`ndctl create-namespace --mode={{fsdax}}` + +- Change the mode of a namespace to 'raw': + +`ndctl create-namespace --reconfigure={{namespaceX.Y}} --mode={{raw}}` + +- Check a sector mode namespace for consistency, and repair if needed: + +`ndctl check-namespace --repair {{namespaceX.Y}}` + +- List all namespaces, regions, and buses (including disabled ones): + +`ndctl list --namespaces --regions --buses --idle` + +- List a specific namespace and include lots of additional information: + +`ndctl list -vvv --namespace={{namespaceX.Y}}` + +- Run a monitor to watch for SMART health events for NVDIMMs on the 'ACPI.NFIT' bus: + +`ndctl monitor --bus={{ACPI.NFIT}}` + +- Remove a namespace (when applicable) or reset it to an initial state: + +`ndctl destroy-namespace --force {{namespaceX.Y}}` diff --git a/pages.cn/linux/nethogs.md b/pages.cn/linux/nethogs.md new file mode 100644 index 0000000000..a602fa1ae0 --- /dev/null +++ b/pages.cn/linux/nethogs.md @@ -0,0 +1,19 @@ +# nethogs + +> Monitor bandwidth usage per process. + +- Start nethogs as root (default device is eth0): + +`sudo nethogs` + +- Monitor bandwidth on specific device: + +`sudo nethogs {{device}}` + +- Monitor bandwidth on multiple devices: + +`sudo nethogs {{device1}} {{device2}}` + +- Specify refresh rate: + +`sudo nethogs -t {{seconds}}` diff --git a/pages.cn/linux/netstat.md b/pages.cn/linux/netstat.md new file mode 100644 index 0000000000..51a65aacc5 --- /dev/null +++ b/pages.cn/linux/netstat.md @@ -0,0 +1,35 @@ +# netstat + +> Displays network-related information such as open connections, open socket ports, etc. + +- List all ports: + +`netstat -a` + +- List all listening ports: + +`netstat -l` + +- List listening TCP ports: + +`netstat -t` + +- Display PID and program names: + +`netstat -p` + +- List information continuously: + +`netstat -c` + +- List routes and do not resolve IP to hostname: + +`netstat -rn` + +- List listening TCP and UDP ports (+ user and process if you're root): + +`netstat -lepunt` + +- Print the routing table: + +`netstat -nr` diff --git a/pages.cn/linux/nft.md b/pages.cn/linux/nft.md new file mode 100644 index 0000000000..329cd5d310 --- /dev/null +++ b/pages.cn/linux/nft.md @@ -0,0 +1,32 @@ +# nft + +> Allows configuration of tables, chains and rules provided by the Linux kernel firewall. +> Nftables replaces iptables. + +- View current configuration: + +`sudo nft list ruleset` + +- Add a new table with family "inet" and table "filter": + +`sudo nft add table {{inet}} {{filter}}` + +- Add a new chain to accept all inbound traffic: + +`sudo nft add chain {{inet}} {{filter}} {{input}} \{ type {{filter}} hook {{input}} priority {{0}} \; policy {{accept}} \}` + +- Add a new rule to accept several TCP ports: + +`sudo nft add rule {{inet}} {{filter}} {{input}} {{tcp}} {{dport \{ telnet, ssh, http, https \} accept}}` + +- Show rule handles: + +`sudo nft --handle --numeric list chain {{family}} {{table}} {{chain}}` + +- Delete a rule: + +`sudo nft delete rule {{inet}} {{filter}} {{input}} handle {{3}}` + +- Save current configuration: + +`sudo nft list ruleset > {{/etc/nftables.conf}}` diff --git a/pages.cn/linux/nm.md b/pages.cn/linux/nm.md new file mode 100644 index 0000000000..f2cfecdd6f --- /dev/null +++ b/pages.cn/linux/nm.md @@ -0,0 +1,19 @@ +# nm + +> List symbol names in object files. + +- List global (extern) functions in a file (prefixed with T): + +`nm -g {{file.o}}` + +- Demangle C++ symbols (make them readable): + +`nm --demangle {{file.o}}` + +- List only undefined symbols in a file: + +`nm -u {{file.o}}` + +- List all symbols, even debugging symbols: + +`nm -a {{file.o}}` diff --git a/pages.cn/linux/nmcli.md b/pages.cn/linux/nmcli.md new file mode 100644 index 0000000000..6abe3bab49 --- /dev/null +++ b/pages.cn/linux/nmcli.md @@ -0,0 +1,27 @@ +# nmcli + +> A command line tool for controlling NetworkManager. + +- List all NetworkManager connections (shows name, uuid, type and device): + +`nmcli connection` + +- Print the available Wi-Fi access points: + +`nmcli device wifi` + +- Connect to the Wi-Fi network with a specified name and password: + +`nmcli device wifi connect {{name}} {{password}}` + +- Activate a connection by specifying an uuid: + +`nmcli connection up uuid {{uuid}}` + +- Deactivate a connection: + +`nmcli connection down uuid {{uuid}}` + +- Print statuses of network interfaces: + +`nmcli device status` diff --git a/pages.cn/linux/nmon.md b/pages.cn/linux/nmon.md new file mode 100644 index 0000000000..cad8bdb01d --- /dev/null +++ b/pages.cn/linux/nmon.md @@ -0,0 +1,15 @@ +# nmon + +> A system administrator, tuner, and benchmark tool. + +- Start nmon: + +`nmon` + +- Save records to file ("-s 300 -c 288" by default): + +`nmon -f` + +- Save records to file with a total of 240 measurements, by taking 30 seconds between each measurement: + +`nmon -f -s {{30}} -c {{240}}` diff --git a/pages.cn/linux/nmtui.md b/pages.cn/linux/nmtui.md new file mode 100644 index 0000000000..a0729376af --- /dev/null +++ b/pages.cn/linux/nmtui.md @@ -0,0 +1,24 @@ +# nmtui + +> Text user interface for controlling NetworkManager. +> Use arrow keys to navigate, enter to select an option. + +- Open the user interface: + +`nmtui` + +- Show a list of available connections, with the option to activate or deactivate them: + +`nmtui connect` + +- Connect to a given network: + +`nmtui connect {{name|uuid|device|SSID}}` + +- Edit/Add/Delete a given network: + +`nmtui edit {{name|id}}` + +- Set the system hostname: + +`nmtui hostname` diff --git a/pages.cn/linux/notify-send.md b/pages.cn/linux/notify-send.md new file mode 100644 index 0000000000..4083cfe011 --- /dev/null +++ b/pages.cn/linux/notify-send.md @@ -0,0 +1,15 @@ +# notify-send + +> Uses the current desktop environment's notification system to create a notification. + +- Show a notification with the title "Test" and the content "This is a test": + +`notify-send {{"Test"}} {{"This is a test"}}` + +- Show a notification with a custom icon: + +`notify-send -i {{icon.png}} {{"Test"}} {{"This is a test"}}` + +- Show a notification for 5 seconds: + +`notify-send -t 5000 {{"Test"}} {{"This is a test"}}` diff --git a/pages.cn/linux/ntfsfix.md b/pages.cn/linux/ntfsfix.md new file mode 100644 index 0000000000..0119343928 --- /dev/null +++ b/pages.cn/linux/ntfsfix.md @@ -0,0 +1,7 @@ +# ntfsfix + +> Fix common problems on an NTFS partition. + +- Fix a given NTFS partition: + +`sudo ntfsfix {{/dev/sdb2}}` diff --git a/pages.cn/linux/opkg.md b/pages.cn/linux/opkg.md new file mode 100644 index 0000000000..309bccdaf2 --- /dev/null +++ b/pages.cn/linux/opkg.md @@ -0,0 +1,31 @@ +# opkg + +> A lightweight package manager used to install OpenWrt packages. + +- Install a package: + +`opkg install {{package}}` + +- Remove a package: + +`opkg remove {{package}}` + +- Update the list of available packages: + +`opkg update` + +- Upgrade all the installed packages: + +`opkg upgrade` + +- Upgrade one or more specific package(s): + +`opkg upgrade {{package(s)}}` + +- Display informations for a specific package: + +`opkg info {{package}}` + +- List all the available packages: + +`opkg list` diff --git a/pages.cn/linux/pacaur.md b/pages.cn/linux/pacaur.md new file mode 100644 index 0000000000..56028fc3df --- /dev/null +++ b/pages.cn/linux/pacaur.md @@ -0,0 +1,27 @@ +# pacaur + +> A utility for Arch Linux to build and install packages from the Arch User Repository. + +- Synchronize and update all packages (includes AUR): + +`pacaur -Syu` + +- Synchronize and update only AUR packages: + +`pacaur -Syua` + +- Install a new package (includes AUR): + +`pacaur -S {{package_name}}` + +- Remove a package and its dependencies (includes AUR packages): + +`pacaur -Rs {{package_name}}` + +- Search the package database for a keyword (includes AUR): + +`pacaur -Ss {{keyword}}` + +- List all currently installed packages (includes AUR packages): + +`pacaur -Qs` diff --git a/pages.cn/linux/pacman.md b/pages.cn/linux/pacman.md new file mode 100644 index 0000000000..f10adff2ec --- /dev/null +++ b/pages.cn/linux/pacman.md @@ -0,0 +1,35 @@ +# pacman + +> Arch Linux package manager utility. + +- Synchronize and update all packages: + +`pacman -Syu` + +- Install a new package: + +`pacman -S {{package_name}}` + +- Remove a package and its dependencies: + +`pacman -Rs {{package_name}}` + +- Search the package database for a regular expression or keyword: + +`pacman -Ss "{{search_pattern}}"` + +- List installed packages and versions: + +`pacman -Q` + +- List only the explicitly installed packages and versions: + +`pacman -Qe` + +- Find which package owns a certain file: + +`pacman -Qo {{filename}}` + +- Empty package cache to free up space: + +`pacman -Scc` diff --git a/pages.cn/linux/pamac.md b/pages.cn/linux/pamac.md new file mode 100644 index 0000000000..00d01f16eb --- /dev/null +++ b/pages.cn/linux/pamac.md @@ -0,0 +1,23 @@ +# pamac + +> A command line utility for the GUI package manager pamac. + +- Install a new package: + +`pamac install {{package_name}}` + +- Remove a package and its no longer required dependencies (orphans): + +`pamac remove -o {{package_name}}` + +- Search the package database for a package: + +`pamac search {{package_name}}` + +- List installed packages: + +`pamac list -i` + +- Check for package updates: + +`pamac checkupdates` diff --git a/pages.cn/linux/pasuspender.md b/pages.cn/linux/pasuspender.md new file mode 100644 index 0000000000..2844322683 --- /dev/null +++ b/pages.cn/linux/pasuspender.md @@ -0,0 +1,7 @@ +# pasuspender + +> Temporarily suspends `pulseaudio` while another command is running to allow access to alsa. + +- Suspend pulseaudio while running `jackd`: + +`pasuspender -- {{jackd -d alsa --device hw:0}}` diff --git a/pages.cn/linux/pdfgrep.md b/pages.cn/linux/pdfgrep.md new file mode 100644 index 0000000000..5e229a05b4 --- /dev/null +++ b/pages.cn/linux/pdfgrep.md @@ -0,0 +1,23 @@ +# pdfgrep + +> Search text in PDF files. + +- Find lines that match pattern in a PDF: + +`pdfgrep {{pattern}} {{file.pdf}}` + +- Include file name and page number for each matched line: + +`pdfgrep --with-filename --page-number {{pattern}} {{file.pdf}}` + +- Do a case insensitive search for lines that begin with "foo" and return the first 3 matches: + +`pdfgrep --max-count {{3}} --ignore-case {{'^foo'}} {{file.pdf}}` + +- Find pattern in files with a .pdf extension in the current directory recursively: + +`pdfgrep --recursive {{pattern}}` + +- Find pattern on files that match a specific glob in the current directory recursively: + +`pdfgrep --recursive --include {{'*book.pdf'}} {{pattern}}` diff --git a/pages.cn/linux/perf.md b/pages.cn/linux/perf.md new file mode 100644 index 0000000000..4ea729365b --- /dev/null +++ b/pages.cn/linux/perf.md @@ -0,0 +1,19 @@ +# perf + +> Framework for linux performance counter measurements. + +- Display basic performance counter stats for a command: + +`perf stat {{gcc hello.c}}` + +- Display system-wide real time performance counter profile: + +`sudo perf top` + +- Run a command and record its profile into "perf.data": + +`sudo perf record {{command}}` + +- Read "perf.data" (created by `perf record`) and display the profile: + +`sudo perf report` diff --git a/pages.cn/linux/phar.md b/pages.cn/linux/phar.md new file mode 100644 index 0000000000..d873a006f2 --- /dev/null +++ b/pages.cn/linux/phar.md @@ -0,0 +1,35 @@ +# phar + +> Create, update or extract PHP archives (PHAR). + +- Add space-separated files or directories to a Phar file: + +`phar add -f {{path/to/phar_file}} {{files_or_directories}}` + +- Display the contents of a Phar file: + +`phar list -f {{path/to/phar_file}}` + +- Delete the specified file or directory from a Phar file: + +`phar delete -f {{path/to/phar_file}} -e {{file_or_directory}}` + +- Display full usage information and available hashing/compression algorithms: + +`phar help` + +- Compress or uncompress files and directories in a Phar file: + +`phar compress -f {{path/to/phar_file}} -c {{algorithm}}` + +- Get information about a Phar file: + +`phar info -f {{path/to/phar_file}}` + +- Sign a Phar file with a specific hash algorithm: + +`phar sign -f {{path/to/phar_file}} -h {{algorithm}}` + +- Sign a Phar file with an OpenSSL private key: + +`phar sign -f {{path/to/phar_file}} -h openssl -y {{path/to/private_key}}` diff --git a/pages.cn/linux/pkgadd.md b/pages.cn/linux/pkgadd.md new file mode 100644 index 0000000000..5a22fd3c3a --- /dev/null +++ b/pages.cn/linux/pkgadd.md @@ -0,0 +1,11 @@ +# pkgadd + +> Add a package to a CRUX system. + +- Install a local software package: + +`pkgadd {{package_name}}` + +- Update an already installed package from a local package: + +`pkgadd -u {{package_name}}` diff --git a/pages.cn/linux/pkginfo.md b/pages.cn/linux/pkginfo.md new file mode 100644 index 0000000000..567aefbaa4 --- /dev/null +++ b/pages.cn/linux/pkginfo.md @@ -0,0 +1,19 @@ +# pkginfo + +> Query the package database on a CRUX system. + +- List installed packages and their versions: + +`pkginfo -i` + +- List files owned by a package: + +`pkginfo -l {{package_name}}` + +- List the owner(s) of files matching a pattern: + +`pkginfo -o {{pattern}}` + +- Print the footprint of a file: + +`pkginfo -f {{file}}` diff --git a/pages.cn/linux/pkgmk.md b/pages.cn/linux/pkgmk.md new file mode 100644 index 0000000000..3f9ea5f588 --- /dev/null +++ b/pages.cn/linux/pkgmk.md @@ -0,0 +1,27 @@ +# pkgmk + +> Make a binary package for use with pkgadd on CRUX. + +- Make and download a package: + +`pkgmk -d` + +- Install the package after making it: + +`pkgmk -d -i` + +- Upgrade the package after making it: + +`pkgmk -d -u` + +- Ignore the footprint when making a package: + +`pkgmk -d -if` + +- Ignore the MD5 sum when making a package: + +`pkgmk -d -im` + +- Update the package's footprint: + +`pkgmk -uf` diff --git a/pages.cn/linux/pkgrm.md b/pages.cn/linux/pkgrm.md new file mode 100644 index 0000000000..c197400343 --- /dev/null +++ b/pages.cn/linux/pkgrm.md @@ -0,0 +1,7 @@ +# pkgrm + +> Remove a package from a CRUX system. + +- Remove an installed package: + +`pkgrm {{package_name}}` diff --git a/pages.cn/linux/playerctl.md b/pages.cn/linux/playerctl.md new file mode 100644 index 0000000000..3c1212055d --- /dev/null +++ b/pages.cn/linux/playerctl.md @@ -0,0 +1,27 @@ +# playerctl + +> Utility to control different media players. + +- Toggle play: + +`playerctl play-pause` + +- Next media: + +`playerctl next` + +- Previous media: + +`playerctl previous` + +- List all players: + +`playerctl --list-all` + +- Send a command to a specific player: + +`playerctl --player={{player_name}} {{command}}` + +- Send a command to all players: + +`playerctl --all-players {{command}}` diff --git a/pages.cn/linux/popd.md b/pages.cn/linux/popd.md new file mode 100644 index 0000000000..34576cbe7c --- /dev/null +++ b/pages.cn/linux/popd.md @@ -0,0 +1,15 @@ +# popd + +> Remove a directory placed on the directory stack by the `pushd` command. + +- Remove the top directory from the stack and cd to it: + +`popd` + +- Remove the Nth directory (starting from zero to the left from the list printed with `dirs`): + +`popd +N` + +- Remove the Nth directory (starting from zero to the right from the list printed with `dirs`): + +`popd -N` diff --git a/pages.cn/linux/ports.md b/pages.cn/linux/ports.md new file mode 100644 index 0000000000..97372e95f1 --- /dev/null +++ b/pages.cn/linux/ports.md @@ -0,0 +1,15 @@ +# ports + +> Update/list the ports tree on a CRUX system. + +- Update the ports tree: + +`ports -u` + +- List the ports in the current tree: + +`ports -l` + +- Check the differences between installed packages and the ports tree: + +`ports -d` diff --git a/pages.cn/linux/poweroff.md b/pages.cn/linux/poweroff.md new file mode 100644 index 0000000000..370a38128a --- /dev/null +++ b/pages.cn/linux/poweroff.md @@ -0,0 +1,7 @@ +# poweroff + +> Shutdown the system. + +- Poweroff the system: + +`sudo poweroff` diff --git a/pages.cn/linux/print.md b/pages.cn/linux/print.md new file mode 100644 index 0000000000..03088430cd --- /dev/null +++ b/pages.cn/linux/print.md @@ -0,0 +1,12 @@ +# print + +> An alias to a `run-mailcap`'s action print. +> Originally `run-mailcap` is used to process mime-type/file. + +- Print action can be used to print any file on default run-mailcap tool: + +`print {{filename}}` + +- With `run-mailcap`: + +`run-mailcap --action=print {{filename}}` diff --git a/pages.cn/linux/prt-get.md b/pages.cn/linux/prt-get.md new file mode 100644 index 0000000000..4968b7912c --- /dev/null +++ b/pages.cn/linux/prt-get.md @@ -0,0 +1,31 @@ +# prt-get + +> The advanced CRUX package manager. + +- Install a package: + +`prt-get install {{package_name}}` + +- Install a package with dependency handling: + +`prt-get depinst {{package_name}}` + +- Update a package manually: + +`prt-get upgrade {{package_name}}` + +- Remove a package: + +`prt-get remove {{package_name}}` + +- Upgrade the system from the local ports tree: + +`prt-get sysup` + +- Search the ports tree: + +`prt-get search {{package_name}}` + +- Search for a file in a package: + +`prt-get fsearch {{file}}` diff --git a/pages.cn/linux/pstree.md b/pages.cn/linux/pstree.md new file mode 100644 index 0000000000..ad5ef346b9 --- /dev/null +++ b/pages.cn/linux/pstree.md @@ -0,0 +1,15 @@ +# pstree + +> A convenient tool to show running processes as a tree. + +- Display a tree of processes: + +`pstree` + +- Display a tree of processes with PIDs: + +`pstree -p` + +- Display all process trees rooted at processes owned by specified user: + +`pstree {{user}}` diff --git a/pages.cn/linux/pulseaudio.md b/pages.cn/linux/pulseaudio.md new file mode 100644 index 0000000000..d048441aff --- /dev/null +++ b/pages.cn/linux/pulseaudio.md @@ -0,0 +1,23 @@ +# pulseaudio + +> The pulseaudio sound system daemon and manager. + +- Check if pulseaudio is running (a non-zero exit code means it is not running): + +`pulseaudio --check` + +- Start the pulseaudio daemon in the background: + +`pulseaudio --start` + +- Kill the running pulseaudio daemon: + +`pulseaudio --kill` + +- List available modules: + +`pulseaudio --dump-modules` + +- Load a module into the currently running daemon with the specified arguments: + +`pulseaudio --load="{{module_name}} {{arguments}}"` diff --git a/pages.cn/linux/pushd.md b/pages.cn/linux/pushd.md new file mode 100644 index 0000000000..56095473e6 --- /dev/null +++ b/pages.cn/linux/pushd.md @@ -0,0 +1,16 @@ +# pushd + +> Place a directory on a stack so it can be accessed later. +> See also `popd` to switch back to original directory. + +- Switch to directory and push it on the stack: + +`pushd < {{directory}}` + +- Switch first and second directories on the stack: + +`pushd` + +- Rotate stack by making the 5th element the top of the stack: + +`pushd +4` diff --git a/pages.cn/linux/pvcreate.md b/pages.cn/linux/pvcreate.md new file mode 100644 index 0000000000..2cccd9b90b --- /dev/null +++ b/pages.cn/linux/pvcreate.md @@ -0,0 +1,11 @@ +# pvcreate + +> Initialize a physical volume (disk or partition) for use by the Logical Volume Manager (LVM). + +- Initialize the `/dev/sda1` volume for use by LVM: + +`pvcreate {{/dev/sda1}}` + +- Force the creation without any confirmation prompts: + +`pvcreate --force {{/dev/sda1}}` diff --git a/pages.cn/linux/pwgen.md b/pages.cn/linux/pwgen.md new file mode 100644 index 0000000000..70f4cc67ff --- /dev/null +++ b/pages.cn/linux/pwgen.md @@ -0,0 +1,15 @@ +# pwgen + +> Generate pronounceable passwords. + +- Generate random password with s[y]mbols: + +`pwgen -y {{length}}` + +- Generate secure, hard-to-memorize passwords: + +`pwgen -s {{length}}` + +- Generate password with at least one capital letter in them: + +`pwgen -c {{length}}` diff --git a/pages.cn/linux/qsub.md b/pages.cn/linux/qsub.md new file mode 100644 index 0000000000..9a8558b863 --- /dev/null +++ b/pages.cn/linux/qsub.md @@ -0,0 +1,19 @@ +# qsub + +> Submits a script to the queue management system TORQUE. + +- Submit a script with default settings (depends on TORQUE settings): + +`qsub {{script.sh}}` + +- Submit a script with a specified wallclock runtime limit of 1 hour, 2 minutes and 3 seconds: + +`qsub -l walltime={{1}}:{{2}}:{{3}} {{script.sh}}` + +- Submit a script that is executed on 2 nodes using 4 cores per node: + +`qsub -l nodes={{2}}:ppn={{4}} {{script.sh}}` + +- Submit a script to a specific queue. Note that different queues can have different maximum and minimum runtime limits: + +`qsub -q {{queue_name}} {{script.sh}}` diff --git a/pages.cn/linux/quotacheck.md b/pages.cn/linux/quotacheck.md new file mode 100644 index 0000000000..28edc2daff --- /dev/null +++ b/pages.cn/linux/quotacheck.md @@ -0,0 +1,28 @@ +# quotacheck + +> Scan a filesystem for disk usage; create, check and repair quota files. +> It is best to run quota check with quotas turned off to prevent damage or loss to quota files. + +- Check quotas on all mounted non-NFS filesystems: + +`sudo quotacheck --all` + +- Force check even if quotas are enabled (this can cause damage or loss to quota files): + +`sudo quotacheck --force {{mountpoint}}` + +- Check quotas on a given filesystem in debug mode: + +`sudo quotacheck --debug {{mountpoint}}` + +- Check quotas on a given filesystem, displaying the progress: + +`sudo quotacheck --verbose {{mountpoint}}` + +- Check user quotas: + +`sudo quotacheck --user {{user}} {{mountpoint}}` + +- Check group quotas: + +`sudo quotacheck --group {{group}} {{mountpoint}}` diff --git a/pages.cn/linux/rdesktop.md b/pages.cn/linux/rdesktop.md new file mode 100644 index 0000000000..227bdfe293 --- /dev/null +++ b/pages.cn/linux/rdesktop.md @@ -0,0 +1,28 @@ +# rdesktop + +> Remote Desktop Protocol client. +> It can be used to connect the remote computer using the RDP protocol. + +- Connect to a remote computer (default port is 3389): + +`rdesktop -u {{username}} -p {{password}} {{host:port}}` + +- Simple Examples: + +`rdesktop -u Administrator -p passwd123 192.168.1.111:3389` + +- Connect to a remote computer with full screen (press `Ctrl + Alt + Enter` to exist): + +`rdesktop -u {{username}} -p {{password}} -f {{host:port}}` + +- Use the customed resolution (use the letter 'x' between the number): + +`rdesktop -u {{username}} -p {{password}} -g 1366x768 {{host:port}}` + +- Connect to a remote computer using domain user: + +`rdesktop -u {{username}} -p {{password}} -d {{domainname}} {{host:port}}` + +- Use the 16 bit color (speed up): + +`rdesktop -u {{username}} -p {{password}} -a 16 {{host:port}}` diff --git a/pages.cn/linux/reboot.md b/pages.cn/linux/reboot.md new file mode 100644 index 0000000000..32e9538d5d --- /dev/null +++ b/pages.cn/linux/reboot.md @@ -0,0 +1,11 @@ +# reboot + +> Reboot the system. + +- Reboot immediately: + +`reboot` + +- Reboot immediately without gracefully shutdown: + +`reboot -f` diff --git a/pages.cn/linux/reflector.md b/pages.cn/linux/reflector.md new file mode 100644 index 0000000000..d41cc65138 --- /dev/null +++ b/pages.cn/linux/reflector.md @@ -0,0 +1,15 @@ +# reflector + +> Arch script to fetch and sort mirrorlists. + +- Get all mirrors, sort for download speed and save them: + +`sudo reflector --sort {{rate}} --save {{/etc/pacman.d/mirrorlist}}` + +- Only get German HTTPS mirrors: + +`reflector --country {{Germany}} --protocol {{https}}` + +- Only get the 10 recently sync'd mirrors: + +`reflector --latest {{10}}` diff --git a/pages.cn/linux/repquota.md b/pages.cn/linux/repquota.md new file mode 100644 index 0000000000..64de3d0d36 --- /dev/null +++ b/pages.cn/linux/repquota.md @@ -0,0 +1,27 @@ +# repquota + +> Display a summary of existing file quotas for a filesystem. + +- Report stats for all quotas in use: + +`sudo repquota -all` + +- Report quota stats for all users, even those who aren't using any of their quota: + +`sudo repquota -v {{filesystem}}` + +- Report on quotas for users only: + +`repquota --user {{filesystem}}` + +- Report on quotas for groups only: + +`sudo repquota --group {{filesystem}}` + +- Report on used quota and limits in a human-readable format: + +`sudo repquota --human-readable {{filesystem}}` + +- Report on all quotas for users and groups in a human-readable format: + +`sudo repquota -augs` diff --git a/pages.cn/linux/reset.md b/pages.cn/linux/reset.md new file mode 100644 index 0000000000..2eb6954c02 --- /dev/null +++ b/pages.cn/linux/reset.md @@ -0,0 +1,11 @@ +# reset + +> Reinitialises the current terminal. Clears the entire terminal screen. + +- Reinitialise the current terminal: + +`reset` + +- Display the terminal type instead: + +`reset -q` diff --git a/pages.cn/linux/rfkill.md b/pages.cn/linux/rfkill.md new file mode 100644 index 0000000000..9ecdb7dbf7 --- /dev/null +++ b/pages.cn/linux/rfkill.md @@ -0,0 +1,23 @@ +# rfkill + +> Enable and disable wireless devices. + +- List devices: + +`rfkill` + +- Filter by columns: + +`rfkill -o {{ID,TYPE,DEVICE}}` + +- Block devices by type (e.g. bluetooth, wlan): + +`rfkill block {{bluetooth}}` + +- Unblock devices by type (e.g. bluetooth, wlan): + +`rfkill unblock {{wlan}}` + +- Output in JSON format: + +`rfkill -J` diff --git a/pages.cn/linux/rofi.md b/pages.cn/linux/rofi.md new file mode 100644 index 0000000000..44b7aaf8e0 --- /dev/null +++ b/pages.cn/linux/rofi.md @@ -0,0 +1,15 @@ +# rofi + +> An application launcher and window switcher. + +- Show the list of apps: + +`rofi -show drun` + +- Show the list of all commands: + +`rofi -show run` + +- Switch between windows: + +`rofi -show window` diff --git a/pages.cn/linux/rpcinfo.md b/pages.cn/linux/rpcinfo.md new file mode 100644 index 0000000000..70ad2dd2d9 --- /dev/null +++ b/pages.cn/linux/rpcinfo.md @@ -0,0 +1,23 @@ +# rpcinfo + +> Makes an RPC call to an RPC server and reports what it finds. + +- Show full table of all RPC services registered on localhost: + +`rpcinfo` + +- Show concise table of all RPC services registered on localhost: + +`rpcinfo -s {{localhost}}` + +- Display table of statistics of rpcbind operations on localhost: + +`rpcinfo -m` + +- Display list of entries of given service name (mountd) and version number (2) on a remote nfs share: + +`rpcinfo -l {{remote_nfs_server_ip}} {{mountd}} {{2}}` + +- Delete the registration for version 1 of the mountd service for all transports: + +`rpcinfo -d {{mountd}} {{1}}` diff --git a/pages.cn/linux/rpm.md b/pages.cn/linux/rpm.md new file mode 100644 index 0000000000..ea62afdc17 --- /dev/null +++ b/pages.cn/linux/rpm.md @@ -0,0 +1,27 @@ +# rpm + +> RPM Package Manager. + +- Show version of httpd package: + +`rpm -q {{httpd}}` + +- List versions of all matching packages: + +`rpm -qa '{{mariadb*}}'` + +- Identify owner of a file and show version of the package: + +`rpm -qf {{/etc/postfix/main.cf}}` + +- List package-owned files: + +`rpm -ql {{kernel}}` + +- Show scriptlets from an RPM file: + +`rpm -qp --scripts {{some.rpm}}` + +- Show changed, missing and/or incorrectly installed files of matching packages: + +`rpm -Va '{{php-*}}'` diff --git a/pages.cn/linux/rspamc.md b/pages.cn/linux/rspamc.md new file mode 100644 index 0000000000..32d7284c7a --- /dev/null +++ b/pages.cn/linux/rspamc.md @@ -0,0 +1,19 @@ +# rspamc + +> Command line client for rspamd servers. + +- Train the bayesian filter to recognise an email as spam: + +`rspamc learn_spam {{path/to/email_file}}` + +- Train the bayesian filter to recognise an email as ham: + +`rspamc learn_ham {{path/to/email_file}}` + +- Generate a manual report on an email: + +`rspamc symbols {{path/to/email_file}}` + +- Show server statistics: + +`rspamc stat` diff --git a/pages.cn/linux/rtcwake.md b/pages.cn/linux/rtcwake.md new file mode 100644 index 0000000000..89ca07c018 --- /dev/null +++ b/pages.cn/linux/rtcwake.md @@ -0,0 +1,27 @@ +# rtcwake + +> Enter a system sleep state until specified wakeup time relative to your bios clock. + +- Show whether an alarm is set or not: + +`sudo rtcwake -m show -v` + +- Suspend to ram and wakeup after 10 seconds: + +`sudo rtcwake -m mem -s {{10}}` + +- Suspend to disk (higher power saving) and wakeup 15 minutes later: + +`sudo rtcwake -m disk --date +{{15}}min` + +- Freeze the system (more efficient than suspend-to-ram but linux > 3.9 required) and wakeup at a given date and time: + +`sudo rtcwake -m freeze --date {{YYYYMMDDhhmm}}` + +- Disable a previously set alarm: + +`sudo rtc -m disable` + +- Perform a dry run to wakup the computer at a given time. (Press Ctrl + C to abort): + +`sudo rtcwake -m on --date {{hh:ss}}` diff --git a/pages.cn/linux/rtorrent.md b/pages.cn/linux/rtorrent.md new file mode 100644 index 0000000000..14cf9d7e83 --- /dev/null +++ b/pages.cn/linux/rtorrent.md @@ -0,0 +1,19 @@ +# rtorrent + +> Download torrents over the command line. + +- Add a torrent file or magnet to be downloaded: + +`rtorrent {{torrent_or_magnet}}` + +- Start the download: + +`S` + +- View details about downloading torrent: + +`->` + +- Close rtorrent safely: + +`Q` diff --git a/pages.cn/linux/run-mailcap.md b/pages.cn/linux/run-mailcap.md new file mode 100644 index 0000000000..76dbfe32d5 --- /dev/null +++ b/pages.cn/linux/run-mailcap.md @@ -0,0 +1,24 @@ +# run-mailcap + +> Run MailCap Programs. +> Run mailcap view, see, edit, compose, print - execute programs via entries in the mailcap file (or any of its aliases) will use the given action to process each mime-type/file. + +- Individual actions/programs on run-mailcap can be invoked with action flag: + +`run-mailcap --action=ACTION [--option[=value]]` + +- In simple language: + +`run-mailcap --action=ACTION {{filename}}` + +- Turn on extra information: + +`run-mailcap --action=ACTION --debug {{filename}}` + +- Ignore any "copiousoutput" directive and forward output to STD‐OUT: + +`run-mailcap --action=ACTION --nopager {{filename}}` + +- Display the found command without actually executing it: + +`run-mailcap --action=ACTION --norun {{filename}}` diff --git a/pages.cn/linux/runit.md b/pages.cn/linux/runit.md new file mode 100644 index 0000000000..841092117b --- /dev/null +++ b/pages.cn/linux/runit.md @@ -0,0 +1,11 @@ +# runit + +> 3-stage init system. + +- Start runit's 3-stage init scheme: + +`runit` + +- Shut down runit: + +`kill --CONT {{runit_pid}}` diff --git a/pages.cn/linux/runsv.md b/pages.cn/linux/runsv.md new file mode 100644 index 0000000000..8b131ae6a8 --- /dev/null +++ b/pages.cn/linux/runsv.md @@ -0,0 +1,11 @@ +# runsv + +> Start and manage a runit service. + +- Start a runit service as the current user: + +`runsv {{path/to/service}}` + +- Start a runit service as root: + +`sudo runsv {{path/to/service}}` diff --git a/pages.cn/linux/runsvchdir.md b/pages.cn/linux/runsvchdir.md new file mode 100644 index 0000000000..91ee114441 --- /dev/null +++ b/pages.cn/linux/runsvchdir.md @@ -0,0 +1,7 @@ +# runsvchdir + +> Change the directory `runsvdir` uses by default. + +- Switch `runsvdir` directories: + +`sudo runsvchdir {{/path/to/directory}}` diff --git a/pages.cn/linux/runsvdir.md b/pages.cn/linux/runsvdir.md new file mode 100644 index 0000000000..bc1ad17b16 --- /dev/null +++ b/pages.cn/linux/runsvdir.md @@ -0,0 +1,15 @@ +# runsvdir + +> Run an entire directory of services. + +- Start and manage all services in a directory as the current user: + +`runsvdir {{path/to/services}}` + +- Start and manage all services in a directory as root: + +`sudo runsvdir {{path/to/services}}` + +- Start services in separate sessions: + +`runsvdir -P {{path/to/services}}` diff --git a/pages.cn/linux/sar.md b/pages.cn/linux/sar.md new file mode 100644 index 0000000000..f3d04ee036 --- /dev/null +++ b/pages.cn/linux/sar.md @@ -0,0 +1,27 @@ +# sar + +> Monitor performance of various Linux subsystems. + +- Report I/O and transfer rate issued to physical devices, one per second (press CTRL+C to quit): + +`sar -b {{1}}` + +- Report a total of 10 network device statistics, one per 2 seconds: + +`sar -n DEV {{2}} {{10}}` + +- Report CPU utilization, one per 2 seconds: + +`sar -u ALL {{2}}` + +- Report a total of 20 memory utilization statistics, one per second: + +`sar -r ALL {{1}} {{20}}` + +- Report the run queue length and load averages, one per second: + +`sar -q {{1}}` + +- Report paging statistics, one per 5 seconds: + +`sar -B {{5}}` diff --git a/pages.cn/linux/sbatch.md b/pages.cn/linux/sbatch.md new file mode 100644 index 0000000000..34c53678ab --- /dev/null +++ b/pages.cn/linux/sbatch.md @@ -0,0 +1,19 @@ +# sbatch + +> Submit a batch job to the SLURM scheduler. + +- Submit a batch job: + +`sbatch {{path/to/job.sh}}` + +- Submit a batch job with a custom name: + +`sbatch --job-name={{myjob}} {{path/to/job.sh}}` + +- Submit a batch job with a time limit of 30 minutes: + +`sbatch --time={{00:30:00}} {{path/to/job.sh}}` + +- Submit a job and request multiple nodes: + +`sbatch --nodes={{3}} {{path/to/job.sh}}` diff --git a/pages.cn/linux/see.md b/pages.cn/linux/see.md new file mode 100644 index 0000000000..c9ba69dbb5 --- /dev/null +++ b/pages.cn/linux/see.md @@ -0,0 +1,12 @@ +# see + +> Alias to `run-mailcap`'s view. +> An alias to a `run-mailcap`'s action print. + +- See action can be used to view any file (usually image) on default mailcap explorer: + +`see {{filename}}` + +- Using with `run-mailcap`: + +`run-mailcap --action=view {{filename}}` diff --git a/pages.cn/linux/sensible-browser.md b/pages.cn/linux/sensible-browser.md new file mode 100644 index 0000000000..ccb8b2cacb --- /dev/null +++ b/pages.cn/linux/sensible-browser.md @@ -0,0 +1,11 @@ +# sensible-browser + +> Open the default browser. + +- Open a new window of the default browser: + +`sensible-browser` + +- Open a url in the default browser: + +`sensible-browser {{url}}` diff --git a/pages.cn/linux/service.md b/pages.cn/linux/service.md new file mode 100644 index 0000000000..0b8110ab1c --- /dev/null +++ b/pages.cn/linux/service.md @@ -0,0 +1,20 @@ +# service + +> Manage services by running init scripts. +> The full script path should be omitted (/etc/init.d/ is assumed). + +- Start/Stop/Restart/Reload service (start/stop should always be available): + +`service {{init_script}} {{start|stop|restart|reload}}` + +- Do a full restart (runs script twice with start and stop): + +`service {{init_script}} --full-restart` + +- Show the current status of a service: + +`service {{init_script}} status` + +- List the status of all services: + +`service --status-all` diff --git a/pages.cn/linux/setfacl.md b/pages.cn/linux/setfacl.md new file mode 100644 index 0000000000..2ef3268ead --- /dev/null +++ b/pages.cn/linux/setfacl.md @@ -0,0 +1,19 @@ +# setfacl + +> Set file access control lists (ACL). + +- Modify ACL of a file for user with read and write access: + +`setfacl -m u:{{username}}:rw {{file}}` + +- Modify default ACL of a file for all users: + +`setfacl -d -m u::rw {{file}}` + +- Remove ACL of a file for an user: + +`setfacl -x u:{{username}} {{file}}` + +- Remove all ACL entries of a file: + +`setfacl -b {{file}}` diff --git a/pages.cn/linux/shasum.md b/pages.cn/linux/shasum.md new file mode 100644 index 0000000000..64e658ea8b --- /dev/null +++ b/pages.cn/linux/shasum.md @@ -0,0 +1,23 @@ +# shasum + +> Calculate or check cryptographic SHA checksums. + +- Calculate the SHA1 checksum for a file: + +`shasum {{filename}}` + +- Calculate the SHA256 checksum for a file: + +`shasum --algorithm 256 {{filename}}` + +- Calculate the SHA512 checksum for multiple files: + +`shasum --algorithm 512 {{filename1}} {{filename2}}` + +- Check a file with a list of sums against the directory's files: + +`shasum --check {{list_file}}` + +- Calculate the SHA1 checksum from stdin: + +`{{somecommand}} | shasum` diff --git a/pages.cn/linux/shutdown.md b/pages.cn/linux/shutdown.md new file mode 100644 index 0000000000..481a1f14f7 --- /dev/null +++ b/pages.cn/linux/shutdown.md @@ -0,0 +1,23 @@ +# shutdown + +> Shutdown and reboot the system. + +- Power off (halt) immediately: + +`shutdown -h now` + +- Reboot immediately: + +`shutdown -r now` + +- Reboot in 5 minutes: + +`shutdown -r +{{5}} &` + +- Shutdown at 1:00 pm (Uses 24h clock): + +`shutdown -h 13:00` + +- Cancel a pending shutdown/reboot operation: + +`shutdown -c` diff --git a/pages.cn/linux/sinfo.md b/pages.cn/linux/sinfo.md new file mode 100644 index 0000000000..1fbaff2ea5 --- /dev/null +++ b/pages.cn/linux/sinfo.md @@ -0,0 +1,23 @@ +# sinfo + +> View information about SLURM nodes and partitions. + +- View info about available partitions: + +`sinfo` + +- View info about a specific partition: + +`sinfo -p {{partition}}` + +- View info about available nodes: + +`sinfo -N` + +- View info about dead nodes: + +`sinfo -d` + +- View info about idle nodes: + +`sinfo -t {{idle}}` diff --git a/pages.cn/linux/slapt-get.md b/pages.cn/linux/slapt-get.md new file mode 100644 index 0000000000..0af3c82d69 --- /dev/null +++ b/pages.cn/linux/slapt-get.md @@ -0,0 +1,28 @@ +# slapt-get + +> An apt like system for Slackware package management. +> Package sources need to be configured in the slapt-getrc file. + +- Update the list of available packages and versions: + +`slapt-get --update` + +- Install a package, or update it to the latest available version: + +`slapt-get --install {{package_name}}` + +- Remove a package: + +`slapt-get --remove {{package_name}}` + +- Upgrade all installed packages to their latest available versions: + +`slapt-get --upgrade {{package_name}}` + +- Locate packages of interest by the package name, disk set, or version: + +`slapt-get --search {{package_name}}` + +- Show information about a package: + +`slapt-get --show {{package_name}}` diff --git a/pages.cn/linux/sm.md b/pages.cn/linux/sm.md new file mode 100644 index 0000000000..66eb631b29 --- /dev/null +++ b/pages.cn/linux/sm.md @@ -0,0 +1,27 @@ +# sm + +> Displays a short message fullscreen. + +- Display a message fullscreen: + +`sm {{Hello World!}}` + +- Display a message with inverted colors: + +`sm -i {{Hello World!}}` + +- Display a message with a foreground color: + +`sm -f {{blue}} {{Hello World!}}` + +- Display a message with a background color: + +`sm -b {{#008888}} {{Hello World!}}` + +- Rotate the displayed message by n times 90 degrees: + +`sm -r {{3}} {{Hello World!}}` + +- Pipe a message to sm: + +`{{echo Hello World!}} | sm -` diff --git a/pages.cn/linux/smbclient.md b/pages.cn/linux/smbclient.md new file mode 100644 index 0000000000..a9cd0beee2 --- /dev/null +++ b/pages.cn/linux/smbclient.md @@ -0,0 +1,23 @@ +# smbclient + +> FTP-like client to access SMB/CIFS resources on servers. + +- Connect to a share (user will be prompted for password; `exit` to quit the session): + +`smbclient {{//server/share}}` + +- Connect with a different username: + +`smbclient {{//server/share}} --user {{username}}` + +- Connect with a username and password: + +`smbclient {{//server/share}} --user {{username%password}}` + +- Download a file from the server: + +`smbclient {{//server/share}} --directory {{path/to/folder}} --command "get {{file.txt}}"` + +- Upload a file to the server: + +`smbclient {{//server/share}} --directory {{path/to/folder}} --command "put {{file.txt}}"` diff --git a/pages.cn/linux/snap.md b/pages.cn/linux/snap.md new file mode 100644 index 0000000000..415ee3bffe --- /dev/null +++ b/pages.cn/linux/snap.md @@ -0,0 +1,28 @@ +# snap + +> Tool for managing the "snap" self-contained software packages. +> Similar to what `apt` is for ".deb". + +- Search for a package: + +`snap find {{package_name}}` + +- Install a package: + +`snap install {{package_name}}` + +- Update all packages: + +`snap refresh` + +- Display basic information about installed snap software: + +`snap list` + +- Uninstall a package: + +`snap remove {{package_name}}` + +- Check for recent snap changes in the system: + +`snap changes` diff --git a/pages.cn/linux/snapper.md b/pages.cn/linux/snapper.md new file mode 100644 index 0000000000..89b2c21974 --- /dev/null +++ b/pages.cn/linux/snapper.md @@ -0,0 +1,27 @@ +# snapper + +> Filesystem snapshot management tool. + +- List snapshot configs: + +`snapper list-configs` + +- Create snapper config: + +`snapper -c {{config}} create-config {{path/to/directory}}` + +- List snapshots for a config: + +`snapper -c {{config}} list` + +- Create a new snapshot: + +`snapper -c {{config}} snapshot` + +- Delete a snapshot: + +`snapper -c {{config}} delete {{snapshot_number}}` + +- Delete a range of snapshots: + +`snapper -c {{config}} delete {{snapshot_X}}-{{snapshot_Y}}` diff --git a/pages.cn/linux/squeue.md b/pages.cn/linux/squeue.md new file mode 100644 index 0000000000..fdcb4d33d9 --- /dev/null +++ b/pages.cn/linux/squeue.md @@ -0,0 +1,19 @@ +# squeue + +> View the jobs queued in the SLURM scheduler. + +- View the queue: + +`squeue` + +- View jobs queued by a specific user: + +`squeue -u {{username}}` + +- View the queue and refresh every 5 seconds: + +`squeue -i {{5}}` + +- View the queue with expected start times: + +`squeue --start` diff --git a/pages.cn/linux/ss.md b/pages.cn/linux/ss.md new file mode 100644 index 0000000000..a8940c1f1b --- /dev/null +++ b/pages.cn/linux/ss.md @@ -0,0 +1,27 @@ +# ss + +> Utility to investigate sockets. + +- Show all TCP/UDP/RAW/UNIX sockets: + +`ss -a {{-t|-u|-w|-x}}` + +- Filter TCP sockets by states, only/exclude: + +`ss {{state/exclude}} {{bucket/big/connected/synchronized/...}}` + +- Show all TCP sockets connected to the local HTTPS port (443): + +`ss -t src :{{443}}` + +- Show all TCP sockets along with processes connected to a remote ssh port: + +`ss -pt dst :{{ssh}}` + +- Show all UDP sockets connected on specific source and destination ports: + +`ss -u 'sport == :{{source_port}} and dport == :{{destination_port}}'` + +- Show all TCP IPv4 sockets locally connected on the subnet 192.168.0.0/16: + +`ss -4t src {{192.168/16}}` diff --git a/pages.cn/linux/ssh-add.md b/pages.cn/linux/ssh-add.md new file mode 100644 index 0000000000..134a17ddb5 --- /dev/null +++ b/pages.cn/linux/ssh-add.md @@ -0,0 +1,24 @@ +# ssh-add + +> Manage loaded ssh keys in the ssh-agent. +> Ensure that ssh-agent is up and running for the keys to be loaded in it. + +- Add the default ssh keys in "~/.ssh" to the ssh-agent: + +`ssh-add` + +- Add a specific key to the ssh-agent: + +`ssh-add {{path/to/private_key}}` + +- List fingerprints of currently loaded keys: + +`ssh-add -l` + +- Delete a key from the ssh-agent: + +`ssh-add -d {{path/to/private_key}}` + +- Delete all currently loaded keys from the ssh-agent: + +`ssh-add -D` diff --git a/pages.cn/linux/sshuttle.md b/pages.cn/linux/sshuttle.md new file mode 100644 index 0000000000..64ee5a506c --- /dev/null +++ b/pages.cn/linux/sshuttle.md @@ -0,0 +1,16 @@ +# sshuttle + +> Transparent proxy server that tunnels traffic over an SSH connection. +> Doesn't require admin, or any special setup on the remote SSH server. + +- Forward all IPv4 TCP traffic via a remote SSH server: + +`sshuttle --remote={{username}}@{{sshserver}} {{0.0.0.0/0}}` + +- Forward all IPv4 TCP and DNS traffic: + +`sshuttle --dns --remote={{username}}@{{sshserver}} {{0.0.0.0/0}}` + +- Use the tproxy method to forward all IPv4 and IPv6 traffic: + +`sudo sshuttle --method=tproxy --remote={{username}}@{{sshserver}} {{0.0.0.0/0}} {{::/0}} --exclude={{your_local_ip_address}} --exclude={{ssh_server_ip_address}}` diff --git a/pages.cn/linux/strace.md b/pages.cn/linux/strace.md new file mode 100644 index 0000000000..d17744224c --- /dev/null +++ b/pages.cn/linux/strace.md @@ -0,0 +1,27 @@ +# strace + +> Troubleshooting tool for tracing system calls. + +- Start tracing a specific process by its PID: + +`strace -p {{pid}}` + +- Trace a process and filter output by system call: + +`strace -p {{pid}} -e {{system_call_name}}` + +- Count time, calls, and errors for each system call and report a summary on program exit: + +`strace -p {{pid}} -c` + +- Show the time spent in every system call: + +`strace -p {{pid}} -T` + +- Start tracing a program by executing it: + +`strace {{program}}` + +- Start tracing file operations of a program: + +`strace -e trace=file {{program}}` diff --git a/pages.cn/linux/sv.md b/pages.cn/linux/sv.md new file mode 100644 index 0000000000..0567e0d0c8 --- /dev/null +++ b/pages.cn/linux/sv.md @@ -0,0 +1,15 @@ +# sv + +> Control a running runsv service. + +- Start a service: + +`sudo sv up {{path/to/service}}` + +- Stop a service: + +`sudo sv down {{path/to/service}}` + +- Get service status: + +`sudo sv status {{path/to/service}}` diff --git a/pages.cn/linux/swapoff.md b/pages.cn/linux/swapoff.md new file mode 100644 index 0000000000..cc84c76705 --- /dev/null +++ b/pages.cn/linux/swapoff.md @@ -0,0 +1,19 @@ +# swapoff + +> Disables device or file for swapping. + +- Disable a given swap partition: + +`swapoff {{/dev/sdb7}}` + +- Disable a given swap file: + +`swapoff {{path/to/file}}` + +- Disable all swap areas: + +`swapoff -a` + +- Disable swap by label of a device or file: + +`swapoff -L {{swap1}}` diff --git a/pages.cn/linux/swapon.md b/pages.cn/linux/swapon.md new file mode 100644 index 0000000000..89cd4448a2 --- /dev/null +++ b/pages.cn/linux/swapon.md @@ -0,0 +1,23 @@ +# swapon + +> Enables device or file for swapping. + +- Get swap information: + +`swapon -s` + +- Enable a given swap partition: + +`swapon {{/dev/sdb7}}` + +- Enable a given swap file: + +`swapon {{path/to/file}}` + +- Enable all swap areas: + +`swapon -a` + +- Enable swap by label of a device or file: + +`swapon -L {{swap1}}` diff --git a/pages.cn/linux/sysctl.md b/pages.cn/linux/sysctl.md new file mode 100644 index 0000000000..bb7388bccf --- /dev/null +++ b/pages.cn/linux/sysctl.md @@ -0,0 +1,23 @@ +# sysctl + +> List and change kernel runtime variables. + +- Show all available variables and their values: + +`sysctl -a` + +- Set a changeable kernel state variable: + +`sysctl -w {{section.tunable}}={{value}}` + +- Get currently open file handlers: + +`sysctl fs.file-nr` + +- Get limit for simultaneous open files: + +`sysctl fs.file-max` + +- Apply changes from /etc/sysctl.conf: + +`sysctl -p` diff --git a/pages.cn/linux/systemctl.md b/pages.cn/linux/systemctl.md new file mode 100644 index 0000000000..04db9aa21c --- /dev/null +++ b/pages.cn/linux/systemctl.md @@ -0,0 +1,27 @@ +# systemctl + +> Control the systemd system and service manager. + +- List failed units: + +`systemctl --failed` + +- Start/Stop/Restart/Reload a service: + +`systemctl start/stop/restart/reload {{unit}}` + +- Show the status of a unit: + +`systemctl status {{unit}}` + +- Enable/Disable a unit to be started on bootup: + +`systemctl enable/disable {{unit}}` + +- Mask/Unmask a unit, prevent it to be started on bootup: + +`systemctl mask/unmask {{unit}}` + +- Reload systemd, scanning for new or changed units: + +`systemctl daemon-reload` diff --git a/pages.cn/linux/systemd-analyze.md b/pages.cn/linux/systemd-analyze.md new file mode 100644 index 0000000000..b914d9a286 --- /dev/null +++ b/pages.cn/linux/systemd-analyze.md @@ -0,0 +1,11 @@ +# systemd-analyze + +> Show timing details about the boot process of units (services, mount points, devices, sockets). + +- List time of each unit to start up: + +`systemd-analyze blame` + +- Print a tree of the time critical chain of units: + +`systemd-analyze critical-chain` diff --git a/pages.cn/linux/tcpflow.md b/pages.cn/linux/tcpflow.md new file mode 100644 index 0000000000..97c771fefd --- /dev/null +++ b/pages.cn/linux/tcpflow.md @@ -0,0 +1,7 @@ +# tcpflow + +> Capture TCP traffic for debugging and analysis. + +- Show all data on the given interface and port: + +`tcpflow -c -i {{eth0}} port {{80}}` diff --git a/pages.cn/linux/tcpkill.md b/pages.cn/linux/tcpkill.md new file mode 100644 index 0000000000..92f3897e52 --- /dev/null +++ b/pages.cn/linux/tcpkill.md @@ -0,0 +1,7 @@ +# tcpkill + +> Kills specified in-progress TCP connections. + +- Kill in-progress connections at a specified interface, host and port: + +`tcpkill -i {{eth1}} host {{192.95.4.27}} and port {{2266}}` diff --git a/pages.cn/linux/terminator.md b/pages.cn/linux/terminator.md new file mode 100644 index 0000000000..b11c69d6c7 --- /dev/null +++ b/pages.cn/linux/terminator.md @@ -0,0 +1,23 @@ +# terminator + +> Arrange multiple GNOME terminals in one window. + +- Start terminator window: + +`terminator` + +- Start with a fullscreen window: + +`terminator -f` + +- Split terminals horizontally: + +`Ctrl + Shift + O` + +- Split terminals vertically: + +`Ctrl + Shift + E` + +- Open new tab: + +`Ctrl + Shift + T` diff --git a/pages.cn/linux/thunar.md b/pages.cn/linux/thunar.md new file mode 100644 index 0000000000..9bda32b04c --- /dev/null +++ b/pages.cn/linux/thunar.md @@ -0,0 +1,15 @@ +# thunar + +> Graphical file manager for XFCE desktop environments. + +- Open a new window showing the current directory: + +`thunar` + +- Open the bulk rename utility: + +`thunar --bulk-rename` + +- Close all open thunar windows: + +`thunar --quit` diff --git a/pages.cn/linux/timedatectl.md b/pages.cn/linux/timedatectl.md new file mode 100644 index 0000000000..0d2170bbb9 --- /dev/null +++ b/pages.cn/linux/timedatectl.md @@ -0,0 +1,23 @@ +# timedatectl + +> Control the system time and date. + +- Check the current system clock time: + +`timedatectl` + +- Set the local time of the system clock directly: + +`timedatectl set-time {{"yyyy-MM-dd hh:mm:ss"}}` + +- List available timezones: + +`timedatectl list-timezones` + +- Set the system timezone: + +`timedatectl set-timezone {{timezone}}` + +- Enable Network Time Protocol (NTP) synchronization: + +`timedatectl set-ntp on` diff --git a/pages.cn/linux/tomb.md b/pages.cn/linux/tomb.md new file mode 100644 index 0000000000..cf2a7e48a6 --- /dev/null +++ b/pages.cn/linux/tomb.md @@ -0,0 +1,31 @@ +# tomb + +> Manage encrypted storage folders that can be safely transported and hidden in a filesystem. + +- Create a new tomb with an initial size of 100MB: + +`tomb dig -s {{100}} {{encrypted_folder.tomb}}` + +- Create a new key file that can be used to lock a tomb; user will be prompted for a password for the key: + +`tomb forge {{encrypted_folder.tomb.key}}` + +- Initialize and lock an empty tomb using a key made with `forge`: + +`tomb lock {{encrypted_folder.tomb}} -k {{encrypted_folder.tomb.key}}` + +- Mount a tomb (by default in /media) using its key, making it usable as a regular filesystem folder: + +`tomb open {{encrypted_folder.tomb}} -k {{encrypted_folder.tomb.key}}` + +- Close a tomb (fails if the tomb is being used by a process): + +`tomb close {{encrypted_folder.tomb}}` + +- Forcefully close all open tombs, killing any applications using them: + +`tomb slam all` + +- List all open tombs: + +`tomb list` diff --git a/pages.cn/linux/top.md b/pages.cn/linux/top.md new file mode 100644 index 0000000000..28d93278f7 --- /dev/null +++ b/pages.cn/linux/top.md @@ -0,0 +1,23 @@ +# top + +> Display dynamic real-time information about running processes. + +- Start top: + +`top` + +- Do not show any idle or zombie processes: + +`top -i` + +- Show only processes owned by given user: + +`top -u {{user_name}}` + +- Show only the processes with the given PID(s), passed as a comma-separated list. (Normally you wouldn't know PIDs off hand. This example picks the PIDs from the process name): + +`top -p $(pgrep -d ',' {{process_name}})` + +- Get help about interactive commands: + +`?` diff --git a/pages.cn/linux/trap.md b/pages.cn/linux/trap.md new file mode 100644 index 0000000000..325b1c1230 --- /dev/null +++ b/pages.cn/linux/trap.md @@ -0,0 +1,20 @@ +# trap + +> Automatically execute commands after receiving signals by processes or the operating system. +> Can be used to perform cleanups for interruptions by the user or other actions. + +- List available signals to set traps for: + +`trap -l` + +- List active traps for the current shell: + +`trap -p` + +- Set a trap to execute commands when one or more signals are detected: + +`trap 'echo "Caught signal {{SIGHUP}}"' {{SIGHUP}}` + +- Remove active traps: + +`trap - {{SIGHUP}} {{SIGINT}}` diff --git a/pages.cn/linux/tree.md b/pages.cn/linux/tree.md new file mode 100644 index 0000000000..836d19addd --- /dev/null +++ b/pages.cn/linux/tree.md @@ -0,0 +1,31 @@ +# tree + +> Show the contents of the current directory as a tree. + +- Show files and directories up to 'num' levels of depth (where 1 means the current directory): + +`tree -L {{num}}` + +- Show directories only: + +`tree -d` + +- Show hidden files too: + +`tree -a` + +- Print the tree without indentation lines, showing the full path instead (use `-N` to not escape whitespace and special characters): + +`tree -i -f` + +- Print the size of each node next to it, in human-readable format: + +`tree -s -h` + +- Filter the tree using a wildcard (glob) pattern: + +`tree -P {{*.txt}}` + +- Ignore entries that match a wildcard (glob) pattern: + +`tree -I {{*.txt}}` diff --git a/pages.cn/linux/trizen.md b/pages.cn/linux/trizen.md new file mode 100644 index 0000000000..14c5ee3b5a --- /dev/null +++ b/pages.cn/linux/trizen.md @@ -0,0 +1,27 @@ +# trizen + +> Arch Linux utility for building packages from the Arch User Repository (AUR). + +- Synchronize and update all AUR packages: + +`trizen -Syua` + +- Install a new package: + +`trizen -S {{package}}` + +- Remove a package and its dependencies: + +`trizen -Rs {{package}}` + +- Search the package database for a keyword: + +`trizen -Ss {{keyword}}` + +- Show information about a package: + +`trizen -Si {{package}}` + +- List installed packages and versions: + +`trizen -Qe` diff --git a/pages.cn/linux/ufw.md b/pages.cn/linux/ufw.md new file mode 100644 index 0000000000..72532088df --- /dev/null +++ b/pages.cn/linux/ufw.md @@ -0,0 +1,36 @@ +# ufw + +> Uncomplicated Firewall. +> Frontend for iptables aiming to make configuration of a firewall easier. + +- Enable ufw: + +`ufw enable` + +- Disable ufw: + +`ufw disable` + +- Show ufw rules, along with their numbers: + +`ufw status numbered` + +- Allow incoming traffic on port 5432 on this host with a comment identifying the service: + +`ufw allow {{5432}} comment {{"Service"}}` + +- Allow only TCP traffic from 192.168.0.4 to any address on this host, on port 22: + +`ufw allow proto {{tcp}} from {{192.168.0.4}} to {{any}} port {{22}}` + +- Deny traffic on port 80 on this host: + +`ufw deny {{80}}` + +- Deny all UDP traffic to port 22: + +`ufw deny proto {{udp}} from {{any}} to {{any}} port {{22}}` + +- Delete a particular rule. The rule number can be retrieved from the `ufw status numbered` command: + +`ufw delete {{rule_number}}` diff --git a/pages.cn/linux/ulimit.md b/pages.cn/linux/ulimit.md new file mode 100644 index 0000000000..30e0e89f1f --- /dev/null +++ b/pages.cn/linux/ulimit.md @@ -0,0 +1,19 @@ +# ulimit + +> Get and set user limits. + +- Get the properties of all the user limits: + +`ulimit -a` + +- Get hard limit for the number of simultaneously opened files: + +`ulimit -H -n` + +- Get soft limit for the number of simultaneously opened files: + +`ulimit -S -n` + +- Set max per-user process limit: + +`ulimit -u 30` diff --git a/pages.cn/linux/umask.md b/pages.cn/linux/umask.md new file mode 100644 index 0000000000..fb6c23582b --- /dev/null +++ b/pages.cn/linux/umask.md @@ -0,0 +1,19 @@ +# umask + +> Manage the read/write/execute permissions that are masked out (i.e. restricted) for newly created files by the user. + +- Display the current mask in octal notation: + +`umask` + +- Display the current mask in symbolic (human-readable) mode: + +`umask -S` + +- Change the mask symbolically to allow read permission for all users (the rest of the mask bits are unchanged): + +`umask {{a+r}}` + +- Set the mask (using octal) to restrict no permissions for the file's owner, and restrict all permissions for everyone else: + +`umask {{077}}` diff --git a/pages.cn/linux/units.md b/pages.cn/linux/units.md new file mode 100644 index 0000000000..712496388f --- /dev/null +++ b/pages.cn/linux/units.md @@ -0,0 +1,24 @@ +# units + +> Provide the conversion between two units of measure. +> Typing 'search {{text}}' in the prompt will display a list of all of the units containing {{text}}. + +- Run in interactive mode: + +`units` + +- Show the conversion between two simple units: + +`units {{quarts}} {{tablespoons}}` + +- Convert between units with quantities: + +`units {{15 pounds}} {{kilograms}}` + +- Show the conversion between two compound units: + +`units {{"meters / second"}} {{"inches / hour"}}` + +- Show the conversion between units with different dimensions: + +`units {{"acres"}} {{"ft^2"}}` diff --git a/pages.cn/linux/unset.md b/pages.cn/linux/unset.md new file mode 100644 index 0000000000..4de7038b2c --- /dev/null +++ b/pages.cn/linux/unset.md @@ -0,0 +1,11 @@ +# unset + +> Remove shell variables or functions. + +- Remove the variables foo and bar: + +`unset {{foo}} {{bar}}` + +- Remove the function my_func: + +`unset -f {{my_func}}` diff --git a/pages.cn/linux/update-alternatives.md b/pages.cn/linux/update-alternatives.md new file mode 100644 index 0000000000..a2761858f9 --- /dev/null +++ b/pages.cn/linux/update-alternatives.md @@ -0,0 +1,23 @@ +# update-alternatives + +> A convenient tool for maintaining symbolic links to determine default commands. + +- Add a symbolic link: + +`sudo update-alternatives --install {{path/to/symlink}} {{command_name}} {{path/to/command_binary}} {{priority}}` + +- Configure a symbolic link for "java": + +`sudo update-alternatives --config {{java}}` + +- Remove a symbolic link: + +`sudo update-alternatives --remove {{java}} {{/opt/java/jdk1.8.0_102/bin/java}}` + +- Display information about a specified command: + +`update-alternatives --display {{java}}` + +- Display all commands and their current selection: + +`update-alternatives --get-selections` diff --git a/pages.cn/linux/update-rc.d.md b/pages.cn/linux/update-rc.d.md new file mode 100644 index 0000000000..f47ac09cd3 --- /dev/null +++ b/pages.cn/linux/update-rc.d.md @@ -0,0 +1,20 @@ +# update-rc.d + +> Install and remove services which are System-V style init script links. +> Init scripts are in the /etc/init.d/. + +- Install a service: + +`update-rc.d {{mysql}} defaults` + +- Enable a service: + +`update-rc.d {{mysql}} enable` + +- Disable a service: + +`update-rc.d {{mysql}} disable` + +- Forcibly remove a service: + +`update-rc.d -f {{mysql}} remove` diff --git a/pages.cn/linux/updatedb.md b/pages.cn/linux/updatedb.md new file mode 100644 index 0000000000..6448281511 --- /dev/null +++ b/pages.cn/linux/updatedb.md @@ -0,0 +1,12 @@ +# updatedb + +> Create or update the database used by `locate`. +> It is usually run daily by cron. + +- Refresh database content: + +`sudo updatedb` + +- Display file names as soon as they are found: + +`sudo updatedb --verbose` diff --git a/pages.cn/linux/useradd.md b/pages.cn/linux/useradd.md new file mode 100644 index 0000000000..5e7690ebfb --- /dev/null +++ b/pages.cn/linux/useradd.md @@ -0,0 +1,23 @@ +# useradd + +> Create a new user. + +- Create new user: + +`useradd {{name}}` + +- Create new user with a default home directory: + +`useradd --create-home {{name}}` + +- Create new user with specified shell: + +`useradd --shell {{/path/to/shell}} {{name}}` + +- Create new user belonging to additional groups (mind the lack of whitespace): + +`useradd --groups {{group1,group2}} {{name}}` + +- Create new system user without a home directory: + +`useradd --no-create-home --system {{name}}` diff --git a/pages.cn/linux/userdel.md b/pages.cn/linux/userdel.md new file mode 100644 index 0000000000..ee7a9a3cf0 --- /dev/null +++ b/pages.cn/linux/userdel.md @@ -0,0 +1,7 @@ +# userdel + +> Remove a user. + +- Remove a user and their home directory: + +`userdel -r {{name}}` diff --git a/pages.cn/linux/usermod.md b/pages.cn/linux/usermod.md new file mode 100644 index 0000000000..7c47f8b207 --- /dev/null +++ b/pages.cn/linux/usermod.md @@ -0,0 +1,15 @@ +# usermod + +> Modifies a user account. + +- Change a user's name: + +`usermod -l {{newname}} {{user}}` + +- Add user to supplementary groups (mind the whitespace): + +`usermod -a -G {{group1,group2}} {{user}}` + +- Create a new home directory for a user and move their files to it: + +`usermod -m -d {{/path/to/home}} {{user}}` diff --git a/pages.cn/linux/vgcreate.md b/pages.cn/linux/vgcreate.md new file mode 100644 index 0000000000..0302fe2eea --- /dev/null +++ b/pages.cn/linux/vgcreate.md @@ -0,0 +1,11 @@ +# vgcreate + +> Create volume groups combining multiple mass-storage devices. + +- Create a new volume group called vg1 using the `/dev/sda1` device: + +`vgcreate {{vg1}} {{/dev/sda1}}` + +- Create a new volume group called vg1 using multiple devices: + +`vgcreate {{vg1}} {{/dev/sda1}} {{/dev/sdb1}} {{/dev/sdc1}}` diff --git a/pages.cn/linux/viewnior.md b/pages.cn/linux/viewnior.md new file mode 100644 index 0000000000..31e0926c11 --- /dev/null +++ b/pages.cn/linux/viewnior.md @@ -0,0 +1,15 @@ +# viewnior + +> Simple and elegant image viewer. + +- View an image: + +`viewnior {{path/to/image.ext}}` + +- View in fullscreen mode: + +`viewnior --fullscreen {{path/to/image.ext}}` + +- View fullscreen in slideshow mode: + +`viewnior --slideshow {{path/to/image.ext}}` diff --git a/pages.cn/linux/vncserver.md b/pages.cn/linux/vncserver.md new file mode 100644 index 0000000000..22efe53e45 --- /dev/null +++ b/pages.cn/linux/vncserver.md @@ -0,0 +1,15 @@ +# vncserver + +> Launches a VNC (Virtual Network Computing) desktop. + +- Launch a VNC Server on next available display: + +`vncserver` + +- Launch a VNC Server with specific screen geometry: + +`vncserver --geometry {{width}}x{{height}}` + +- Kill an instance of VNC Server running on a specific display: + +`vncserver --kill :{{display_number}}` diff --git a/pages.cn/linux/vncviewer.md b/pages.cn/linux/vncviewer.md new file mode 100644 index 0000000000..6e2817ad2b --- /dev/null +++ b/pages.cn/linux/vncviewer.md @@ -0,0 +1,19 @@ +# vncviewer + +> Launches a VNC (Virtual Network Computing) client. + +- Launch a VNC client which connects to a host on a given display: + +`vncviewer {{host}}:{{display_number}}` + +- Launch in full-screen mode: + +`vncviewer -FullScreen {{host}}:{{display_number}}` + +- Launch a VNC client with a specific screen geometry: + +`vncviewer --geometry {{width}}x{{height}} {{host}}:{{display_number}}` + +- Launch a VNC client which connects to a host on a given port: + +`vncviewer {{host}}::{{port}}` diff --git a/pages.cn/linux/wall.md b/pages.cn/linux/wall.md new file mode 100644 index 0000000000..65ac05a9e5 --- /dev/null +++ b/pages.cn/linux/wall.md @@ -0,0 +1,15 @@ +# wall + +> Write a message on the terminals of users currently logged in. + +- Send a message: + +`echo "{{message}}" | wall` + +- Send a message from a file: + +`wall {{file}}` + +- Send a message with timeout (default 300): + +`wall -t {{seconds}} {{file}}` diff --git a/pages.cn/linux/watch.md b/pages.cn/linux/watch.md new file mode 100644 index 0000000000..51effdbeae --- /dev/null +++ b/pages.cn/linux/watch.md @@ -0,0 +1,15 @@ +# watch + +> Execute a command repeatedly, and monitor the output in full-screen mode. + +- Monitor files in the current folder: + +`watch {{ls}}` + +- Monitor disk space and highlight the changes: + +`watch -d {{df}}` + +- Monitor "node" processes, refreshing every 3 seconds: + +`watch -n {{3}} "{{ps aux | grep node}}"` diff --git a/pages.cn/linux/whatis.md b/pages.cn/linux/whatis.md new file mode 100644 index 0000000000..7622759522 --- /dev/null +++ b/pages.cn/linux/whatis.md @@ -0,0 +1,19 @@ +# whatis + +> Display one-line descriptions from manual pages. + +- Display a description from a man page: + +`whatis {{command}}` + +- Don't cut the description off at the end of the line: + +`whatis --long {{command}}` + +- Display descriptions for all commands matching a glob: + +`whatis --wildcard {{net*}}` + +- Search man page descriptions with a regular expression: + +`whatis --regex '{{wish[0-9]\.[0-9]}}'` diff --git a/pages.cn/linux/whereis.md b/pages.cn/linux/whereis.md new file mode 100644 index 0000000000..f59c0180a7 --- /dev/null +++ b/pages.cn/linux/whereis.md @@ -0,0 +1,19 @@ +# whereis + +> Locate the binary, source, and manual page files for a command. + +- Locate binary, source and man pages for ssh: + +`whereis {{ssh}}` + +- Locate binary and man pages for ls: + +`whereis -bm {{ls}}` + +- Locate source of gcc and man pages for git: + +`whereis -s {{gcc}} -m {{git}}` + +- Locate binaries for gcc in /usr/bin/ only: + +`whereis -b -B {{/usr/bin/}} -f {{gcc}}` diff --git a/pages.cn/linux/wodim.md b/pages.cn/linux/wodim.md new file mode 100644 index 0000000000..a82a4910fd --- /dev/null +++ b/pages.cn/linux/wodim.md @@ -0,0 +1,20 @@ +# wodim + +> Command (aliased as `cdrecord` on some systems) for recording data to CDs or DVDs. +> Some invocations of wodim can cause destructive actions, such as erasing all the data on a disc. + +- Display optical drives available to `wodim`: + +`wodim --devices` + +- Record ("burn") an audio-only disc: + +`wodim dev=/dev/{{optical_drive}} -audio {{track*.cdaudio}}` + +- Burn a file to a disc, ejecting the disc once done (some recorders require this): + +`wodim -eject dev=/dev/{{optical_drive}} -data {{file.iso}}` + +- Burn a file to the disc in an optical drive, potentially writing to multiple discs in succession: + +`wodim -tao dev=/dev/{{optical_drive}} -data {{file.iso}}` diff --git a/pages.cn/linux/wpa_cli.md b/pages.cn/linux/wpa_cli.md new file mode 100644 index 0000000000..b0ceaeda4a --- /dev/null +++ b/pages.cn/linux/wpa_cli.md @@ -0,0 +1,27 @@ +# wpa_cli + +> Add and configure wlan interfaces. + +- Scan for available networks: + +`wpa_cli scan` + +- Show scan results: + +`wpa_cli scan_results` + +- Add a network: + +`wpa_cli add_network {{number}}` + +- Set a network's SSID: + +`wpa_cli set_network {{number}} ssid "{{SSID}}"` + +- Enable network: + +`wpa_cli enable_network {{number}}` + +- Save config: + +`wpa_cli save_config` diff --git a/pages.cn/linux/write.md b/pages.cn/linux/write.md new file mode 100644 index 0000000000..37877e0d85 --- /dev/null +++ b/pages.cn/linux/write.md @@ -0,0 +1,16 @@ +# write + +> Write a message on the terminal of a specified logged in user (ctrl-C to stop writing messages). +> Use the `who` command to find out all terminal_ids of all active users active on the system. + +- Send a message to a given user on a given terminal id: + +`write {{username}} {{terminal_id}}` + +- Send message to "testuser" on terminal "/dev/tty/5": + +`write {{testuser}} {{tty/5}}` + +- Send message to "jhondoe" on pseudo terminal "/dev/pts/5": + +`write {{jhondoe}} {{pts/5}}` diff --git a/pages.cn/linux/x11vnc.md b/pages.cn/linux/x11vnc.md new file mode 100644 index 0000000000..5db1cd8a28 --- /dev/null +++ b/pages.cn/linux/x11vnc.md @@ -0,0 +1,24 @@ +# x11vnc + +> A VNC server that will enable VNC on an existing display ser. +> By default, the server will automatically terminate once all clients disconnect from it. + +- Launch a VNC server that allows multiple clients to connect: + +`x11vnc -shared` + +- Launch a VNC server in view-only mode, and which won't terminate once the last client disconnects: + +`x11vnc -forever -viewonly` + +- Launch a VNC server on a specific display and screen (both starting at index zero): + +`x11vnc -display :{{display}}.{{screen}}` + +- Launch a VNC server on the third display's default screen: + +`x11vnc -display :{{2}}` + +- Launch a VNC server on the first display's second screen: + +`x11vnc -display :{{0}}.{{1}}` diff --git a/pages.cn/linux/xar.md b/pages.cn/linux/xar.md new file mode 100644 index 0000000000..9f9eb37acd --- /dev/null +++ b/pages.cn/linux/xar.md @@ -0,0 +1,15 @@ +# xar + +> Manage .xar archives. + +- Create a xar archive of all files in a given directory: + +`xar -cf {{archive.xar}} {{path/to/directory}}` + +- List the contents of a given xar archive: + +`xar -tf {{archive.xar}}` + +- Extract the contents of a given xar archive to the current directory: + +`xar -xf {{archive.xar}}` diff --git a/pages.cn/linux/xbps.md b/pages.cn/linux/xbps.md new file mode 100644 index 0000000000..56478d7c83 --- /dev/null +++ b/pages.cn/linux/xbps.md @@ -0,0 +1,23 @@ +# xbps + +> The X Binary Package System (or xbps) is the binary package system used by Void Linux. + +- Install packages and synchronize them with the remote repository: + +`xbps-install --synchronize {{package_name1}} {{package_name2}}` + +- Search for a package in the remote repository: + +`xbps-query --repository -s {{package_name}}` + +- Remove a package, leaving all of its dependencies installed: + +`xbps-remove {{package_name}}` + +- Remove a package and all of its dependencies recursively that are not required by other packages: + +`xbps-remove --recursive {{package_name}}` + +- Synchronize your repository databases and update your system and dependencies: + +`xbps-install --synchronize -u` diff --git a/pages.cn/linux/xclip.md b/pages.cn/linux/xclip.md new file mode 100644 index 0000000000..5a87db2738 --- /dev/null +++ b/pages.cn/linux/xclip.md @@ -0,0 +1,32 @@ +# xclip + +> X11 clipboard manipulation tool, similar to `xsel`. +> Handles the X primary and secondary selections, plus the system clipboard (`Ctrl + C`/`Ctrl + V`). + +- Copy the output from a command to the X11 primary selection area (clipboard): + +`echo 123 | xclip` + +- Copy the output from a command to a given X11 selection area: + +`echo 123 | xclip -selection {{primary|secondary|clipboard}}` + +- Copy the contents of a file to the system clipboard, using short notation: + +`echo 123 | xclip -sel clip` + +- Copy the contents of a file into the system clipboard: + +`xclip -sel clip {{input_file.txt}}` + +- Paste the contents of the X11 primary selection area to the console: + +`xclip -o` + +- Paste the contents of the system clipboard to the console: + +`xclip -o -sel clip` + +- Paste the contents of the system clipboard into a file: + +`xclip -o -sel clip > {{output_file.txt}}` diff --git a/pages.cn/linux/xdotool.md b/pages.cn/linux/xdotool.md new file mode 100644 index 0000000000..dcb350a8d8 --- /dev/null +++ b/pages.cn/linux/xdotool.md @@ -0,0 +1,27 @@ +# xdotool + +> Command line automation for X11. + +- Retrieve the X-Windows window ID of the running Firefox window(s): + +`xdotool search --onlyvisible --name {{firefox}}` + +- Click the right mouse button: + +`xdotool click {{3}}` + +- Get the id of the currently active window: + +`xdotool getactivewindow` + +- Focus on the window with id of 12345: + +`xdotool windowfocus --sync {{12345}}` + +- Type a message, with a 500ms delay for each letter: + +`xdotool type --delay {{500}} "Hello world"` + +- Press the enter key: + +`xdotool key {{KP_Enter}}` diff --git a/pages.cn/linux/xeyes.md b/pages.cn/linux/xeyes.md new file mode 100644 index 0000000000..315bebeb67 --- /dev/null +++ b/pages.cn/linux/xeyes.md @@ -0,0 +1,11 @@ +# xeyes + +> Display eyes on the screen that follow the mouse cursor. + +- Launch xeyes on the local machine's default display: + +`xeyes` + +- Launch xeyes on a remote machine's display 0, screen 0: + +`xeyes -display {{remote_host}}:{{0}}.{{0}}` diff --git a/pages.cn/linux/xfce4-terminal.md b/pages.cn/linux/xfce4-terminal.md new file mode 100644 index 0000000000..e1d25d5304 --- /dev/null +++ b/pages.cn/linux/xfce4-terminal.md @@ -0,0 +1,27 @@ +# xfce4-terminal + +> The XFCE4 terminal emulator. + +- Open a new terminal window: + +`xfce4-terminal` + +- Set the initial title: + +`xfce4-terminal --initial-title "{{initial_title}}"` + +- Open a new tab in the current terminal window: + +`xfce4-terminal --tab` + +- Execute a command in a new terminal window: + +`xfce4-terminal --command "{{command_with_args}}"` + +- Keep the terminal around after the executed command finishes executing: + +`xfce4-terminal --command "{{command_with_args}}" --hold` + +- Open multiple new tabs, executing a command in each: + +`xfce4-terminal --tab --command "{{command_a}}" --tab --command "{{command_b}}"` diff --git a/pages.cn/linux/xinput.md b/pages.cn/linux/xinput.md new file mode 100644 index 0000000000..e5e1848c63 --- /dev/null +++ b/pages.cn/linux/xinput.md @@ -0,0 +1,15 @@ +# xinput + +> List available input devices, query information about a device and change input device settings. + +- List all input devices: + +`xinput list` + +- Disconnect an input from its master: + +`xinput float {{id}}` + +- Reattach an input as slave to a master: + +`xinput reattach {{id}} {{master_id}}` diff --git a/pages.cn/linux/xman.md b/pages.cn/linux/xman.md new file mode 100644 index 0000000000..8de01da1b6 --- /dev/null +++ b/pages.cn/linux/xman.md @@ -0,0 +1,15 @@ +# xman + +> Manual page viewer for X Window System. + +- Start xman in three-button window: + +`xman` + +- Open the manual page output stored in a given file: + +`xman -helpfile {{filename}}` + +- Show both manual page and directory: + +`xman -bothshown` diff --git a/pages.cn/linux/xrandr.md b/pages.cn/linux/xrandr.md new file mode 100644 index 0000000000..13f24aecb7 --- /dev/null +++ b/pages.cn/linux/xrandr.md @@ -0,0 +1,23 @@ +# xrandr + +> Set the size, orientation and/or reflection of the outputs for a screen. + +- Display the current state of the system (known screens, resolutions, ...): + +`xrandr --query` + +- Disable disconnected outputs and enable connected ones with default settings: + +`xrandr --auto` + +- Change the resolution and update frequency of DisplayPort 1 to 1920x1080, 60Hz: + +`xrandr --output {{DP1}} --mode {{1920x1080}} --rate {{60}}` + +- Set the resolution of HDMI2 to 1280x1024 and put it on the right of DP1: + +`xrandr --output {{HDMI2}} --mode {{1280x1024}} --right-of {{DP1}}` + +- Disable the VGA1 output: + +`xrandr --output {{VGA1}} --off` diff --git a/pages.cn/linux/xsel.md b/pages.cn/linux/xsel.md new file mode 100644 index 0000000000..2c68f31356 --- /dev/null +++ b/pages.cn/linux/xsel.md @@ -0,0 +1,27 @@ +# xsel + +> X11 selection and clipboard manipulation tool. + +- Use a command's output as input of the clip[b]oard (equivalent to `Ctrl + C`): + +`echo 123 | xsel -ib` + +- Use the contents of a file as input of the clipboard: + +`cat {{file}} | xsel -ib` + +- Output the clipboard's contents into the terminal (equivalent to `Ctrl + V`): + +`xsel -ob` + +- Output the clipboard's contents into a file: + +`xsel -ob > {{file}}` + +- Clear the clipboard: + +`xsel -cb` + +- Output the X11 primary selection's contents into the terminal (equivalent to a mouse middle-click): + +`xsel -op` diff --git a/pages.cn/linux/xsetwacom.md b/pages.cn/linux/xsetwacom.md new file mode 100644 index 0000000000..9af3f6fb1a --- /dev/null +++ b/pages.cn/linux/xsetwacom.md @@ -0,0 +1,23 @@ +# xsetwacom + +> Command line tool to change settings for Wacom pen tablets at runtime. + +- List all the available wacom devices. The device name is in the first column: + +`xsetwacom list` + +- Set Wacom area to specific screen. Get name of the screen with `xrandr`: + +`xsetwacom set "{{device_name}}" MapToOutput {{screen}}` + +- Set mode to relative (like a mouse) or absolute (like a pen) mode: + +`xsetwacom set "{{device_name}}" Mode "{{Relative|Absolute}}"` + +- Rotate the input (useful for tablet-PC when rotating screen) by 0|90|180|270 degrees from "natural" rotation: + +`xsetwacom set "{{device_name}}" Rotate {{none|half|cw|ccw}}` + +- Set button to only work when the tip of the pen is touching the tablet: + +`xsetwacom set "{{device_name}}" TabletPCButton "on"` diff --git a/pages.cn/linux/xtrlock.md b/pages.cn/linux/xtrlock.md new file mode 100644 index 0000000000..4be5734035 --- /dev/null +++ b/pages.cn/linux/xtrlock.md @@ -0,0 +1,15 @@ +# xtrlock + +> Lock the X display until the user supplies their password. + +- Lock the display and show a padlock instead of the cursor: + +`xtrlock` + +- Display a blank screen as well as the padlock cursor: + +`xtrlock -b` + +- Fork the xtrlock process and return immediately: + +`xtrlock -f` diff --git a/pages.cn/linux/yank.md b/pages.cn/linux/yank.md new file mode 100644 index 0000000000..d44aed7adc --- /dev/null +++ b/pages.cn/linux/yank.md @@ -0,0 +1,19 @@ +# yank + +> Read input from stdin and display a selection interface that allows a field to be selected and copied to the clipboard. + +- Yank using the default delimiters (\f, \n, \r, \s, \t): + +`{{sudo dmesg}} | yank` + +- Yank an entire line: + +`{{sudo dmesg}} | yank -l` + +- Yank using a specific delimiter: + +`{{echo hello=world}} | yank -d {{=}}` + +- Only yank fields matching a specific pattern: + +`{{ps ux}} | yank -g {{"[0-9]+"}}` diff --git a/pages.cn/linux/yaourt.md b/pages.cn/linux/yaourt.md new file mode 100644 index 0000000000..8660c1db34 --- /dev/null +++ b/pages.cn/linux/yaourt.md @@ -0,0 +1,23 @@ +# yaourt + +> Arch Linux utility for building packages from the Arch User Repository. + +- Synchronize and update all packages (including AUR): + +`yaourt -Syua` + +- Install a new package (includes AUR): + +`yaourt -S {{package_name}}` + +- Remove a package and its dependencies (includes AUR packages): + +`yaourt -Rs {{package_name}}` + +- Search the package database for a keyword (including AUR): + +`yaourt -Ss {{package_name}}` + +- List installed packages, versions, and repositories (AUR packages will be listed under the repository name 'local'): + +`yaourt -Q` diff --git a/pages.cn/linux/yay.md b/pages.cn/linux/yay.md new file mode 100644 index 0000000000..2d1f9c7982 --- /dev/null +++ b/pages.cn/linux/yay.md @@ -0,0 +1,28 @@ +# yay + +> Yet Another Yogurt: A utility for Arch Linux to build and install packages from the Arch User Repository. +> Also see `pacman`. + +- Interactively search and install packages from the repos and AUR: + +`yay {{package_name|search_term}}` + +- Synchronize and update all packages from the repos and AUR: + +`yay` + +- Synchronize and update only AUR packages: + +`yay -Sua` + +- Install a new package from the repos and AUR: + +`yay -S {{package_name}}` + +- Search the package database for a keyword from the repos and AUR: + +`yay -Ss {{keyword}}` + +- Show statistics for installed packages and system health: + +`yay -Ps` diff --git a/pages.cn/linux/yum.md b/pages.cn/linux/yum.md new file mode 100644 index 0000000000..175706778b --- /dev/null +++ b/pages.cn/linux/yum.md @@ -0,0 +1,27 @@ +# yum + +> Package management utility for RHEL, Feodra, and CentOS (for older versions). + +- Synchronize list of packages and versions available. This should be run first, before running subsequent yum commands: + +`yum update` + +- Install a new package: + +`yum install {{package}}` + +- Install a new package and assume yes to all questions (also works with update, great for automated updates): + +`yum -y install {{package}}` + +- Find the package that provides a particular command: + +`yum provides {{command}}` + +- Remove a package: + +`yum remove {{package}}` + +- Upgrade installed packages to newest available versions: + +`yum upgrade` diff --git a/pages.cn/linux/zenity.md b/pages.cn/linux/zenity.md new file mode 100644 index 0000000000..fe81f8db04 --- /dev/null +++ b/pages.cn/linux/zenity.md @@ -0,0 +1,24 @@ +# zenity + +> Display dialogs from the command line/shell scripts. +> Return user-inserted values or 1 if error. + +- Display the default question dialog: + +`zenity --question` + +- Display an info dialog displaying the text "Hello!": + +`zenity --info --text="{{Hello!}}"` + +- Display a name/password form and output the data separated by ";": + +`zenity --forms --add-entry="{{Name}}" --add-password="{{Password}}" --separator="{{;}}"` + +- Display a file selection form in which the user can only select directories: + +`zenity --file-selection --directory` + +- Display a progress bar which updates its message every second and show a progress percent: + +`{{(echo "#1"; sleep 1; echo "50"; echo "#2"; sleep 1; echo "100")}} | zenity --progress` diff --git a/pages.cn/linux/zramctl.md b/pages.cn/linux/zramctl.md new file mode 100644 index 0000000000..183058c5de --- /dev/null +++ b/pages.cn/linux/zramctl.md @@ -0,0 +1,20 @@ +# zramctl + +> Setup and control zram devices. +> Use `mke2fs` or `mkswap` to format zram devices to partitions. + +- Check if zram is enabled: + +`lsmod | grep -i zram` + +- Enable zram with 2 devices (use `zramctl` to configure the devices further): + +`sudo modprobe zram num_devices={{2}}` + +- Find and initialise the next free zram device to a 2GB virtual drive using LZ4 compression: + +`sudo zramctl --find --size {{2GB}} --algorithm {{lz4}}` + +- List currently initialised devices: + +`zramctl` diff --git a/pages.cn/linux/zypper.md b/pages.cn/linux/zypper.md new file mode 100644 index 0000000000..2db099e4d7 --- /dev/null +++ b/pages.cn/linux/zypper.md @@ -0,0 +1,23 @@ +# zypper + +> SUSE & openSUSE package management utility. + +- Synchronize list of packages and versions available: + +`zypper refresh` + +- Install a new package: + +`zypper install {{package}}` + +- Remove a package: + +`zypper remove {{package}}` + +- Upgrade installed packages to newest available versions: + +`zypper update` + +- Search package via keyword: + +`zypper search {{keyword}}` diff --git a/pages.cn/osx/airport.md b/pages.cn/osx/airport.md new file mode 100644 index 0000000000..bd3625b92e --- /dev/null +++ b/pages.cn/osx/airport.md @@ -0,0 +1,19 @@ +# airport + +> Wireless network configuration utility. + +- Show current wireless status information: + +`airport -I` + +- Sniff wireless traffic on channel 1: + +`airport sniff {{1}}` + +- Scan for available wireless networks: + +`airport -s` + +- Disassociate from current airport network: + +`sudo airport -z` diff --git a/pages.cn/osx/apachectl.md b/pages.cn/osx/apachectl.md new file mode 100644 index 0000000000..4158716441 --- /dev/null +++ b/pages.cn/osx/apachectl.md @@ -0,0 +1,15 @@ +# apachectl + +> Apache HTTP Server control interface for macOS. + +- Start the org.apache.httpd launchd job: + +`apachectl start` + +- Stop the launchd job: + +`apachectl stop` + +- Stop, then start launchd job: + +`apachectl restart` diff --git a/pages.cn/osx/archey.md b/pages.cn/osx/archey.md new file mode 100644 index 0000000000..a15250491d --- /dev/null +++ b/pages.cn/osx/archey.md @@ -0,0 +1,19 @@ +# archey + +> Simple tool for stylishly displaying system information. + +- Show system information: + +`archey` + +- Show system information without colored output: + +`archey --nocolor` + +- Show system information, using MacPorts instead of Homebrew: + +`archey --macports` + +- Show system information without IP address check: + +`archey --offline` diff --git a/pages.cn/osx/as.md b/pages.cn/osx/as.md new file mode 100644 index 0000000000..683f797c24 --- /dev/null +++ b/pages.cn/osx/as.md @@ -0,0 +1,20 @@ +# as + +> Portable GNU assembler. +> Primarily intended to assemble output from `gcc` to be used by `ld`. + +- Assemble a file, writing the output to a.out: + +`as {{file.s}}` + +- Assemble the output to a given file: + +`as {{file.s}} -o {{out.o}}` + +- Generate output faster by skipping whitespace and comment preprocessing. (Should only be used for trusted compilers): + +`as -f {{file.s}}` + +- Include a given path to the list of directories to search for files specified in .include directives: + +`as -I {{path/to/directory}} {{file.s}}` diff --git a/pages.cn/osx/asr.md b/pages.cn/osx/asr.md new file mode 100644 index 0000000000..2bcd24c60d --- /dev/null +++ b/pages.cn/osx/asr.md @@ -0,0 +1,20 @@ +# asr + +> Restore (copy) a disk image onto a volume. +> The command name stands for Apple Software Restore. + +- Restore a disk image to a target volume: + +`sudo asr restore --source {{image_name}}.dmg --target {{path/to/volume}}` + +- Erase the target volume before restoring: + +`sudo asr restore --source {{image_name}}.dmg --target {{path/to/volume}} --erase` + +- Skip verification after restoring: + +`sudo asr restore --source {{image_name}}.dmg --target {{path/to/volume}} --noverify` + +- Clone volumes without the use of an intermediate disk image: + +`sudo asr restore --source {{path/to/volume}} --target {{path/to/cloned_volume}}` diff --git a/pages.cn/osx/base64.md b/pages.cn/osx/base64.md new file mode 100644 index 0000000000..bbf963491a --- /dev/null +++ b/pages.cn/osx/base64.md @@ -0,0 +1,19 @@ +# base64 + +> Encode and decode using Base64 representation. + +- Encode a file: + +`base64 -i {{plain_file}}` + +- Decode a file: + +`base64 -D -i {{base64_file}}` + +- Encode from stdin: + +`echo -n {{plain_text}} | base64` + +- Decode from stdin: + +`echo -n {{base64_text}} | base64 -D` diff --git a/pages.cn/osx/brew-cask.md b/pages.cn/osx/brew-cask.md new file mode 100644 index 0000000000..0ce9e36021 --- /dev/null +++ b/pages.cn/osx/brew-cask.md @@ -0,0 +1,35 @@ +# brew cask + +> Package manager for macOS applications distributed as binaries. + +- Search for formulas and casks: + +`brew search {{text}}` + +- Install a cask: + +`brew cask install {{cask_name}}` + +- List all installed casks: + +`brew cask list` + +- List installed casks that have newer versions available: + +`brew cask outdated` + +- Upgrade an installed cask to its latest version: + +`brew cask upgrade {{cask_name}}` + +- Uninstall a cask: + +`brew cask uninstall {{cask_name}}` + +- Uninstall a cask and remove related settings and files: + +`brew cask zap {{cask_name}}` + +- Display information about a given cask: + +`brew cask info {{cask_name}}` diff --git a/pages.cn/osx/brew-mas.md b/pages.cn/osx/brew-mas.md new file mode 100644 index 0000000000..876989b79e --- /dev/null +++ b/pages.cn/osx/brew-mas.md @@ -0,0 +1,27 @@ +# brew mas + +> Mas is a simple command line interface for the Mac App Store. + +- Search the Mac App Store by app name and return matching identifiers: + +`mas search {{app_name}}` + +- Install or update a previously purchased application: + +`mas install {{app_name}} {{app_identifier}}` + +- Show all installed applications and their product identifiers: + +`mas list` + +- List installed apps with pending updates: + +`mas outdated` + +- Install all pending updates: + +`mas upgrade` + +- Install updates for a specific app: + +`mas upgrade {{app_identifier}}` diff --git a/pages.cn/osx/brew.md b/pages.cn/osx/brew.md new file mode 100644 index 0000000000..9fee90feb0 --- /dev/null +++ b/pages.cn/osx/brew.md @@ -0,0 +1,35 @@ +# brew + +> Package manager for macOS. + +- Search for available formulas and casks: + +`brew search {{text}}` + +- Install the latest stable version of a formula (use `--devel` for development versions): + +`brew install {{formula}}` + +- List all installed formulae: + +`brew list` + +- Update an installed formula (if no formula name is given, all installed formulae are updated): + +`brew upgrade {{formula}}` + +- Fetch the newest version of Homebrew and all formulae from GitHub: + +`brew update` + +- Show formulae that have a more recent version available: + +`brew outdated` + +- Display information about a formula (version, installation path, dependencies, etc.): + +`brew info {{formula}}` + +- Check your Homebrew installation for potential problems: + +`brew doctor` diff --git a/pages.cn/osx/brightness.md b/pages.cn/osx/brightness.md new file mode 100644 index 0000000000..0e98b4af47 --- /dev/null +++ b/pages.cn/osx/brightness.md @@ -0,0 +1,15 @@ +# brightness + +> Get and set the brightness level of all internal and certain external displays. + +- Show current brightness: + +`brightness -l` + +- Set the brightness to 100%:: + +`brightness {{1}}` + +- Set the brightness to 50%:: + +`brightness {{0.5}}` diff --git a/pages.cn/osx/caffeinate.md b/pages.cn/osx/caffeinate.md new file mode 100644 index 0000000000..83c3fc87d7 --- /dev/null +++ b/pages.cn/osx/caffeinate.md @@ -0,0 +1,15 @@ +# caffeinate + +> Prevent mac from sleeping. + +- Prevent from sleeping for 1 hour (3600 seconds): + +`caffeinate -u -t {{3600}}` + +- Prevent from sleeping until a command completes: + +`caffeinate -s {{command}}` + +- Prevent from sleeping until you type Ctrl-C: + +`caffeinate -i` diff --git a/pages.cn/osx/cal.md b/pages.cn/osx/cal.md new file mode 100644 index 0000000000..c3ef698621 --- /dev/null +++ b/pages.cn/osx/cal.md @@ -0,0 +1,27 @@ +# cal + +> Prints calendar information. + +- Display a calendar for the current month: + +`cal` + +- Display a calendar for a specific month (1-12 or name): + +`cal -m {{month}}` + +- Display a calendar for the current year: + +`cal -y` + +- Display a calendar for a specific year (4 digits): + +`cal {{year}}` + +- Display a calendar for a specific month and year: + +`cal {{month}} {{year}}` + +- Display date of Easter (Western Christian churches) in a given year: + +`ncal -e {{year}}` diff --git a/pages.cn/osx/carthage.md b/pages.cn/osx/carthage.md new file mode 100644 index 0000000000..257183547e --- /dev/null +++ b/pages.cn/osx/carthage.md @@ -0,0 +1,23 @@ +# carthage + +> A dependency management tool for Cocoa applications. + +- Download the latest version of all dependencies mentioned in Cartfile, and build them: + +`carthage update` + +- Update dependencies, but only build for iOS: + +`carthage update --platform ios` + +- Update dependencies, but don't build any of them: + +`carthage update --no-build` + +- Download and rebuild the current version of dependencies (without updating them): + +`carthage bootstrap` + +- Rebuild a specific dependency: + +`carthage build {{dependency}}` diff --git a/pages.cn/osx/codesign.md b/pages.cn/osx/codesign.md new file mode 100644 index 0000000000..16d34f33ed --- /dev/null +++ b/pages.cn/osx/codesign.md @@ -0,0 +1,11 @@ +# codesign + +> Create and manipulate code signatures for macOS. + +- Sign an application with a certificate: + +`codesign -s {{"My Company Name"}} {{/path/to/App.app}}` + +- Verify the certificate of an application: + +`codesign -v {{/path/to/App.app}}` diff --git a/pages.cn/osx/command.md b/pages.cn/osx/command.md new file mode 100644 index 0000000000..1cd7922d9e --- /dev/null +++ b/pages.cn/osx/command.md @@ -0,0 +1,7 @@ +# command + +> Command forces the shell to execute the program and ignore any functions, builtins and aliases with the same name. + +- Execute the ls program literally, even if an ls alias exists: + +`command {{ls}}` diff --git a/pages.cn/osx/compgen.md b/pages.cn/osx/compgen.md new file mode 100644 index 0000000000..15e3505194 --- /dev/null +++ b/pages.cn/osx/compgen.md @@ -0,0 +1,23 @@ +# compgen + +> A built-in command for auto-completion in bash, which is called on pressing TAB key twice. + +- List all commands that you could run: + +`compgen -c` + +- List all aliases: + +`compgen -a` + +- List all functions that you could run: + +`compgen -A function` + +- Show shell reserved key words: + +`compgen -k` + +- See all available commands/aliases starting with 'ls': + +`compgen -ac {{ls}}` diff --git a/pages.cn/osx/date.md b/pages.cn/osx/date.md new file mode 100644 index 0000000000..92e0971318 --- /dev/null +++ b/pages.cn/osx/date.md @@ -0,0 +1,19 @@ +# date + +> Set or display the system date. + +- Display the current date using the default locale's format: + +`date +"%c"` + +- Display the current date in UTC and ISO 8601 format: + +`date -u +"%Y-%m-%dT%H:%M:%SZ"` + +- Display the current date as a Unix timestamp (seconds since the Unix epoch): + +`date +%s` + +- Display a specific date (represented as a Unix timestamp) using the default format: + +`date -r 1473305798` diff --git a/pages.cn/osx/dd.md b/pages.cn/osx/dd.md new file mode 100644 index 0000000000..8ca14df8da --- /dev/null +++ b/pages.cn/osx/dd.md @@ -0,0 +1,19 @@ +# dd + +> Convert and copy a file. + +- Make a bootable usb drive from an isohybrid file (such like archlinux-xxx.iso): + +`dd if={{file.iso}} of=/dev/{{usb_drive}}` + +- Clone a drive to another drive with 4MB block and ignore error: + +`dd if=/dev/{{source_drive}} of=/dev/{{dest_drive}} bs=4m conv=noerror` + +- Generate a file of 100 random bytes by using kernel random driver: + +`dd if=/dev/urandom of={{random_file}} bs=100 count=1` + +- Benchmark the write performance of a disk: + +`dd if=/dev/zero of={{file_1GB}} bs=1024 count=1000000` diff --git a/pages.cn/osx/defaults.md b/pages.cn/osx/defaults.md new file mode 100644 index 0000000000..9a359da9e3 --- /dev/null +++ b/pages.cn/osx/defaults.md @@ -0,0 +1,23 @@ +# defaults + +> Read and write macOS user configuration for applications. + +- Read system defaults for an application option: + +`defaults read {{application}} {{option}}` + +- Read default values for an application option: + +`defaults read -app {{application}} {{option}}` + +- Write the default value of an application option: + +`defaults write {{application}} {{option}} {{-type}} {{value}}` + +- Speed up Mission Control animations: + +`defaults write com.apple.Dock expose-animation-duration -float 0.1` + +- Delete all defaults of an application: + +`defaults delete {{application}}` diff --git a/pages.cn/osx/diskutil.md b/pages.cn/osx/diskutil.md new file mode 100644 index 0000000000..a55a3b6262 --- /dev/null +++ b/pages.cn/osx/diskutil.md @@ -0,0 +1,19 @@ +# diskutil + +> Utility to manage local disks and volumes. + +- List all currently available disks, partitions and mounted volumes: + +`diskutil list` + +- Repair the file system data structures of a volume: + +`diskutil repairVolume {{/dev/diskX}}` + +- Unmount a volume: + +`diskutil unmountDisk {{/dev/diskX}}` + +- Eject a CD/DVD (unmount first): + +`diskutil eject {{/dev/disk1}}` diff --git a/pages.cn/osx/ditto.md b/pages.cn/osx/ditto.md new file mode 100644 index 0000000000..039824b664 --- /dev/null +++ b/pages.cn/osx/ditto.md @@ -0,0 +1,15 @@ +# ditto + +> Copy files and folders. + +- Overwrite contents of destination folder with contents of source folder: + +`ditto {{path/to/source}} {{path/to/destination}}` + +- Print a line to the Terminal window for every file that’s being copied: + +`ditto -V {{path/to/source}} {{path/to/destination}}` + +- Copy a given file or folder, while retaining the original file permissions: + +`ditto -rsrc {{path/to/source}} {{path/to/destination}}` diff --git a/pages.cn/osx/dmesg.md b/pages.cn/osx/dmesg.md new file mode 100644 index 0000000000..eb3b54352e --- /dev/null +++ b/pages.cn/osx/dmesg.md @@ -0,0 +1,15 @@ +# dmesg + +> Write the kernel messages to standard output. + +- Show kernel messages: + +`dmesg` + +- Show how much physical memory is available on this system: + +`dmesg | grep -i memory` + +- Show kernel messages 1 page at a time: + +`dmesg | less` diff --git a/pages.cn/osx/drutil.md b/pages.cn/osx/drutil.md new file mode 100644 index 0000000000..ce41c8e748 --- /dev/null +++ b/pages.cn/osx/drutil.md @@ -0,0 +1,11 @@ +# drutil + +> Interact with DVD burners. + +- Eject a disk from the drive: + +`drutil eject` + +- Burn a folder as an ISO9660 filesystem onto a DVD. Don't verify and eject when complete: + +`drutil burn -noverify -eject -iso9660` diff --git a/pages.cn/osx/du.md b/pages.cn/osx/du.md new file mode 100644 index 0000000000..10def6fe96 --- /dev/null +++ b/pages.cn/osx/du.md @@ -0,0 +1,27 @@ +# du + +> Disk usage: estimate and summarize file and folder space usage. + +- List the sizes of a folder and any subfolders, in the given unit (KB/MB/GB): + +`du -{{k|m|g}} {{path/to/folder}}` + +- List the sizes of a folder and any subfolders, in human-readable form (i.e. auto-selecting the appropriate unit for each size): + +`du -h {{path/to/folder}}` + +- Show the size of a single folder, in human readable units: + +`du -sh {{path/to/folder}}` + +- List the human-readable sizes of a folder and of all the files and folders within it: + +`du -ah {{path/to/folder}}` + +- List the human-readable sizes of a folder and any subfolders, up to N levels deep: + +`du -h -d {{N}} {{path/to/folder}}` + +- List the human-readable size of all .jpg files in subfolders of the current folder, and show a cumulative total at the end: + +`du -ch */*.jpg` diff --git a/pages.cn/osx/duti.md b/pages.cn/osx/duti.md new file mode 100644 index 0000000000..5f6c616358 --- /dev/null +++ b/pages.cn/osx/duti.md @@ -0,0 +1,27 @@ +# duti + +> Set default applications for document types and URL schemes on macOS. + +- Set Safari as the default handler for HTML documents: + +`duti -s {{com.apple.Safari}} {{public.html}} all` + +- Set VLC as the default viewer for files with .m4v extensions: + +`duti -s {{org.videolan.vlc}} {{m4v}} viewer` + +- Set Finder as the default handler for the ftp:// URL scheme: + +`duti -s {{com.apple.Finder}} {{ftp}}` + +- Display information about the default application for a given extension: + +`duti -x {{ext}}` + +- Display the default handler for a given UTI: + +`duti -d {{uti}}` + +- Display all handlers of a given UTI: + +`duti -l {{uti}}` diff --git a/pages.cn/osx/eval.md b/pages.cn/osx/eval.md new file mode 100644 index 0000000000..ee1135a91d --- /dev/null +++ b/pages.cn/osx/eval.md @@ -0,0 +1,11 @@ +# eval + +> Execute arguments as a single command in the current shell and return its result. + +- Call `echo` with the "foo" argument: + +`eval "{{echo foo}}"` + +- Set a variable in the current shell: + +`eval "{{foo=bar}}"` diff --git a/pages.cn/osx/export.md b/pages.cn/osx/export.md new file mode 100644 index 0000000000..c09481e8e2 --- /dev/null +++ b/pages.cn/osx/export.md @@ -0,0 +1,15 @@ +# export + +> Command to mark shell variables in the current environment to be exported with any newly forked child processes. + +- Set a new environment variable: + +`export {{VARIABLE}}={{value}}` + +- Remove an environment variable: + +`export -n {{VARIABLE}}` + +- Append something to the PATH variable: + +`export PATH=$PATH:{{path/to/append}}` diff --git a/pages.cn/osx/fc.md b/pages.cn/osx/fc.md new file mode 100644 index 0000000000..7e6c464104 --- /dev/null +++ b/pages.cn/osx/fc.md @@ -0,0 +1,15 @@ +# fc + +> Open the most recent command and edit it. + +- Open in the default system editor: + +`fc` + +- Specify an editor to open with: + +`fc -e {{'emacs'}}` + +- List recent commands from history: + +`fc -l` diff --git a/pages.cn/osx/feh.md b/pages.cn/osx/feh.md new file mode 100644 index 0000000000..3d3464c917 --- /dev/null +++ b/pages.cn/osx/feh.md @@ -0,0 +1,27 @@ +# feh + +> Lightweight image viewing utility. + +- View images locally or using a URL: + +`feh {{path/to/images}}` + +- View images recursively: + +`feh --recursive {{path/to/images}}` + +- View images without window borders: + +`feh --borderless {{path/to/images}}` + +- Exit after the last image: + +`feh --cycle-once {{path/to/images}}` + +- Set the slideshow cycle delay: + +`feh --slideshow-delay {{seconds}} {{path/to/images}}` + +- Set your wallpaper (centered, filled, maximized, scaled or tiled): + +`feh --bg-{{center|fill|max|scale|tile}} {{path/to/image}}` diff --git a/pages.cn/osx/file.md b/pages.cn/osx/file.md new file mode 100644 index 0000000000..841d703d37 --- /dev/null +++ b/pages.cn/osx/file.md @@ -0,0 +1,23 @@ +# file + +> Determine file type. + +- Give a description of the type of the specified file. Works fine for files with no file extension: + +`file {{filename}}` + +- Look inside a zipped file and determine the file type(s) inside: + +`file -z {{foo.zip}}` + +- Allow file to work with special or device files: + +`file -s {{filename}}` + +- Don't stop at first file type match; keep going until the end of the file: + +`file -k {{filename}}` + +- Determine the mime encoding type of a file: + +`file -I {{filename}}` diff --git a/pages.cn/osx/fsck.md b/pages.cn/osx/fsck.md new file mode 100644 index 0000000000..7ba5270693 --- /dev/null +++ b/pages.cn/osx/fsck.md @@ -0,0 +1,20 @@ +# fsck + +> Check the integrity of a filesystem or repair it. The filesystem should be unmounted at the time the command is run. +> It is a wrapper that calls `fsck_hfs`, `fsck_apfs`, `fsck_msdos`, `fsck_exfat`, and `fsck_udf` as needed. + +- Check filesystem /dev/sda, reporting any damaged blocks: + +`fsck {{/dev/sda}}` + +- Check filesystem /dev/sda only if it is clean, reporting any damaged blocks and interactively letting the user choose to repair each one: + +`fsck -f {{/dev/sda}}` + +- Check filesystem /dev/sda only if it is clean, reporting any damaged blocks and automatically repairing them: + +`fsck -fy {{/dev/sda}}` + +- Check filesystem /dev/sda, reporting whether it has been cleanly unmounted: + +`fsck -q {{/dev/sda}}` diff --git a/pages.cn/osx/gunicorn.md b/pages.cn/osx/gunicorn.md new file mode 100644 index 0000000000..eaeaa68d83 --- /dev/null +++ b/pages.cn/osx/gunicorn.md @@ -0,0 +1,27 @@ +# gunicorn + +> Python WSGI HTTP Server. + +- Run Python web app: + +`gunicorn {{import.path:app_object}}` + +- Listen on port 8080 on localhost: + +`gunicorn --bind {{localhost}}:{{8080}} {{import.path:app_object}}` + +- Turn on live reload: + +`gunicorn --reload {{import.path:app_object}}` + +- Use 4 worker processes for handling requests: + +`gunicorn --workers {{4}} {{import.path:app_object}}` + +- Use 4 worker threads for handling requests: + +`gunicorn --threads {{4}} {{import.path:app_object}}` + +- Run app over HTTPS: + +`gunicorn --certfile {{cert.pem}} --keyfile {{key.pem}} {{import.path:app_object}}` diff --git a/pages.cn/osx/head.md b/pages.cn/osx/head.md new file mode 100644 index 0000000000..993a1f8f1d --- /dev/null +++ b/pages.cn/osx/head.md @@ -0,0 +1,11 @@ +# head + +> Output the first part of files. + +- Output the first few lines of a file: + +`head -n {{count_of_lines}} {{filename}}` + +- Output the first few bytes of a file: + +`head -c {{number_in_bytes}} {{filename}}` diff --git a/pages.cn/osx/hexdump.md b/pages.cn/osx/hexdump.md new file mode 100644 index 0000000000..b0463261cf --- /dev/null +++ b/pages.cn/osx/hexdump.md @@ -0,0 +1,15 @@ +# hexdump + +> An ASCII, decimal, hexadecimal, octal dump. + +- Print the hexadecimal representation of a file: + +`hexdump {{file}}` + +- Display the input offset in hexadecimal and its ASCII representation in two columns: + +`hexdump -C {{file}}` + +- Display the hexadecimal representation of a file, but interpret only n bytes of the input: + +`hexdump -C -n{{number_of_bytes}} {{file}}` diff --git a/pages.cn/osx/hostname.md b/pages.cn/osx/hostname.md new file mode 100644 index 0000000000..88d0981d6b --- /dev/null +++ b/pages.cn/osx/hostname.md @@ -0,0 +1,11 @@ +# hostname + +> Show or set the system's host name. + +- Show current host name: + +`hostname` + +- Set current host name: + +`hostname {{new_hostname}}` diff --git a/pages.cn/osx/imgcat.md b/pages.cn/osx/imgcat.md new file mode 100644 index 0000000000..0b97ee824e --- /dev/null +++ b/pages.cn/osx/imgcat.md @@ -0,0 +1,8 @@ +# imgcat + +> A utility to display images directly on the command line. +> Requires a compatible terminal such as iTerm2. + +- Display an image on the command line: + +`imgcat {{filename}}` diff --git a/pages.cn/osx/launchctl.md b/pages.cn/osx/launchctl.md new file mode 100644 index 0000000000..5977338d46 --- /dev/null +++ b/pages.cn/osx/launchctl.md @@ -0,0 +1,32 @@ +# launchctl + +> A command-line interface to Apple's `launchd` manager for launch daemons (system-wide services) and launch agents (per-user programs). +> `launchd` loads XML-based `*.plist` files placed in the appropriate locations, and runs the corresponding commands according to their defined schedule. + +- Activate a user-specific agent to be loaded into `launchd` whenever the user logs in: + +`launchctl load ~/Library/LaunchAgents/{{my_script}}.plist` + +- Activate an agent which requires root privileges to run and/or should be loaded whenever any user logs in (note the absence of `~` in the path): + +`sudo launchctl load /Library/LaunchAgents/{{root_script}}.plist` + +- Activate a system-wide daemon to be loaded whenever the system boots up (even if no user logs in): + +`sudo launchctl load /Library/LaunchDaemons/{{system_daemon}}.plist` + +- Show all loaded agents/daemons, with the PID if the process they specify is currently running, and the exit code returned the last time they ran: + +`launchctl list` + +- Unload a currently loaded agent, e.g. to make changes (note: the plist file is automatically loaded into `launchd` after a reboot and/or logging in): + +`launchctl unload ~/Library/LaunchAgents/{{my_script}}.plist` + +- Manually run a known (loaded) agent/daemon, even if it isn’t the right time (note: this command uses the agent's label, rather than the filename): + +`launchctl start {{my_script}}` + +- Manually kill the process associated with a known agent/daemon, if it's running: + +`launchctl stop {{my_script}}` diff --git a/pages.cn/osx/lldb.md b/pages.cn/osx/lldb.md new file mode 100644 index 0000000000..8255dc7e36 --- /dev/null +++ b/pages.cn/osx/lldb.md @@ -0,0 +1,15 @@ +# lldb + +> The LLVM Low-Level Debugger. + +- Debug an executable: + +`lldb {{executable}}` + +- Attach `lldb` to a running process with a given PID: + +`lldb -p {{pid}}` + +- Wait for a new process to launch with a given name, and attach to it: + +`lldb -w -n {{process_name}}` diff --git a/pages.cn/osx/locate.md b/pages.cn/osx/locate.md new file mode 100644 index 0000000000..aaa66a9875 --- /dev/null +++ b/pages.cn/osx/locate.md @@ -0,0 +1,15 @@ +# locate + +> Find filenames quickly. + +- Look for pattern in the database. Note: the database is recomputed periodically (usually weekly or daily): + +`locate {{pattern}}` + +- Look for a file by its exact filename (a pattern containing no globbing characters is interpreted as `*pattern*`): + +`locate */{{filename}}` + +- Recompute the database. You need to do it if you want to find recently added files: + +`sudo /usr/libexec/locate.updatedb` diff --git a/pages.cn/osx/logger.md b/pages.cn/osx/logger.md new file mode 100644 index 0000000000..d5bad38eb6 --- /dev/null +++ b/pages.cn/osx/logger.md @@ -0,0 +1,23 @@ +# logger + +> Add messages to syslog (/var/log/syslog). + +- Log a message to syslog: + +`logger {{message}}` + +- Take input from stdin and log to syslog: + +`echo {{log_entry}} | logger` + +- Send the output to a remote syslog server running at a given port. Default port is 514: + +`echo {{log_entry}} | logger -h {{hostname}} -P {{port}}` + +- Use a specific tag for every line logged. Default is the name of logged in user: + +`echo {{log_entry}} | logger -t {{tag}}` + +- Log messages with a given priority. Default is `user.notice`. See `man logger` for all priority options: + +`echo {{log_entry}} | logger -p {{user.warning}}` diff --git a/pages.cn/osx/look.md b/pages.cn/osx/look.md new file mode 100644 index 0000000000..3ef7c169dd --- /dev/null +++ b/pages.cn/osx/look.md @@ -0,0 +1,11 @@ +# look + +> Look for lines in sorted file. + +- Look for lines which begins with the given prefix: + +`look {{prefix}} {{file}}` + +- Look for lines ignoring case: + +`look -f {{prefix}} {{file}}` diff --git a/pages.cn/osx/m.md b/pages.cn/osx/m.md new file mode 100644 index 0000000000..d790c6fbbf --- /dev/null +++ b/pages.cn/osx/m.md @@ -0,0 +1,23 @@ +# m + +> Swiss Army Knife for macOS. + +- Get the battery status: + +`m battery status` + +- Turn off bluetooth: + +`m bluetooth off` + +- List available filesystems for formatting: + +`m disk filesystems` + +- Enable Dock's auto hide feature: + +`m dock autohide YES` + +- Disable the firewall: + +`m firewall disable` diff --git a/pages.cn/osx/md5.md b/pages.cn/osx/md5.md new file mode 100644 index 0000000000..8e7da5b266 --- /dev/null +++ b/pages.cn/osx/md5.md @@ -0,0 +1,19 @@ +# md5 + +> Calculate MD5 cryptographic checksums. + +- Calculate the MD5 checksum for a file: + +`md5 {{filename}}` + +- Calculate MD5 checksums for multiple files: + +`md5 {{filename1}} {{filename2}}` + +- Output only the md5 checksum (no filename): + +`md5 -q {{filename}}` + +- Print a checksum of the given string: + +`md5 -s {{string}}` diff --git a/pages.cn/osx/mdfind.md b/pages.cn/osx/mdfind.md new file mode 100644 index 0000000000..2fc2ada13c --- /dev/null +++ b/pages.cn/osx/mdfind.md @@ -0,0 +1,15 @@ +# mdfind + +> List files matching a given query. + +- Find a file by its name: + +`mdfind -name {{file}}` + +- Find a file by its content: + +`mdfind {{query}}` + +- Find a file containing a string, in a given directory: + +`mdfind -onlyin {{directory}} {{query}}` diff --git a/pages.cn/osx/mdutil.md b/pages.cn/osx/mdutil.md new file mode 100644 index 0000000000..efcf728d52 --- /dev/null +++ b/pages.cn/osx/mdutil.md @@ -0,0 +1,15 @@ +# mdutil + +> Manage the metadata stores used by Spotlight for indexing. + +- Show the indexing status of the startup volume: + +`mdutil -s {{/}}` + +- Turn on/off the Spotlight indexing for a given volume: + +`mdutil -i {{on|off}} {{path/to/volume}}` + +- Erase the metadata stores and restart the indexing process: + +`mdutil -E {{path/to/volume}}` diff --git a/pages.cn/osx/mkfile.md b/pages.cn/osx/mkfile.md new file mode 100644 index 0000000000..7b36140981 --- /dev/null +++ b/pages.cn/osx/mkfile.md @@ -0,0 +1,15 @@ +# mkfile + +> Create one or more empty files of any size. + +- Create an empty file of 15 kilobytes: + +`mkfile -n {{15k}} {{file_name}}` + +- Create a file of a given size and unit (bytes, KB, MB, GB): + +`mkfile -n {{size}}{{b|k|m|g}} {{file_name}}` + +- Create two files of 4 megabytes each: + +`mkfile -n {{4m}} {{first_file_name}} {{second_file_name}}` diff --git a/pages.cn/osx/n.md b/pages.cn/osx/n.md new file mode 100644 index 0000000000..cc3db8f9f5 --- /dev/null +++ b/pages.cn/osx/n.md @@ -0,0 +1,23 @@ +# n + +> Tool to manage multiple node versions. + +- Install a given version of node. If the version is already installed, it will be activated: + +`n {{version}}` + +- Display installed versions and interactively activate one of them: + +`n` + +- Remove a version: + +`n rm {{version}}` + +- Execute a file with a given version: + +`n use {{version}} {{file.js}}` + +- Output binary path for a version: + +`n bin {{version}}` diff --git a/pages.cn/osx/netstat.md b/pages.cn/osx/netstat.md new file mode 100644 index 0000000000..c8e52183c8 --- /dev/null +++ b/pages.cn/osx/netstat.md @@ -0,0 +1,27 @@ +# netstat + +> Displays network-related information such as open connections, open socket ports, etc. + +- List all ports: + +`netstat -a` + +- List all listening ports: + +`netstat -l` + +- List listening TCP ports: + +`netstat -t` + +- Display PID and program names for a specific port: + +`netstat -p {PROTOCOL}` + +- List information continuously: + +`netstat -c` + +- Print the routing table: + +`netstat -nr` diff --git a/pages.cn/osx/networksetup.md b/pages.cn/osx/networksetup.md new file mode 100644 index 0000000000..fb7df81976 --- /dev/null +++ b/pages.cn/osx/networksetup.md @@ -0,0 +1,19 @@ +# networksetup + +> Configuration tool for Network System Preferences. + +- List available network service providers (Ethernet, Wi-Fi, Bluetooth, etc): + +`networksetup -listallnetworkservices` + +- Show network settings for a particular networking device: + +`networksetup -getinfo {{"Wi-Fi"}}` + +- Get currently connected Wi-Fi network name (Wi-Fi device usually en0 or en1): + +`networksetup -getairportnetwork {{en0}}` + +- Connect to a particular Wi-Fi network: + +`networksetup -setairportnetwork {{en0}} {{"Airport Network SSID"}} {{password}}` diff --git a/pages.cn/osx/nm.md b/pages.cn/osx/nm.md new file mode 100644 index 0000000000..4348dd26e5 --- /dev/null +++ b/pages.cn/osx/nm.md @@ -0,0 +1,19 @@ +# nm + +> List symbol names in object files. + +- List global (extern) functions in a file (prefixed with T): + +`nm -g {{file.o}}` + +- List only undefined symbols in a file: + +`nm -u {{file.o}}` + +- List all symbols, even debugging symbols: + +`nm -a {{file.o}}` + +- Demangle C++ symbols: + +`nm {{file.o}} | c++filt` diff --git a/pages.cn/osx/oathtool.md b/pages.cn/osx/oathtool.md new file mode 100644 index 0000000000..95ad596b4a --- /dev/null +++ b/pages.cn/osx/oathtool.md @@ -0,0 +1,15 @@ +# oathtool + +> OATH one-time password tool. + +- Generate TOTP token (behaves like Google Authenticator): + +`oathtool --totp --base32 {{secret}}` + +- Generate a TOTP token for a specific time: + +`oathtool --totp --now {{2004−02−29 16:21:42}} --base32 {{secret}}` + +- Validate a TOTP token: + +`oathtool --totp --base32 {{secret}} {{token}}` diff --git a/pages.cn/osx/open.md b/pages.cn/osx/open.md new file mode 100644 index 0000000000..ed4889979f --- /dev/null +++ b/pages.cn/osx/open.md @@ -0,0 +1,27 @@ +# open + +> Opens files, directories and applications. + +- Open a file with the associated application: + +`open {{file.ext}}` + +- Run a graphical macOS application: + +`open -a {{Application}}` + +- Run a graphical macOS app based on the bundle identifier (refer to `osascript` for an easy way get this): + +`open -b {{com.domain.application}}` + +- Open the current directory in Finder: + +`open .` + +- Reveal a file in finder: + +`open -R {{path/to/file}}` + +- Open all the files of a given extension in the current directory with the associated application: + +`open {{*.ext}}` diff --git a/pages.cn/osx/opensnoop.md b/pages.cn/osx/opensnoop.md new file mode 100644 index 0000000000..e54bfd5706 --- /dev/null +++ b/pages.cn/osx/opensnoop.md @@ -0,0 +1,19 @@ +# opensnoop + +> Tool that tracks file opens on your system. + +- Print all file opens as they occur: + +`sudo opensnoop` + +- Track all file opens by a process by name: + +`sudo opensnoop -n {{process_name}}` + +- Track all file opens by a process by PID: + +`sudo opensnoop -p {{PID}}` + +- Track which processes open a specified file: + +`sudo opensnoop -f {{path/to/file}}` diff --git a/pages.cn/osx/osascript.md b/pages.cn/osx/osascript.md new file mode 100644 index 0000000000..68ec3f1b3e --- /dev/null +++ b/pages.cn/osx/osascript.md @@ -0,0 +1,27 @@ +# osascript + +> Run AppleScript or JavaScript for Automation (JXA) from the command line. + +- Run an AppleScript command: + +`osascript -e '{{say "Hello world"}}'` + +- Run multiple AppleScript commands: + +`osascript -e '{{say "Hello"}}' -e '{{say "world"}}'` + +- Run a compiled (`*.scpt`), bundled (`*.scptd`), or plaintext (`*.applescript`) AppleScript file: + +`osascript {{path/to/apple.scpt}}` + +- Get the bundle identifier of an application (useful for `open -b`): + +`osascript -e 'id of app "{{Application}}"'` + +- Run a JavaScript command: + +`osascript -l JavaScript -e '{{console.log("Hello world");}}'` + +- Run a JavaScript file: + +`osascript -l JavaScript {{path/to/script.js}}` diff --git a/pages.cn/osx/pbcopy.md b/pages.cn/osx/pbcopy.md new file mode 100644 index 0000000000..ed297e941b --- /dev/null +++ b/pages.cn/osx/pbcopy.md @@ -0,0 +1,11 @@ +# pbcopy + +> Place standard output in the clipboard. + +- Place the contents of a file in the clipboard: + +`pbcopy < {{file}}` + +- Place the results of a command in the clipboard: + +`find . -type t -name "*.png" | pbcopy` diff --git a/pages.cn/osx/pbpaste.md b/pages.cn/osx/pbpaste.md new file mode 100644 index 0000000000..b4cfb31552 --- /dev/null +++ b/pages.cn/osx/pbpaste.md @@ -0,0 +1,11 @@ +# pbpaste + +> Send the contents of the clipboard to standard output. + +- Write the contents of the clipboard to a file: + +`pbpaste > {{file}}` + +- Use the contents of the clipboard as input to a command: + +`pbpaste | grep foo` diff --git a/pages.cn/osx/pdfgrep.md b/pages.cn/osx/pdfgrep.md new file mode 100644 index 0000000000..5e229a05b4 --- /dev/null +++ b/pages.cn/osx/pdfgrep.md @@ -0,0 +1,23 @@ +# pdfgrep + +> Search text in PDF files. + +- Find lines that match pattern in a PDF: + +`pdfgrep {{pattern}} {{file.pdf}}` + +- Include file name and page number for each matched line: + +`pdfgrep --with-filename --page-number {{pattern}} {{file.pdf}}` + +- Do a case insensitive search for lines that begin with "foo" and return the first 3 matches: + +`pdfgrep --max-count {{3}} --ignore-case {{'^foo'}} {{file.pdf}}` + +- Find pattern in files with a .pdf extension in the current directory recursively: + +`pdfgrep --recursive {{pattern}}` + +- Find pattern on files that match a specific glob in the current directory recursively: + +`pdfgrep --recursive --include {{'*book.pdf'}} {{pattern}}` diff --git a/pages.cn/osx/pmset.md b/pages.cn/osx/pmset.md new file mode 100644 index 0000000000..fc09563384 --- /dev/null +++ b/pages.cn/osx/pmset.md @@ -0,0 +1,28 @@ +# pmset + +> Configure macOS power management settings, as one might do in System Preferences > Energy Saver. +> Commands that modify settings must begin with `sudo`. + +- Display the current power management settings: + +`pmset -g` + +- Display the current power source and battery levels: + +`pmset -g batt` + +- Set display to never sleep when on charger power: + +`sudo pmset -c displaysleep 0` + +- Set display to sleep after 15 minutes when on battery power: + +`sudo pmset -b displaysleep 15` + +- Schedule computer to automatically wake up every weekday at 9 AM: + +`sudo pmset repeat wake MTWRF 09:00:00` + +- Restore to system defaults: + +`sudo pmset -a displaysleep 10 disksleep 10 sleep 30 womp 1` diff --git a/pages.cn/osx/pod.md b/pages.cn/osx/pod.md new file mode 100644 index 0000000000..62584dcea1 --- /dev/null +++ b/pages.cn/osx/pod.md @@ -0,0 +1,31 @@ +# pod + +> Dependency manager for Swift and Objective-C Cocoa projects. + +- Create a Podfile for the current project with the default contents: + +`pod init` + +- Download and install all pods defined in the Podfile (that haven't been installed before): + +`pod install` + +- List all available pods: + +`pod list` + +- Show the outdated pods (of those currently installed): + +`pod outdated` + +- Update all currently installed pods to their newest version: + +`pod update` + +- Update a specific (previously installed) pod to its newest version: + +`pod update {{pod_name}}` + +- Remove CocoaPods from a Xcode project: + +`pod deintegrate {{xcode_project}}` diff --git a/pages.cn/osx/popd.md b/pages.cn/osx/popd.md new file mode 100644 index 0000000000..fab4246dc2 --- /dev/null +++ b/pages.cn/osx/popd.md @@ -0,0 +1,15 @@ +# popd + +> Remove a directory placed on the directory stack via the pushd shell built-in. + +- Remove the top directory from the stack and cd to it: + +`popd` + +- Remove the Nth directory (starting from zero to the left from the list printed with `dirs`): + +`popd +N` + +- Remove the Nth directory (starting from zero to the right from the list printed with `dirs`): + +`popd -N` diff --git a/pages.cn/osx/port.md b/pages.cn/osx/port.md new file mode 100644 index 0000000000..80e76ec73b --- /dev/null +++ b/pages.cn/osx/port.md @@ -0,0 +1,27 @@ +# port + +> Package manager for macOS. + +- Search for a package: + +`port search {{search_term}}` + +- Install a package: + +`sudo port install {{package_name}}` + +- List installed packages: + +`port installed` + +- Update port and fetch latest list of available packages: + +`sudo port selfupdate` + +- Upgrade outdated packages: + +`sudo port upgrade outdated` + +- Remove old versions of installed packages: + +`sudo port uninstall inactive` diff --git a/pages.cn/osx/pushd.md b/pages.cn/osx/pushd.md new file mode 100644 index 0000000000..21d608f844 --- /dev/null +++ b/pages.cn/osx/pushd.md @@ -0,0 +1,16 @@ +# pushd + +> Place a directory on a stack so it can be accessed later. +> See also `popd` to switch back to original directory. + +- Switch to directory and push it on the stack: + +`pushd {{directory}}` + +- Switch first and second directories on the stack: + +`pushd` + +- Rotate stack by making the 5th element the top of the stack: + +`pushd +4` diff --git a/pages.cn/osx/pwgen.md b/pages.cn/osx/pwgen.md new file mode 100644 index 0000000000..70f4cc67ff --- /dev/null +++ b/pages.cn/osx/pwgen.md @@ -0,0 +1,15 @@ +# pwgen + +> Generate pronounceable passwords. + +- Generate random password with s[y]mbols: + +`pwgen -y {{length}}` + +- Generate secure, hard-to-memorize passwords: + +`pwgen -s {{length}}` + +- Generate password with at least one capital letter in them: + +`pwgen -c {{length}}` diff --git a/pages.cn/osx/qlmanage.md b/pages.cn/osx/qlmanage.md new file mode 100644 index 0000000000..92da5d9019 --- /dev/null +++ b/pages.cn/osx/qlmanage.md @@ -0,0 +1,15 @@ +# qlmanage + +> QuickLook server tool. + +- Display QuickLook for one or multiple files: + +`qlmanage -p {{filename}} {{filename2}}` + +- Compute 300px wide PNG thumbnails of all JPEGs in the current directory and put them in a directory: + +`qlmanage {{*.jpg}} -t -s {{300}} {{path/to/directory}}` + +- Reset Quicklook: + +`qlmanage -r` diff --git a/pages.cn/osx/route.md b/pages.cn/osx/route.md new file mode 100644 index 0000000000..0bea78c1ef --- /dev/null +++ b/pages.cn/osx/route.md @@ -0,0 +1,28 @@ +# route + +> Manually manipulate the routing tables. +> Necessitates to be root. + +- Add a route to a destination through a gateway: + +`sudo route add {{dest_ip_address}} {{gateway_address}}` + +- Add a route to a /24 subnet through a gateway: + +`sudo route add {{subnet_ip_address}}/24 {{gateway_address}}` + +- Run in test mode (does not do anything, just print): + +`sudo route -t add {{dest_ip_address}}/24 {{gateway_address}}` + +- Remove all routes: + +`sudo route flush` + +- Delete a specific route: + +`sudo route delete {{dest_ip_address}}/24` + +- Lookup and display the route for a destination (hostname or IP address): + +`sudo route get {{destination}}` diff --git a/pages.cn/osx/rubocop.md b/pages.cn/osx/rubocop.md new file mode 100644 index 0000000000..fb4e31f61e --- /dev/null +++ b/pages.cn/osx/rubocop.md @@ -0,0 +1,31 @@ +# rubocop + +> Lint Ruby files. + +- Check all files in the current directory (including subdirectories): + +`rubocop` + +- Check one or more specific files or directories: + +`rubocop {{path/to/file}} {{path/to/directory}}` + +- Write output to file: + +`rubocop --out {{path/to/file}}` + +- View list of cops (linter rules): + +`rubocop --show-cops` + +- Exclude a cop: + +`rubocop --except {{cop_1}} {{cop_2}}` + +- Run only specified cops: + +`rubocop --only {{cop_1}} {{cop_2}}` + +- Auto-correct files (experimental): + +`rubocop --auto-correct` diff --git a/pages.cn/osx/runit.md b/pages.cn/osx/runit.md new file mode 100644 index 0000000000..841092117b --- /dev/null +++ b/pages.cn/osx/runit.md @@ -0,0 +1,11 @@ +# runit + +> 3-stage init system. + +- Start runit's 3-stage init scheme: + +`runit` + +- Shut down runit: + +`kill --CONT {{runit_pid}}` diff --git a/pages.cn/osx/runsv.md b/pages.cn/osx/runsv.md new file mode 100644 index 0000000000..8b131ae6a8 --- /dev/null +++ b/pages.cn/osx/runsv.md @@ -0,0 +1,11 @@ +# runsv + +> Start and manage a runit service. + +- Start a runit service as the current user: + +`runsv {{path/to/service}}` + +- Start a runit service as root: + +`sudo runsv {{path/to/service}}` diff --git a/pages.cn/osx/runsvchdir.md b/pages.cn/osx/runsvchdir.md new file mode 100644 index 0000000000..91ee114441 --- /dev/null +++ b/pages.cn/osx/runsvchdir.md @@ -0,0 +1,7 @@ +# runsvchdir + +> Change the directory `runsvdir` uses by default. + +- Switch `runsvdir` directories: + +`sudo runsvchdir {{/path/to/directory}}` diff --git a/pages.cn/osx/runsvdir.md b/pages.cn/osx/runsvdir.md new file mode 100644 index 0000000000..bc1ad17b16 --- /dev/null +++ b/pages.cn/osx/runsvdir.md @@ -0,0 +1,15 @@ +# runsvdir + +> Run an entire directory of services. + +- Start and manage all services in a directory as the current user: + +`runsvdir {{path/to/services}}` + +- Start and manage all services in a directory as root: + +`sudo runsvdir {{path/to/services}}` + +- Start services in separate sessions: + +`runsvdir -P {{path/to/services}}` diff --git a/pages.cn/osx/say.md b/pages.cn/osx/say.md new file mode 100644 index 0000000000..ad23e2fdb9 --- /dev/null +++ b/pages.cn/osx/say.md @@ -0,0 +1,23 @@ +# say + +> Converts text to speech. + +- Say a phrase aloud: + +`say {{"I like to ride my bike."}}` + +- Read a file aloud: + +`say -f {{filename.txt}}` + +- Say a phrase with a custom voice and speech rate: + +`say -v {{voice}} -r {{words_per_minute}} {{"I'm sorry Dave, I can't let you do that."}}` + +- List the available voices: + +`say -v ?` + +- Create an audio file of the spoken text: + +`say -o {{filename.aiff}} {{"Here's to the Crazy Ones."}}` diff --git a/pages.cn/osx/scutil.md b/pages.cn/osx/scutil.md new file mode 100644 index 0000000000..6aacb7a78b --- /dev/null +++ b/pages.cn/osx/scutil.md @@ -0,0 +1,28 @@ +# scutil + +> Manage system configuration parameters. +> Necessitates to be root when setting configuration. + +- Display DNS Configuration: + +`scutil --dns` + +- Display proxy configuration: + +`scutil --proxy` + +- Get computer name: + +`scutil --get ComputerName` + +- Set computer name: + +`sudo scutil --set ComputerName {{computer_name}}` + +- Get hostname: + +`scutil --get HostName` + +- Set hostname: + +`scutil --set HostName {{hostname}}` diff --git a/pages.cn/osx/sed.md b/pages.cn/osx/sed.md new file mode 100644 index 0000000000..8e8be1b307 --- /dev/null +++ b/pages.cn/osx/sed.md @@ -0,0 +1,31 @@ +# sed + +> Edit text in a scriptable manner. + +- Replace the first occurrence of a string in a file, and print the result: + +`sed 's/{{find}}/{{replace}}/' {{filename}}` + +- Replace all occurrences of an extended regular expression in a file: + +`sed -E 's/{{regex}}/{{replace}}/g' {{filename}}` + +- Replace all occurrences of a string in a file, overwriting the file (i.e. in-place): + +`sed -i '' 's/{{find}}/{{replace}}/g' {{filename}}` + +- Replace only on lines matching the line pattern: + +`sed '/{{line_pattern}}/s/{{find}}/{{replace}}/' {{filename}}` + +- Print only text between n-th line till the next empty line: + +`sed -n '{{line_number}},/^$/p' {{filename}}` + +- Apply multiple find-replace expressions to a file: + +`sed -e 's/{{find}}/{{replace}}/' -e 's/{{find}}/{{replace}}/' {{filename}}` + +- Replace separator / by any other character not used in the find or replace patterns, e.g., #: + +`sed 's#{{find}}#{{replace}}#' {{filename}}` diff --git a/pages.cn/osx/shasum.md b/pages.cn/osx/shasum.md new file mode 100644 index 0000000000..64e658ea8b --- /dev/null +++ b/pages.cn/osx/shasum.md @@ -0,0 +1,23 @@ +# shasum + +> Calculate or check cryptographic SHA checksums. + +- Calculate the SHA1 checksum for a file: + +`shasum {{filename}}` + +- Calculate the SHA256 checksum for a file: + +`shasum --algorithm 256 {{filename}}` + +- Calculate the SHA512 checksum for multiple files: + +`shasum --algorithm 512 {{filename1}} {{filename2}}` + +- Check a file with a list of sums against the directory's files: + +`shasum --check {{list_file}}` + +- Calculate the SHA1 checksum from stdin: + +`{{somecommand}} | shasum` diff --git a/pages.cn/osx/shuf.md b/pages.cn/osx/shuf.md new file mode 100644 index 0000000000..8452e60f34 --- /dev/null +++ b/pages.cn/osx/shuf.md @@ -0,0 +1,19 @@ +# shuf + +> Generate random permutations. + +- Randomize the order of lines in a file and output the result: + +`shuf {{filename}}` + +- Only output the first 5 entries of the result: + +`shuf -n {{5}} {{filename}}` + +- Write output to another file: + +`shuf {{filename}} -o {{output_filename}}` + +- Generate random numbers in range 1-10: + +`shuf -i {{1-10}}` diff --git a/pages.cn/osx/shutdown.md b/pages.cn/osx/shutdown.md new file mode 100644 index 0000000000..e8d01466b3 --- /dev/null +++ b/pages.cn/osx/shutdown.md @@ -0,0 +1,19 @@ +# shutdown + +> Shutdown and reboot the system. + +- Power off (halt) immediately: + +`shutdown -h now` + +- Sleep immediately: + +`shutdown -s now` + +- Reboot immediately: + +`shutdown -r now` + +- Reboot in 5 minutes: + +`shutdown -r +{{5}}` diff --git a/pages.cn/osx/sips.md b/pages.cn/osx/sips.md new file mode 100644 index 0000000000..7a883e033b --- /dev/null +++ b/pages.cn/osx/sips.md @@ -0,0 +1,28 @@ +# sips + +> Apple Scriptable Image Processing System. +> Raster/Query images and ColorSync ICC Profiles. + +- Specify an output directory so that originals do not get modified: + +`sips --out {{path/to/out_dir}}` + +- Resample image at specified size, Image aspect ratio may be altered: + +`sips -z {{1920}} {{300}} {{image.ext}}` + +- Resample image so height and width aren't greater than specified size (notice the capital Z): + +`sips -Z {{1920}} {{300}} {{image.ext}}` + +- Resample all images in a folder to fit a width of 960px (honoring aspect ratio): + +`sips --resampleWidth {{960}} {{path/to/images}}` + +- Convert an image from CMYK to RGB: + +`sips --matchTo '/System/Library/ColorSync/Profiles/Generic RGB Profile.icc' {{path/to/image.ext}} {{path/to/out_dir}}` + +- Remove ColorSync ICC profile from an image: + +`sips -d profile --deleteColorManagementProperties {{path/to/image.ext}}` diff --git a/pages.cn/osx/softwareupdate.md b/pages.cn/osx/softwareupdate.md new file mode 100644 index 0000000000..7cc3f0b015 --- /dev/null +++ b/pages.cn/osx/softwareupdate.md @@ -0,0 +1,19 @@ +# softwareupdate + +> A tool for updating MacOS App Store apps via the command line. + +- List all available updates: + +`softwareupdate -l` + +- Download and install all updates: + +`softwareupdate -ia` + +- Download and install all recommended updates: + +`softwareupdate -ir` + +- Download and install a specific app: + +`softwareupdate -i {{update_name}}` diff --git a/pages.cn/osx/split.md b/pages.cn/osx/split.md new file mode 100644 index 0000000000..303ce3147c --- /dev/null +++ b/pages.cn/osx/split.md @@ -0,0 +1,15 @@ +# split + +> Split a file into pieces. + +- Split a file, each split having 10 lines (except the last split): + +`split -l {{10}} {{filename}}` + +- Split a file into 5 files. File is split such that each split has same size (except the last split): + +`split -n {{5}} {{filename}}` + +- Split a file with 512 bytes in each split (except the last split; use 512k for kilobytes and 512m for megabytes): + +`split -b {{512}} {{filename}}` diff --git a/pages.cn/osx/ssh-add.md b/pages.cn/osx/ssh-add.md new file mode 100644 index 0000000000..f59e2546a8 --- /dev/null +++ b/pages.cn/osx/ssh-add.md @@ -0,0 +1,28 @@ +# ssh-add + +> Manage loaded ssh keys in the ssh-agent. +> Ensure that ssh-agent is up and running for the keys to be loaded in it. + +- Add the default ssh keys in "~/.ssh" to the ssh-agent: + +`ssh-add` + +- Add a specific key to the ssh-agent: + +`ssh-add {{path/to/private_key}}` + +- List fingerprints of currently loaded keys: + +`ssh-add -l` + +- Delete a key from the ssh-agent: + +`ssh-add -d {{path/to/private_key}}` + +- Delete all currently loaded keys from the ssh-agent: + +`ssh-add -D` + +- Add a key to the ssh-agent and the keychain: + +`ssh-add -K {{path/to/private_key}}` diff --git a/pages.cn/osx/sshuttle.md b/pages.cn/osx/sshuttle.md new file mode 100644 index 0000000000..64ee5a506c --- /dev/null +++ b/pages.cn/osx/sshuttle.md @@ -0,0 +1,16 @@ +# sshuttle + +> Transparent proxy server that tunnels traffic over an SSH connection. +> Doesn't require admin, or any special setup on the remote SSH server. + +- Forward all IPv4 TCP traffic via a remote SSH server: + +`sshuttle --remote={{username}}@{{sshserver}} {{0.0.0.0/0}}` + +- Forward all IPv4 TCP and DNS traffic: + +`sshuttle --dns --remote={{username}}@{{sshserver}} {{0.0.0.0/0}}` + +- Use the tproxy method to forward all IPv4 and IPv6 traffic: + +`sudo sshuttle --method=tproxy --remote={{username}}@{{sshserver}} {{0.0.0.0/0}} {{::/0}} --exclude={{your_local_ip_address}} --exclude={{ssh_server_ip_address}}` diff --git a/pages.cn/osx/stat.md b/pages.cn/osx/stat.md new file mode 100644 index 0000000000..a1a2b0cced --- /dev/null +++ b/pages.cn/osx/stat.md @@ -0,0 +1,23 @@ +# stat + +> Display file status. + +- Show file properties such as size, permissions, creation and access dates among others: + +`stat {{file}}` + +- Same as above but verbose (more similar to linux's `stat`): + +`stat -x {{file}}` + +- Show only octal file permissions: + +`stat -f %Mp%Lp {{file}}` + +- Show owner and group of the file: + +`stat -f "%Su %Sg" {{file}}` + +- Show the size of the file in bytes: + +`stat -f "%z %N" {{file}}` diff --git a/pages.cn/osx/stty.md b/pages.cn/osx/stty.md new file mode 100644 index 0000000000..51a85fee33 --- /dev/null +++ b/pages.cn/osx/stty.md @@ -0,0 +1,23 @@ +# stty + +> Set options for a terminal device interface. + +- Display all settings for the current terminal: + +`stty -a` + +- Set the number of rows: + +`stty rows {{rows}}` + +- Set the number of columns: + +`stty cols {{cols}}` + +- Get the actual transfer speed of a device: + +`stty -f {{path/to/device_file}} speed` + +- Reset all modes to reasonable values for the current terminal: + +`stty sane` diff --git a/pages.cn/osx/sv.md b/pages.cn/osx/sv.md new file mode 100644 index 0000000000..0567e0d0c8 --- /dev/null +++ b/pages.cn/osx/sv.md @@ -0,0 +1,15 @@ +# sv + +> Control a running runsv service. + +- Start a service: + +`sudo sv up {{path/to/service}}` + +- Stop a service: + +`sudo sv down {{path/to/service}}` + +- Get service status: + +`sudo sv status {{path/to/service}}` diff --git a/pages.cn/osx/sw_vers.md b/pages.cn/osx/sw_vers.md new file mode 100644 index 0000000000..f06ab63333 --- /dev/null +++ b/pages.cn/osx/sw_vers.md @@ -0,0 +1,11 @@ +# sw_vers + +> Print macOS Software versioning information. + +- Print macOS Version: + +`sw_vers -productVersion` + +- Print macOS Build: + +`sw_vers -buildVersion` diff --git a/pages.cn/osx/sysctl.md b/pages.cn/osx/sysctl.md new file mode 100644 index 0000000000..2cde481921 --- /dev/null +++ b/pages.cn/osx/sysctl.md @@ -0,0 +1,23 @@ +# sysctl + +> Access kernel state information. + +- Show all available variables and their values: + +`sysctl -a` + +- Show Apple model identifier: + +`sysctl -n hw.model` + +- Show CPU model: + +`sysctl -n machdep.cpu.brand_string` + +- Show available CPU features (MMX, SSE, SSE2, SSE3, AES, etc): + +`sysctl -n machdep.cpu.feature` + +- Set a changeable kernel state variable: + +`sysctl -w {{section.tunable}}={{value}}` diff --git a/pages.cn/osx/system_profiler.md b/pages.cn/osx/system_profiler.md new file mode 100644 index 0000000000..f150a18108 --- /dev/null +++ b/pages.cn/osx/system_profiler.md @@ -0,0 +1,15 @@ +# system_profiler + +> Report system hardware and software configuration. + +- Display a full system profiler report which can be opened by System Profiler.app: + +`system_profiler -xml > MyReport.spx` + +- Display a hardware overview (Model, CPU, Memory, Serial, etc): + +`system_profiler SPHardwareDataType` + +- Print the system serial number: + +`system_profiler SPHardwareDataType|grep "Serial Number (system)" |awk '{print $4}'` diff --git a/pages.cn/osx/systemsetup.md b/pages.cn/osx/systemsetup.md new file mode 100644 index 0000000000..431beae76e --- /dev/null +++ b/pages.cn/osx/systemsetup.md @@ -0,0 +1,23 @@ +# systemsetup + +> Configure System Preferences machine settings. + +- Enable remote login (SSH): + +`systemsetup -setremotelogin on` + +- Specify TimeZone, NTP Server and enable network time: + +`systemsetup -settimezone {{US/Pacific}} -setnetworktimeserver {{us.pool.ntp.org}} -setusingnetworktime on` + +- Make the machine never sleep and automatically restart on power failure or kernel panic: + +`systemsetup -setsleep off -setrestartpowerfailure on -setrestartfreeze on` + +- List valid startup disks: + +`systemsetup -liststartupdisks` + +- Specify a new startup disk: + +`systemsetup -setstartupdisk {{path}}` diff --git a/pages.cn/osx/top.md b/pages.cn/osx/top.md new file mode 100644 index 0000000000..72420fccad --- /dev/null +++ b/pages.cn/osx/top.md @@ -0,0 +1,23 @@ +# top + +> Display dynamic real-time information about running processes. + +- Start top, all options are available in the interface: + +`top` + +- Start top sorting processes by internal memory size (default order - process ID): + +`top -o mem` + +- Start top sorting processes first by CPU, then by running time: + +`top -o cpu -O time` + +- Start top displaying only processes owned by given user: + +`top -user {{user_name}}` + +- Get help about interactive commands: + +`?` diff --git a/pages.cn/osx/trap.md b/pages.cn/osx/trap.md new file mode 100644 index 0000000000..325b1c1230 --- /dev/null +++ b/pages.cn/osx/trap.md @@ -0,0 +1,20 @@ +# trap + +> Automatically execute commands after receiving signals by processes or the operating system. +> Can be used to perform cleanups for interruptions by the user or other actions. + +- List available signals to set traps for: + +`trap -l` + +- List active traps for the current shell: + +`trap -p` + +- Set a trap to execute commands when one or more signals are detected: + +`trap 'echo "Caught signal {{SIGHUP}}"' {{SIGHUP}}` + +- Remove active traps: + +`trap - {{SIGHUP}} {{SIGINT}}` diff --git a/pages.cn/osx/tree.md b/pages.cn/osx/tree.md new file mode 100644 index 0000000000..73e8b6f281 --- /dev/null +++ b/pages.cn/osx/tree.md @@ -0,0 +1,31 @@ +# tree + +> Show the contents of the current directory as a tree. + +- Show files and directories up to 'num' levels of depth (where 1 means the current directory): + +`tree -L {{num}}` + +- Show directories only: + +`tree -d` + +- Show hidden files too: + +`tree -a` + +- Print the tree without indentation lines, showing the full path instead (use `-N` to not escape whitespace and special characters): + +`tree -i -f` + +- Print the size of each node next to it, in human-readable format, with folders displaying their cumulative size (as in the `du` command): + +`tree -s -h --du` + +- Find files within the tree hierarchy, using a wildcard (glob) pattern, and pruning out directories that don't contain matching files: + +`tree -P '{{*.txt}}' --prune` + +- Find directories within the tree hierarchy, pruning out directories that aren't ancestors of the wanted one: + +`tree -P {{directory_name}} --matchdirs --prune` diff --git a/pages.cn/osx/uname.md b/pages.cn/osx/uname.md new file mode 100644 index 0000000000..78330a2e1f --- /dev/null +++ b/pages.cn/osx/uname.md @@ -0,0 +1,20 @@ +# uname + +> Print details about the current machine and the operating system running on it. +> Note: for additional information about the operating system, try the `sw_vers` command. + +- Print hardware-related information: machine and processor: + +`uname -mp` + +- Print software-related information: operating system, release number, and version: + +`uname -srv` + +- Print the nodename (hostname) of the system: + +`uname -n` + +- Print all available system information (hardware, software, nodename): + +`uname -a` diff --git a/pages.cn/osx/units.md b/pages.cn/osx/units.md new file mode 100644 index 0000000000..5d01b9086f --- /dev/null +++ b/pages.cn/osx/units.md @@ -0,0 +1,27 @@ +# units + +> Provide the conversion between two units of measure. + +- Run in interactive mode: + +`units` + +- Show the conversion between two simple units: + +`units {{quarts}} {{tablespoons}}` + +- Convert between units with quantities: + +`units {{"15 pounds"}} {{kilograms}}` + +- Show the conversion between two compound units: + +`units {{"meters / second"}} {{"inches / hour"}}` + +- Show the conversion between units with different dimensions: + +`units {{"acres"}} {{"ft^2"}}` + +- Show the conversion of byte multipliers: + +`units {{"15 megabytes"}} {{bytes}}` diff --git a/pages.cn/osx/w.md b/pages.cn/osx/w.md new file mode 100644 index 0000000000..1cf83af6e8 --- /dev/null +++ b/pages.cn/osx/w.md @@ -0,0 +1,16 @@ +# w + +> Show who is logged on and what they are doing. +> Print user login, TTY, remote host, login time, idle time, current process. + +- Show logged-in users info: + +`w` + +- Show logged-in users info without a header: + +`w -h` + +- Show info about logged-in users, sorted by their idle time: + +`w -i` diff --git a/pages.cn/osx/wacaw.md b/pages.cn/osx/wacaw.md new file mode 100644 index 0000000000..0bb5ba19d5 --- /dev/null +++ b/pages.cn/osx/wacaw.md @@ -0,0 +1,23 @@ +# wacaw + +> A little command-line tool for macOS that allows you to capture both still pictures and video from an attached camera. + +- Take a picture from webcam: + +`wacaw {{filename}}` + +- Record a video: + +`wacaw --video {{filename}} -D {{duration_in_seconds}}` + +- Take a picture with custom resolution: + +`wacaw -x {{width}} -y {{height}} {{filename}}` + +- Copy image just taken to clipboard: + +`wacaw --to-clipboard` + +- List the devices available: + +`wacaw -L` diff --git a/pages.cn/osx/whereis.md b/pages.cn/osx/whereis.md new file mode 100644 index 0000000000..55f3998a40 --- /dev/null +++ b/pages.cn/osx/whereis.md @@ -0,0 +1,7 @@ +# whereis + +> Locate the binary, source, and manual page files for a command. + +- Locate binary, source and man pages for ssh: + +`whereis {{ssh}}` diff --git a/pages.cn/osx/xattr.md b/pages.cn/osx/xattr.md new file mode 100644 index 0000000000..290e58b2c1 --- /dev/null +++ b/pages.cn/osx/xattr.md @@ -0,0 +1,23 @@ +# xattr + +> Utility to work with extended filesystem attributes. + +- List key:value extended attributes for a given file: + +`xattr -l {{file}}` + +- Write an attribute for a given file: + +`xattr -w {{attribute_key}} {{attribute_value}} {{file}}` + +- Delete an attribute from a given file: + +`xattr -d {{com.apple.quarantine}} {{file}}` + +- Delete all extended attributes from a given file: + +`xattr -c {{file}}` + +- Recursively delete an attribute in a given directory: + +`xattr -rd {{attribute_key}} {{directory}}` diff --git a/pages.cn/osx/xcodebuild.md b/pages.cn/osx/xcodebuild.md new file mode 100644 index 0000000000..7cc2926caf --- /dev/null +++ b/pages.cn/osx/xcodebuild.md @@ -0,0 +1,15 @@ +# xcodebuild + +> Build Xcode projects. + +- Build workspace: + +`xcodebuild -workspace {{workspace_name.workspace}} -scheme {{scheme_name}} -configuration {{configuration_name}} clean build SYMROOT={{SYMROOT_path}}` + +- Build project: + +`xcodebuild -target {{target_name}} -configuration {{configuration_name}} clean build SYMROOT={{SYMROOT_path}}` + +- Show SDKs: + +`xcodebuild -showsdks` diff --git a/pages.cn/osx/xctool.md b/pages.cn/osx/xctool.md new file mode 100644 index 0000000000..c0b4417743 --- /dev/null +++ b/pages.cn/osx/xctool.md @@ -0,0 +1,15 @@ +# xctool + +> Tool for building Xcode projects. + +- Build a single project without any workspace: + +`xctool -project {{YourProject.xcodeproj}} -scheme {{YourScheme}} build` + +- Build a project that is part of a workspace: + +`xctool -workspace {{YourWorkspace.xcworkspace}} -scheme {{YourScheme}} build` + +- Clean, build and execute all the tests: + +`xctool -workspace {{YourWorkspace.xcworkspace}} -scheme {{YourScheme}} clean build test` diff --git a/pages.cn/osx/xed.md b/pages.cn/osx/xed.md new file mode 100644 index 0000000000..7547392332 --- /dev/null +++ b/pages.cn/osx/xed.md @@ -0,0 +1,15 @@ +# xed + +> Opens files for editing in XCode. + +- Open file in XCode: + +`xed {{file1}}` + +- Open file(s) in XCode, create if it doesn't exist: + +`xed -c {{filename1}}` + +- Open a file in XCode and jump to line number 75: + +`xed -l 75 {{filename}}` diff --git a/pages.cn/osx/xsltproc.md b/pages.cn/osx/xsltproc.md new file mode 100644 index 0000000000..071ab8eb67 --- /dev/null +++ b/pages.cn/osx/xsltproc.md @@ -0,0 +1,11 @@ +# xsltproc + +> Transform XML with XSLT to produce output (usually HTML or XML). + +- Transform an XML file with a specific XSLT stylesheet: + +`xsltproc --output {{output.html}} {{stylesheet.xslt}} {{xmlfile.xml}}` + +- Pass a value to a parameter in the stylesheet: + +`xsltproc --output {{output.html}} --stringparam {{name}} {{value}} {{stylesheet.xslt}} {{xmlfile.xml}}` diff --git a/pages.cn/osx/yank.md b/pages.cn/osx/yank.md new file mode 100644 index 0000000000..d44aed7adc --- /dev/null +++ b/pages.cn/osx/yank.md @@ -0,0 +1,19 @@ +# yank + +> Read input from stdin and display a selection interface that allows a field to be selected and copied to the clipboard. + +- Yank using the default delimiters (\f, \n, \r, \s, \t): + +`{{sudo dmesg}} | yank` + +- Yank an entire line: + +`{{sudo dmesg}} | yank -l` + +- Yank using a specific delimiter: + +`{{echo hello=world}} | yank -d {{=}}` + +- Only yank fields matching a specific pattern: + +`{{ps ux}} | yank -g {{"[0-9]+"}}` diff --git a/pages.cn/sunos/devfsadm.md b/pages.cn/sunos/devfsadm.md new file mode 100644 index 0000000000..27f450b427 --- /dev/null +++ b/pages.cn/sunos/devfsadm.md @@ -0,0 +1,15 @@ +# devfsadm + +> Administration command for `/dev`. Maintains the `/dev` namespace. + +- Scan for new disks: + +`devfsadm -c disk` + +- Cleanup any dangling /dev links and scan for new device: + +`devfsadm -C -v` + +- Dry-run - output what would be changed but make no modifications: + +`devfsadm -C -v -n` diff --git a/pages.cn/sunos/dmesg.md b/pages.cn/sunos/dmesg.md new file mode 100644 index 0000000000..eb3b54352e --- /dev/null +++ b/pages.cn/sunos/dmesg.md @@ -0,0 +1,15 @@ +# dmesg + +> Write the kernel messages to standard output. + +- Show kernel messages: + +`dmesg` + +- Show how much physical memory is available on this system: + +`dmesg | grep -i memory` + +- Show kernel messages 1 page at a time: + +`dmesg | less` diff --git a/pages.cn/sunos/prctl.md b/pages.cn/sunos/prctl.md new file mode 100644 index 0000000000..286bdbe874 --- /dev/null +++ b/pages.cn/sunos/prctl.md @@ -0,0 +1,16 @@ +# prctl + +> Get or set the resource controls of running processes,. +> Tasks, and projects. + +- Examine process limits and permissions: + +`prctl {{PID}}` + +- Examine process limits and permissions in machine parseable format: + +`prctl -P {{PID}}` + +- Get specific limit for a running process: + +`prctl -n process.max-file-descriptor {{PID}}` diff --git a/pages.cn/sunos/prstat.md b/pages.cn/sunos/prstat.md new file mode 100644 index 0000000000..6f3ebbc07b --- /dev/null +++ b/pages.cn/sunos/prstat.md @@ -0,0 +1,23 @@ +# prstat + +> Report active process statistics. + +- Examine all processes and reports statistics sorted by CPU usage: + +`prstat` + +- Examine all processes and reports statistics sorted by memory usage: + +`prstat -s rss` + +- Report total usage summary for each user: + +`prstat -t` + +- Report microstate process accounting information: + +`prstat -m` + +- Print out a list of top 5 cpu using processes every second: + +`prstat -c -n 5 -s cpu 1` diff --git a/pages.cn/sunos/runit.md b/pages.cn/sunos/runit.md new file mode 100644 index 0000000000..841092117b --- /dev/null +++ b/pages.cn/sunos/runit.md @@ -0,0 +1,11 @@ +# runit + +> 3-stage init system. + +- Start runit's 3-stage init scheme: + +`runit` + +- Shut down runit: + +`kill --CONT {{runit_pid}}` diff --git a/pages.cn/sunos/runsv.md b/pages.cn/sunos/runsv.md new file mode 100644 index 0000000000..8b131ae6a8 --- /dev/null +++ b/pages.cn/sunos/runsv.md @@ -0,0 +1,11 @@ +# runsv + +> Start and manage a runit service. + +- Start a runit service as the current user: + +`runsv {{path/to/service}}` + +- Start a runit service as root: + +`sudo runsv {{path/to/service}}` diff --git a/pages.cn/sunos/runsvchdir.md b/pages.cn/sunos/runsvchdir.md new file mode 100644 index 0000000000..91ee114441 --- /dev/null +++ b/pages.cn/sunos/runsvchdir.md @@ -0,0 +1,7 @@ +# runsvchdir + +> Change the directory `runsvdir` uses by default. + +- Switch `runsvdir` directories: + +`sudo runsvchdir {{/path/to/directory}}` diff --git a/pages.cn/sunos/runsvdir.md b/pages.cn/sunos/runsvdir.md new file mode 100644 index 0000000000..bc1ad17b16 --- /dev/null +++ b/pages.cn/sunos/runsvdir.md @@ -0,0 +1,15 @@ +# runsvdir + +> Run an entire directory of services. + +- Start and manage all services in a directory as the current user: + +`runsvdir {{path/to/services}}` + +- Start and manage all services in a directory as root: + +`sudo runsvdir {{path/to/services}}` + +- Start services in separate sessions: + +`runsvdir -P {{path/to/services}}` diff --git a/pages.cn/sunos/stty.md b/pages.cn/sunos/stty.md new file mode 100644 index 0000000000..51a85fee33 --- /dev/null +++ b/pages.cn/sunos/stty.md @@ -0,0 +1,23 @@ +# stty + +> Set options for a terminal device interface. + +- Display all settings for the current terminal: + +`stty -a` + +- Set the number of rows: + +`stty rows {{rows}}` + +- Set the number of columns: + +`stty cols {{cols}}` + +- Get the actual transfer speed of a device: + +`stty -f {{path/to/device_file}} speed` + +- Reset all modes to reasonable values for the current terminal: + +`stty sane` diff --git a/pages.cn/sunos/sv.md b/pages.cn/sunos/sv.md new file mode 100644 index 0000000000..0567e0d0c8 --- /dev/null +++ b/pages.cn/sunos/sv.md @@ -0,0 +1,15 @@ +# sv + +> Control a running runsv service. + +- Start a service: + +`sudo sv up {{path/to/service}}` + +- Stop a service: + +`sudo sv down {{path/to/service}}` + +- Get service status: + +`sudo sv status {{path/to/service}}` diff --git a/pages.cn/sunos/svcadm.md b/pages.cn/sunos/svcadm.md new file mode 100644 index 0000000000..b0045e1fa7 --- /dev/null +++ b/pages.cn/sunos/svcadm.md @@ -0,0 +1,23 @@ +# svcadm + +> Manipulate service instances. + +- Enable a service in the service database: + +`svcadm enable {{service_name}}` + +- Disable service: + +`svcadm disable {{service_name}}` + +- Restart a running service: + +`svcadm restart {{service_name}}` + +- Command service to re-read configuration files: + +`svcadm refresh {{service_name}}` + +- Clear a service from maintenance state and command it to start: + +`svcadm clear {{service_name}}` diff --git a/pages.cn/sunos/svccfg.md b/pages.cn/sunos/svccfg.md new file mode 100644 index 0000000000..79605dde31 --- /dev/null +++ b/pages.cn/sunos/svccfg.md @@ -0,0 +1,15 @@ +# svccfg + +> Import, export, and modify service configurations. + +- Validate configuration file: + +`svccfg validate {{smf.xml}}` + +- Export service configurations to file: + +`svccfg export {{servicename}} > {{smf.xml}}` + +- Import/update service configurations from file: + +`svccfg import {{smf.xml}}` diff --git a/pages.cn/sunos/svcs.md b/pages.cn/sunos/svcs.md new file mode 100644 index 0000000000..e78cd9568e --- /dev/null +++ b/pages.cn/sunos/svcs.md @@ -0,0 +1,23 @@ +# svcs + +> List information about running services. + +- List all running services: + +`svcs` + +- List services that are not running: + +`svcs -vx` + +- List information about a service: + +`svcs apache` + +- Show location of service log file: + +`svcs -L apache` + +- Display end of a service log file: + +`tail $(svcs -L apache)` diff --git a/pages.cn/windows/assoc.md b/pages.cn/windows/assoc.md new file mode 100644 index 0000000000..36af43b713 --- /dev/null +++ b/pages.cn/windows/assoc.md @@ -0,0 +1,15 @@ +# assoc + +> Display or modify file extension associations. + +- Display all associated filetypes: + +`assoc` + +- Display the associated filetype for a specific extension: + +`assoc {{.txt}}` + +- Modify the associated filetype for a specific extension: + +`assoc {{.txt}}={{txtfile}}` diff --git a/pages.cn/windows/attrib.md b/pages.cn/windows/attrib.md new file mode 100644 index 0000000000..3942fef42d --- /dev/null +++ b/pages.cn/windows/attrib.md @@ -0,0 +1,27 @@ +# attrib + +> Displays or changes file and directory attributes. + +- Display the attributes of the files in the current directory: + +`attrib` + +- Display the attributes of the files in the current directory and sub-directories: + +`attrib /S` + +- Display the attributes of the files and folders in the current directory and sub-directories: + +`attrib /S /D` + +- Add the read-only attribute to a file: + +`attrib +R {{document.txt}}` + +- Remove the system and hidden attributes of a file: + +`attrib -S -H {{document.txt}}` + +- Add the hidden attribute to a folder: + +`attrib +H {{path\to\folder}}` diff --git a/pages.cn/windows/choco-feature.md b/pages.cn/windows/choco-feature.md new file mode 100644 index 0000000000..ebece7e122 --- /dev/null +++ b/pages.cn/windows/choco-feature.md @@ -0,0 +1,15 @@ +# choco feature + +> Interact with features with Chocolatey. + +- Display a list of available features: + +`choco feature list` + +- Enable a feature: + +`choco feature enable --name {{name}}` + +- Disable a feature: + +`choco feature disable --name {{name}}` diff --git a/pages.cn/windows/choco-info.md b/pages.cn/windows/choco-info.md new file mode 100644 index 0000000000..94170ec0c2 --- /dev/null +++ b/pages.cn/windows/choco-info.md @@ -0,0 +1,19 @@ +# choco info + +> Display detailed information about a package with Chocolatey. + +- Display information on a specific package: + +`choco info {{package}}` + +- Display information for a local package only: + +`choco info {{package}} --local-only` + +- Specify a custom source to receive packages information from: + +`choco info {{package}} --source {{source_url|alias}}` + +- Provide a username and password for authentication: + +`choco info {{package}} --user {{username}} --password {{password}}` diff --git a/pages.cn/windows/choco-install.md b/pages.cn/windows/choco-install.md new file mode 100644 index 0000000000..c2ec6ff6e3 --- /dev/null +++ b/pages.cn/windows/choco-install.md @@ -0,0 +1,35 @@ +# choco install + +> Install one or more packages with Chocolatey. + +- Install one or more space-separated packages: + +`choco install {{package(s)}}` + +- Install packages from a custom configuration file: + +`choco install {{path/to/packages.config}}` + +- Install a specific "nuspec" or "nupkg" file: + +`choco install {{path/to/file}}` + +- Install a specific version of a package: + +`choco install {{package}} --version {{version}}` + +- Allow installing multiple versions of a package: + +`choco install {{package}} --allow-multiple` + +- Confirm all prompts automatically: + +`choco install {{package}} --yes` + +- Specify a custom source to receive packages from: + +`choco install {{package}} --source {{source_url|alias}}` + +- Provide a username and password for authentication: + +`choco install {{package}} --user {{username}} --password {{password}}` diff --git a/pages.cn/windows/choco-list.md b/pages.cn/windows/choco-list.md new file mode 100644 index 0000000000..6765b7e804 --- /dev/null +++ b/pages.cn/windows/choco-list.md @@ -0,0 +1,27 @@ +# choco list + +> Display a list of packages with Chocolatey. + +- Display all available packages: + +`choco list` + +- Display all locally installed packages: + +`choco list --local-only` + +- Display a list including local programs: + +`choco list --include-programs` + +- Display only approved packages: + +`choco list --approved-only` + +- Specify a custom source to display packages from: + +`choco list --source {{source_url|alias}}` + +- Provide a username and password for authentication: + +`choco list --user {{username}} --password {{password}}` diff --git a/pages.cn/windows/choco-new.md b/pages.cn/windows/choco-new.md new file mode 100644 index 0000000000..ba59eac7ff --- /dev/null +++ b/pages.cn/windows/choco-new.md @@ -0,0 +1,23 @@ +# choco new + +> Generate new package specification files with Chocolatey. + +- Create a new package skeleton: + +`choco new {{package_name}}` + +- Create a new package with a specific version: + +`choco new {{package_name}} --version {{version}}` + +- Create a new package with a specific maintainer name: + +`choco new {{package_name}} --maintainer {{maintainer_name}}` + +- Create a new package in a custom output directory: + +`choco new {{package_name}} --output-directory {{path/to/directory}}` + +- Create a new package with specific 32-bit and 64-bit installer urls: + +`choco new {{package_name}} url="{{url}}" url64="{{url}}"` diff --git a/pages.cn/windows/choco-outdated.md b/pages.cn/windows/choco-outdated.md new file mode 100644 index 0000000000..aca0de47da --- /dev/null +++ b/pages.cn/windows/choco-outdated.md @@ -0,0 +1,19 @@ +# choco outdated + +> Check for outdated packages with Chocolatey. + +- Display a list of outdated packages in table format: + +`choco outdated` + +- Ignore pinned packages in the output: + +`choco outdated --ignore-pinned` + +- Specify a custom source to check packages from: + +`choco outdated --source {{source_url|alias}}` + +- Provide a username and password for authentication: + +`choco outdated --user {{username}} --password {{password}}` diff --git a/pages.cn/windows/choco-pack.md b/pages.cn/windows/choco-pack.md new file mode 100644 index 0000000000..e8dccdca4a --- /dev/null +++ b/pages.cn/windows/choco-pack.md @@ -0,0 +1,15 @@ +# choco pack + +> Package a NuGet specification into a nupkg file. + +- Package a NuGet specification to a nupkg file: + +`choco pack {{path/to/specification}}` + +- Package a NuGet specification specifying the version of the resulting file: + +`choco pack {{path/to/specification}} --version {{version}}` + +- Package a NuGet specification to a specific directory: + +`choco pack {{path/to/specification}} --output-directory {{path/to/output_directory}}` diff --git a/pages.cn/windows/choco-pin.md b/pages.cn/windows/choco-pin.md new file mode 100644 index 0000000000..59238b8997 --- /dev/null +++ b/pages.cn/windows/choco-pin.md @@ -0,0 +1,20 @@ +# choco pin + +> Pin a package at a specific version with Chocolatey. +> Pinned packages are skipped automatically when upgrading. + +- Display a list of pinned packages and their versions: + +`choco pin list` + +- Pin a package at its current version: + +`choco pin add --name {{package}}` + +- Pin a package at a specific version: + +`choco pin add --name {{package}} --version {{version}}` + +- Remove a pin for a specific package: + +`choco pin remove --name {{package}}` diff --git a/pages.cn/windows/choco-search.md b/pages.cn/windows/choco-search.md new file mode 100644 index 0000000000..bf7e310d29 --- /dev/null +++ b/pages.cn/windows/choco-search.md @@ -0,0 +1,27 @@ +# choco search + +> Search for a local or remote package with Chocolatey. + +- Search for a package: + +`choco search {{query}}` + +- Search for a package locally: + +`choco search {{query}} --local-only` + +- Only include exact matches in the results: + +`choco search {{query}} --exact` + +- Confirm all prompts automatically: + +`choco search {{query}} --yes` + +- Specify a custom source to search for packages in: + +`choco search {{query}} --source {{source_url|alias}}` + +- Provide a username and password for authentication: + +`choco search {{query}} --user {{username}} --password {{password}}` diff --git a/pages.cn/windows/choco-source.md b/pages.cn/windows/choco-source.md new file mode 100644 index 0000000000..04eb517eb3 --- /dev/null +++ b/pages.cn/windows/choco-source.md @@ -0,0 +1,31 @@ +# choco source + +> Manage sources for packages with Chocolatey. + +- List currently available sources: + +`choco source list` + +- Add a new package source: + +`choco source add --name {{name}} --source {{url}}` + +- Add a new package source with credentials: + +`choco source add --name {{name}} --source {{url}} --user {{username}} --password {{password}}` + +- Add a new package source with a client certificate: + +`choco source add --name {{name}} --source {{url}} --cert {{path/to/certificate}}` + +- Enable a package source: + +`choco source enable --name {{name}}` + +- Disable a package source: + +`choco source disable --name {{name}}` + +- Remove a package source: + +`choco source remove --name {{name}}` diff --git a/pages.cn/windows/choco-uninstall.md b/pages.cn/windows/choco-uninstall.md new file mode 100644 index 0000000000..5eec1576d1 --- /dev/null +++ b/pages.cn/windows/choco-uninstall.md @@ -0,0 +1,23 @@ +# choco uninstall + +> Uninstall one or more packages with Chocolatey. + +- Uninstall one or more space-separated packages: + +`choco uninstall {{package(s)}}` + +- Uninstall a specific version of a package: + +`choco uninstall {{package}} --version {{version}}` + +- Confirm all prompts automatically: + +`choco uninstall {{package}} --yes` + +- Remove all dependencies when uninstalling: + +`choco uninstall {{package}} --remove-dependencies` + +- Uninstall all packages: + +`choco uninstall all` diff --git a/pages.cn/windows/choco-upgrade.md b/pages.cn/windows/choco-upgrade.md new file mode 100644 index 0000000000..c4eb74ca7a --- /dev/null +++ b/pages.cn/windows/choco-upgrade.md @@ -0,0 +1,31 @@ +# choco upgrade + +> Upgrade one or more packages with Chocolatey. + +- Upgrade one or more space-separated packages: + +`choco upgrade {{package(s)}}` + +- Upgrade to a specific version of a package: + +`choco upgrade {{package}} --version {{version}}` + +- Upgrade all packages: + +`choco upgrade all` + +- Upgrade all except specified comma-separated packages: + +`choco upgrade all --except "{{package(s)}}"` + +- Confirm all prompts automatically: + +`choco upgrade {{package}} --yes` + +- Specify a custom source to receive packages from: + +`choco upgrade {{package}} --source {{source_url|alias}}` + +- Provide a username and password for authentication: + +`choco upgrade {{package}} --user {{username}} --password {{password}}` diff --git a/pages.cn/windows/choco.md b/pages.cn/windows/choco.md new file mode 100644 index 0000000000..f7294122c7 --- /dev/null +++ b/pages.cn/windows/choco.md @@ -0,0 +1,20 @@ +# choco + +> A command line interface for the Chocolatey package manager. +> See `choco install`, `choco upgrade` and other pages for additional information. + +- Execute Chocolatey command: + +`choco {{command}}` + +- Call general help: + +`choco -?` + +- Call help on a specific command: + +`choco {{command}} -?` + +- Check the Chocolatey version: + +`choco --version` diff --git a/pages.cn/windows/clip.md b/pages.cn/windows/clip.md new file mode 100644 index 0000000000..6229caad38 --- /dev/null +++ b/pages.cn/windows/clip.md @@ -0,0 +1,11 @@ +# clip + +> Copy input content to the Windows clipboard. + +- Pipe command line output to the Windows clipboard: + +`{{dir}} | clip` + +- Copy the contents of a file to the Windows clipboard: + +`clip < {{path/to/file}}` diff --git a/pages.cn/windows/cls.md b/pages.cn/windows/cls.md new file mode 100644 index 0000000000..329ddd1ec0 --- /dev/null +++ b/pages.cn/windows/cls.md @@ -0,0 +1,7 @@ +# cls + +> Clears the screen. + +- Clear the screen: + +`cls` diff --git a/pages.cn/windows/cmd.md b/pages.cn/windows/cmd.md new file mode 100644 index 0000000000..369c5f8e43 --- /dev/null +++ b/pages.cn/windows/cmd.md @@ -0,0 +1,35 @@ +# cmd + +> The Windows command interpreter. + +- Start a new instance of the command interpreter: + +`cmd` + +- Run the specified command and then exit: + +`cmd /c "{{command}}"` + +- Run the specified command and then enter an interactive shell: + +`cmd /k "{{command}}"` + +- Disable the usage of `echo` in command output: + +`cmd /q` + +- Enable or disable command extensions: + +`cmd /e:{{on|off}}` + +- Enable or disable file or directory autocompletion: + +`cmd /f:{{on|off}}` + +- Enable or disable environment variable expansion: + +`cmd /v:{{on|off}}` + +- Force output to use unicode encoding: + +`cmd /u` diff --git a/pages.cn/windows/color.md b/pages.cn/windows/color.md new file mode 100644 index 0000000000..ace949b1e2 --- /dev/null +++ b/pages.cn/windows/color.md @@ -0,0 +1,15 @@ +# color + +> Set the console foreground and background colors. + +- Set the console colors to the default values: + +`color` + +- List available color values and detailed information: + +`color /?` + +- Set the console foreground and background to a specific color: + +`color {{foreground_code}}{{background_code}}` diff --git a/pages.cn/windows/comp.md b/pages.cn/windows/comp.md new file mode 100644 index 0000000000..394028ad59 --- /dev/null +++ b/pages.cn/windows/comp.md @@ -0,0 +1,36 @@ +# comp + +> Compare the contents of two files or sets of files. +> Use wildcards (*) to compare sets of files. + +- Compare files interactively: + +`comp` + +- Compare two specified files: + +`comp {{path/to/file_1}} {{path/to/file_2}}` + +- Compare two sets of files: + +`comp {{path/to/directory_1/*}} {{path/to/directory_2/*}}` + +- Display differences in decimal format: + +`comp /d {{path/to/file_1}} {{path/to/file_2}}` + +- Display differences in ASCII format: + +`comp /a {{path/to/file_1}} {{path/to/file_2}}` + +- Display line numbers for differences: + +`comp /l {{path/to/file_1}} {{path/to/file_2}}` + +- Compare files case-insensitively: + +`comp /c {{path/to/file_1}} {{path/to/file_2}}` + +- Compare only the first 5 lines of each file: + +`comp /n={{5}} {{path/to/file_1}} {{path/to/file_2}}` diff --git a/pages.cn/windows/del.md b/pages.cn/windows/del.md new file mode 100644 index 0000000000..17aea63f90 --- /dev/null +++ b/pages.cn/windows/del.md @@ -0,0 +1,31 @@ +# del + +> Delete one or more files. + +- Delete one or more space-separated files or patterns: + +`del {{file_pattern}}` + +- Prompt for confirmation before deleting each file: + +`del {{file_pattern}} /p` + +- Force the deletion of read-only files: + +`del {{file_pattern}} /f` + +- Recursively delete file(s) from all subdirectories: + +`del {{file_pattern}} /s` + +- Do not prompt when deleting files based on a global wildcard: + +`del {{file_pattern}} /q` + +- Display the help and list available attributes: + +`del /?` + +- Delete files based on specified attributes: + +`del {{file_pattern}} /a {{attribute}}` diff --git a/pages.cn/windows/dir.md b/pages.cn/windows/dir.md new file mode 100644 index 0000000000..28ed2f1532 --- /dev/null +++ b/pages.cn/windows/dir.md @@ -0,0 +1,19 @@ +# dir + +> List directory contents. + +- Show the contents of the current directory: + +`dir` + +- Show the contents of a given directory: + +`dir {{path/to/directory}}` + +- Show the contents of the current directory, including hidden ones: + +`dir /A` + +- Show the contents of a given directory, including hidden ones: + +`dir {{path/to/directory}} /A` diff --git a/pages.cn/windows/doskey.md b/pages.cn/windows/doskey.md new file mode 100644 index 0000000000..0176b53a25 --- /dev/null +++ b/pages.cn/windows/doskey.md @@ -0,0 +1,31 @@ +# doskey + +> Manage macros, windows commands and command lines. + +- List available macros: + +`doskey /macros` + +- Create a new macro: + +`doskey {{name}} = "{{command}}"` + +- Create a new macro for a specific executable: + +`doskey /exename={{executable}} {{name}} = "{{command}}"` + +- Remove a macro: + +`doskey {{name}} =` + +- Display all commands that are stored in memory: + +`doskey /history` + +- Save macros to a file for portability: + +`doskey /macros > {{macinit}}` + +- Load macros from a file: + +`doskey /macrofile = {{macinit}}` diff --git a/pages.cn/windows/driverquery.md b/pages.cn/windows/driverquery.md new file mode 100644 index 0000000000..52d0377c27 --- /dev/null +++ b/pages.cn/windows/driverquery.md @@ -0,0 +1,31 @@ +# driverquery + +> Display information about installed device drivers. + +- Display a list of all installed device drivers: + +`driverquery` + +- Display a list of drivers in the specified format: + +`driverquery /fo {{table|list|csv}}` + +- Display a list of drivers with a column to indicate if they are signed: + +`driverquery /si` + +- Exclude the header in the output list: + +`driverquery /nh` + +- Display a list of drivers for a remote machine: + +`driverquery /s {{hostname}} /u {{username}} /p {{password}}` + +- Display a list of drivers with verbose information: + +`driverquery /v` + +- Display detailed usage information: + +`driverquery /?` diff --git a/pages.cn/windows/eventcreate.md b/pages.cn/windows/eventcreate.md new file mode 100644 index 0000000000..4821335440 --- /dev/null +++ b/pages.cn/windows/eventcreate.md @@ -0,0 +1,20 @@ +# eventcreate + +> Create custom entries in the event log. +> Event IDs can be any number between 1 and 1000. + +- Create a new event with a given id (1-1000) in the log: + +`eventcreate /t {{success|error|warning|information}} /id {{id}} /d "{{message}}"` + +- Create an event in a specific event log: + +`eventcreate /l {{log_name}} /t {{type}} /id {{id}} /d "{{message}}"` + +- Create an event with a specific source: + +`eventcreate /so {{source_name}} /t {{type}} /id {{id}} /d "{{message}}"` + +- Create an event in a remote machine's event log: + +`eventcreate /s {{hostname}} /u {{username}} /p {{password}} /t {{type}} /id {{id}} /d "{{message"}}` diff --git a/pages.cn/windows/exit.md b/pages.cn/windows/exit.md new file mode 100644 index 0000000000..f456015e39 --- /dev/null +++ b/pages.cn/windows/exit.md @@ -0,0 +1,15 @@ +# exit + +> Quit the current CMD instance or the current batch file. + +- Quit the current CMD instance: + +`exit` + +- Quit the current batch script: + +`exit /b` + +- Quit using a specific exit code: + +`exit {{exit_code}}` diff --git a/pages.cn/windows/expand.md b/pages.cn/windows/expand.md new file mode 100644 index 0000000000..506a175f29 --- /dev/null +++ b/pages.cn/windows/expand.md @@ -0,0 +1,23 @@ +# expand + +> Uncompress one or more Windows Cabinet files. + +- Uncompress a single-file Cabinet file to the specified directory: + +`expand {{path/to/file.cab}} {{path/to/directory}}` + +- Display the list of files in a source Cabinet file: + +`expand {{path/to/file.cab}} {{path/to/directory}} -d` + +- Uncompress all files from the Cabinet file: + +`expand {{path/to/file.cab}} {{path/to/directory}} -f:*` + +- Uncompress a specific file from a Cabinet file: + +`expand {{path/to/file.cab}} {{path/to/directory}} -f:{{file}}` + +- Ignore the directory structure when uncompressing, and add them to a single directory: + +`expand {{path/to/file.cab}} {{path/to/directory}} -i` diff --git a/pages.cn/windows/find.md b/pages.cn/windows/find.md new file mode 100644 index 0000000000..5279c621b5 --- /dev/null +++ b/pages.cn/windows/find.md @@ -0,0 +1,19 @@ +# find + +> Find a specified string in one or more files. + +- Find lines that contain a specified string: + +`find {{string}} {{path/to/file_or_directory}}` + +- Display lines that do not contain the specified string: + +`find {{string}} {{path/to/file_or_directory}} /v` + +- Display the count of lines that contain the specified string: + +`find {{string}} {{path/to/file_or_directory}} /c` + +- Display line numbers with the list of lines: + +`find {{string}} {{path/to/file_or_directory}} /n` diff --git a/pages.cn/windows/findstr.md b/pages.cn/windows/findstr.md new file mode 100644 index 0000000000..76d08e1314 --- /dev/null +++ b/pages.cn/windows/findstr.md @@ -0,0 +1,35 @@ +# findstr + +> Find specified text within one or more files. + +- Find space-separated string(s) in all files: + +`findstr "{{query}}" *` + +- Find space-separated string(s) in all files recur[s]ively: + +`findstr /s "{{query}}" *` + +- Find strings using a case-insensitive search: + +`findstr /i "{{query}}" *"` + +- Find strings in all files using regular expressions: + +`findstr /r "{{expression}}" *` + +- Find a literal string (containing spaces) in all text files: + +`findstr /c:"{{query}}" *.txt` + +- Find only lines that match the query e[x]actly: + +`findstr /x "{{query}}" *` + +- Display the line number before each matching line: + +`findstr /n "{{query}}" *` + +- Display only the filenames that contain a match: + +`findstr /m "{{query}}" *` diff --git a/pages.cn/windows/finger.md b/pages.cn/windows/finger.md new file mode 100644 index 0000000000..ceb6914b39 --- /dev/null +++ b/pages.cn/windows/finger.md @@ -0,0 +1,20 @@ +# finger + +> Return information about one or more users on a specified system. +> The remote system must be running the Finger service. + +- Display information about a specific user: + +`finger {{user}}@{{host}}` + +- Display information about all users on the specified host: + +`finger @{{host}}` + +- Display information in a longer format: + +`finger {{user}}@{{host}} -l` + +- Display help information: + +`finger /?` diff --git a/pages.cn/windows/fondue.md b/pages.cn/windows/fondue.md new file mode 100644 index 0000000000..aa0102efb8 --- /dev/null +++ b/pages.cn/windows/fondue.md @@ -0,0 +1,15 @@ +# fondue + +> A command line installer for optional Windows features. + +- Enable a specific Windows feature: + +`fondue /enable-feature:{{feature}}` + +- Hide all output messages to the user: + +`fondue /enable-feature:{{feature}} /hide-ux:all` + +- Specify a caller process name for error reporting: + +`fondue /enable-feature:{{feature}} /caller-name:{{name}}` diff --git a/pages.cn/windows/forfiles.md b/pages.cn/windows/forfiles.md new file mode 100644 index 0000000000..4eecd5b832 --- /dev/null +++ b/pages.cn/windows/forfiles.md @@ -0,0 +1,27 @@ +# forfiles + +> Select one or more files to execute a specified command on. + +- Search for files in the current directory: + +`forfiles` + +- Search for files in a specific directory: + +`forfiles /p {{path/to/directory}}` + +- Run the specified command for each file: + +`forfiles /c "{{command}}"` + +- Search for files using a specific glob mask: + +`forfiles /m {{glob_pattern}}` + +- Search for files recursively: + +`forfiles /s` + +- Search for files older than 5 days: + +`forfiles /d {{+5}}` diff --git a/pages.cn/windows/ftp.md b/pages.cn/windows/ftp.md new file mode 100644 index 0000000000..4bfae50c12 --- /dev/null +++ b/pages.cn/windows/ftp.md @@ -0,0 +1,35 @@ +# ftp + +> Interactively transfer files between a local and remote FTP server. + +- Connect to a remote FTP server interactively: + +`ftp {{host}}` + +- Log in as an anonymous user: + +`ftp -A {{host}}` + +- Disable automatic login upon initial connection: + +`ftp -n {{host}}` + +- Run a file containing a list of FTP commands: + +`ftp -s:{{path/to/file}} {{host}}` + +- Download multiple files (glob expression): + +`mget {{*.png}}` + +- Upload multiple files (glob expression): + +`mput {{*.zip}}` + +- Delete multiple files on the remote server: + +`mdelete {{*.txt}}` + +- Display detailed help: + +`ftp --help` diff --git a/pages.cn/windows/getmac.md b/pages.cn/windows/getmac.md new file mode 100644 index 0000000000..36df01f73c --- /dev/null +++ b/pages.cn/windows/getmac.md @@ -0,0 +1,27 @@ +# getmac + +> Display the MAC addresses of a system. + +- Display the MAC addresses for the current system: + +`getmac` + +- Display the details in a specific format: + +`getmac /fo {{table|list|csv}}` + +- Exclude the header in the output list: + +`getmac /nh` + +- Display the MAC addresses for a remote machine: + +`getmac /s {{hostname}} /u {{username}} /p {{password}}` + +- Display the MAC addresses with verbose information: + +`getmac /v` + +- Display detailed usage information: + +`getmac /?` diff --git a/pages.cn/windows/ipconfig.md b/pages.cn/windows/ipconfig.md new file mode 100644 index 0000000000..9fb16b5f74 --- /dev/null +++ b/pages.cn/windows/ipconfig.md @@ -0,0 +1,23 @@ +# ipconfig + +> Display and manage the network configuration of Windows. + +- Show a list of network adapters: + +`ipconfig` + +- Show a detailed list of network adapters: + +`ipconfig /all` + +- Renew the IP addresses for a network adapter: + +`ipconfig /renew {{adapter}}` + +- Free up the IP addresses for a network adapter: + +`ipconfig /release {{adapter}}` + +- Remove all data from the DNS cache: + +`ipconfig /flushdns` diff --git a/pages.cn/windows/iscc.md b/pages.cn/windows/iscc.md new file mode 100644 index 0000000000..77ed56a10b --- /dev/null +++ b/pages.cn/windows/iscc.md @@ -0,0 +1,16 @@ +# iscc + +> Compiler for Inno Setup installers. +> It compiles an Inno Setup scripts into an Windows installer executable. + +- Compile an Inno Setup script: + +`iscc {{path/to/file.iss}}` + +- Quietly compile an Inno Setup installer: + +`iscc /Q {{path/to/file.iss}}` + +- Compile a signed Inno Setup installer: + +`iscc /S={{name}}={{command}} {{path/to/file.iss}}` diff --git a/pages.cn/windows/logoff.md b/pages.cn/windows/logoff.md new file mode 100644 index 0000000000..c62c83857d --- /dev/null +++ b/pages.cn/windows/logoff.md @@ -0,0 +1,15 @@ +# logoff + +> Terminate a login session. + +- Terminate the current session: + +`logoff` + +- Terminate a session by its name or id: + +`logoff {{session_name|session_id}}` + +- Terminate a session on a specific server connected through RDP: + +`logoff {{session_name|session_id}} /server:{{servername}}` diff --git a/pages.cn/windows/mkdir.md b/pages.cn/windows/mkdir.md new file mode 100644 index 0000000000..65dabbb019 --- /dev/null +++ b/pages.cn/windows/mkdir.md @@ -0,0 +1,11 @@ +# mkdir + +> Creates a directory. + +- Create a directory: + +`mkdir {{directory_name}}` + +- Recursively create a nested directory tree: + +`mkdir {{path/to/sub_directory_name}}` diff --git a/pages.cn/windows/mklink.md b/pages.cn/windows/mklink.md new file mode 100644 index 0000000000..a728f1d7f7 --- /dev/null +++ b/pages.cn/windows/mklink.md @@ -0,0 +1,19 @@ +# mklink + +> Create symbolic links. + +- Create a symbolic link to a file: + +`mklink {{path/to/link}} {{path/to/source_file}}` + +- Create a symbolic link to a directory: + +`mklink /d {{path/to/link}} {{path/to/source_directory}}` + +- Create a hard link to a file: + +`mklink /h {{path/to/link}} {{path/to/source_file}}` + +- Create a directory junction: + +`mklink /j {{path/to/link}} {{path/to/source_file}}` diff --git a/pages.cn/windows/more.md b/pages.cn/windows/more.md new file mode 100644 index 0000000000..2d1b019e4f --- /dev/null +++ b/pages.cn/windows/more.md @@ -0,0 +1,31 @@ +# more + +> Display paginated output from stdin or a file. + +- Display paginated output from stdin: + +`{{echo test}} | more` + +- Display paginated output from one or more files: + +`more {{path/to/file}}` + +- Convert tabs to the specified number of spaces: + +`more {{path/to/file}} /t{{spaces}}` + +- Clear the screen before displaying the page: + +`more {{path/to/file}} /c` + +- Display the output starting at line 5: + +`more {{path/to/file}} +{{5}}` + +- Enable extended interactive mode (see help for usage): + +`more {{path/to/file}} /e` + +- Display full usage information: + +`more /?` diff --git a/pages.cn/windows/msg.md b/pages.cn/windows/msg.md new file mode 100644 index 0000000000..102270bc11 --- /dev/null +++ b/pages.cn/windows/msg.md @@ -0,0 +1,23 @@ +# msg + +> Send a message to a specific user or session. + +- Send a message to a specified user or session: + +`msg {{username|session_name|session_id}} {{message}}` + +- Send a message from stdin: + +`echo "{{message}}" | msg {{username|session_name|session_id}}` + +- Send a message to a specific server: + +`msg /server:{{server_name}} {{username|session_name|session_id}}` + +- Send a message to all users of the current machine: + +`msg *` + +- Set a delay in seconds for a message: + +`msg /time:{{seconds}}` diff --git a/pages.cn/windows/path.md b/pages.cn/windows/path.md new file mode 100644 index 0000000000..67180dc232 --- /dev/null +++ b/pages.cn/windows/path.md @@ -0,0 +1,19 @@ +# path + +> Display or set the search path for executable files. + +- Display the current path: + +`path` + +- Set the path to one or more semicolon-separated directories: + +`path {{path/to/directory(s)}}` + +- Append a new directory to the original path: + +`path {{path/to/directory}};%path%` + +- Set command prompt to only search the current directory for executables: + +`path ;` diff --git a/pages.cn/windows/pathping.md b/pages.cn/windows/pathping.md new file mode 100644 index 0000000000..052151c34b --- /dev/null +++ b/pages.cn/windows/pathping.md @@ -0,0 +1,35 @@ +# pathping + +> A trace route tool combining features of `ping` and `tracert`. + +- Ping and trace the route to a host: + +`pathping {{hostname}}` + +- Do not perform reverse lookup of ip-address to hostname: + +`pathping {{hostname}} -n` + +- Specify the maximum number of hops to search for the target (the default is 30): + +`pathping {{hostname}} -h {{max_hops}}` + +- Specify the milliseconds to wait between pings (the default is 240): + +`pathping {{hostname}} -p {{time}}` + +- Specify the number of queries per hop (the default is 100): + +`pathping {{hostname}} -q {{queries}}` + +- Force IPV4 usage: + +`pathping {{hostname}} -4` + +- Force IPV6 usage: + +`pathping {{hostname}} -6` + +- Display detailed usage information: + +`pathping /?` diff --git a/pages.cn/windows/popd.md b/pages.cn/windows/popd.md new file mode 100644 index 0000000000..b4ff0870fc --- /dev/null +++ b/pages.cn/windows/popd.md @@ -0,0 +1,7 @@ +# popd + +> Changes the current directory to the directory stored by the `pushd` command. + +- Switch to directory at the top of the stack: + +`popd` diff --git a/pages.cn/windows/print.md b/pages.cn/windows/print.md new file mode 100644 index 0000000000..bc20303bc1 --- /dev/null +++ b/pages.cn/windows/print.md @@ -0,0 +1,11 @@ +# print + +> Print a text file to a printer. + +- Print a text file to the default printer: + +`print {{path/to/file}}` + +- Print a text file to a specific printer: + +`print /d:{{printer}} {{path/to/file}}` diff --git a/pages.cn/windows/pushd.md b/pages.cn/windows/pushd.md new file mode 100644 index 0000000000..bdce0068d5 --- /dev/null +++ b/pages.cn/windows/pushd.md @@ -0,0 +1,8 @@ +# pushd + +> Place a directory on a stack so it can be accessed later. +> See also `popd` to switch back to original directory. + +- Switch to directory and push it on the stack: + +`pushd {{directory}}` diff --git a/pages.cn/windows/pwlauncher.md b/pages.cn/windows/pwlauncher.md new file mode 100644 index 0000000000..2bd7ee7f4e --- /dev/null +++ b/pages.cn/windows/pwlauncher.md @@ -0,0 +1,11 @@ +# pwlauncher + +> A command line tool for managing the Windows To Go startup options. + +- Display the current Windows To Go status: + +`pwlauncher` + +- Enable or disable the Windows To Go startup options: + +`pwlauncher /{{enable|disable}}` diff --git a/pages.cn/windows/rdpsign.md b/pages.cn/windows/rdpsign.md new file mode 100644 index 0000000000..06a01cca9e --- /dev/null +++ b/pages.cn/windows/rdpsign.md @@ -0,0 +1,23 @@ +# rdpsign + +> A tool for signing Remote Desktop Protocol (RDP) files. + +- Sign an RDP file: + +`rdpsign {{path/to/file.rdp}}` + +- Sign an RDP file using a specific sha256 hash: + +`rdpsign {{path/to/file.rdp}} /sha265 {{hash}}` + +- Enable quiet output: + +`rdpsign {{path/to/file.rdp}} /q` + +- Display verbose warnings, messages and statuses: + +`rdpsign {{path/to/file.rdp}} /v` + +- Test the signing by displaying the output to stdout without updating the file: + +`rdpsign {{path/to/file.rdp}} /l` diff --git a/pages.cn/windows/reg-add.md b/pages.cn/windows/reg-add.md new file mode 100644 index 0000000000..3be3c6b885 --- /dev/null +++ b/pages.cn/windows/reg-add.md @@ -0,0 +1,23 @@ +# reg add + +> Add new keys and their values to the registry. + +- Add a new registry key: + +`reg add {{key_name}}` + +- Add a new value under a specific key: + +`reg add {{key_name}} /v {{value}}` + +- Add a new value with specific data: + +`reg add {{key_name}} /d {{data}}` + +- Add a new value to a key with a specific data type: + +`reg add {{key_name}} /t {{type}}` + +- Forcefully overwrite the existing registry value without a prompt: + +`reg add {{key_name}} /f` diff --git a/pages.cn/windows/reg-compare.md b/pages.cn/windows/reg-compare.md new file mode 100644 index 0000000000..b159eb5c64 --- /dev/null +++ b/pages.cn/windows/reg-compare.md @@ -0,0 +1,23 @@ +# reg compare + +> Compare keys and their values in the registry. + +- Compare all values under a specific key with a second key: + +`reg compare {{first_key_name}} {{second_key_name}}` + +- Compare a specific value under two keys: + +`reg compare {{first_key_name}} {{second_key_name}} /v {{value}}` + +- Compare all sub keys and values for two keys: + +`reg compare {{first_key_name}} {{second_key_name}} /s` + +- Only output the matches between the specified keys: + +`reg compare {{first_key_name}} {{second_key_name}} /os` + +- Output the differences and matches between the specified keys: + +`reg compare {{first_key_name}} {{second_key_name}} /oa` diff --git a/pages.cn/windows/reg-copy.md b/pages.cn/windows/reg-copy.md new file mode 100644 index 0000000000..19484c3da7 --- /dev/null +++ b/pages.cn/windows/reg-copy.md @@ -0,0 +1,15 @@ +# reg copy + +> Copy keys and their values in the registry. + +- Copy a registry key to a new registry location: + +`reg copy {{old_key_name}} {{new_key_name}}` + +- Copy a registry key recursively to a new registry location: + +`reg copy {{old_key_name}} {{new_key_name}} /s` + +- Forcefully copy a registry key without a prompt: + +`reg copy {{old_key_name}} {{new_key_name}} /f` diff --git a/pages.cn/windows/reg-delete.md b/pages.cn/windows/reg-delete.md new file mode 100644 index 0000000000..1ce8e9420b --- /dev/null +++ b/pages.cn/windows/reg-delete.md @@ -0,0 +1,19 @@ +# reg delete + +> Delete keys or their values from the registry. + +- Delete a specific registry key: + +`reg delete {{key_name}}` + +- Delete a value under a specific key: + +`reg delete {{key_name}} /v {{value}}` + +- Delete all values recursively under the specified key: + +`reg delete {{key_name}} /va` + +- Forcefully delete all values recursively under a key without a prompt: + +`reg delete {{key_name}} /f /va` diff --git a/pages.cn/windows/reg-export.md b/pages.cn/windows/reg-export.md new file mode 100644 index 0000000000..dc029f321f --- /dev/null +++ b/pages.cn/windows/reg-export.md @@ -0,0 +1,11 @@ +# reg export + +> Export the specified sub keys and values into a file. + +- Export all sub keys and values of a specific key: + +`reg export {{key_name}} {{path/to/file.reg}}` + +- Force overwriting of an existing file without prompt: + +`reg export {{key_name}} {{path/to/file.reg}} /y` diff --git a/pages.cn/windows/reg-flags.md b/pages.cn/windows/reg-flags.md new file mode 100644 index 0000000000..ef38ea06e4 --- /dev/null +++ b/pages.cn/windows/reg-flags.md @@ -0,0 +1,19 @@ +# reg flags + +> Display or set flags on registry keys. + +- Display current flags for a specific key: + +`reg flags {{key_name}} query` + +- Display help and available flag types: + +`reg flags /?` + +- Set specified space-separated flags, and unset unmentioned flags, for a specific key: + +`reg flags {{key_name}} set {{flag_names}}` + +- Set specified flags for a specific key and its sub keys: + +`reg flags {{key_name}} set {{flag_names}} /s` diff --git a/pages.cn/windows/reg-import.md b/pages.cn/windows/reg-import.md new file mode 100644 index 0000000000..f6a260abcd --- /dev/null +++ b/pages.cn/windows/reg-import.md @@ -0,0 +1,7 @@ +# reg import + +> Import all available keys, subkeys, and values from a file. + +- Import all keys, subkeys and values from a file: + +`reg import {{path/to/file.reg}}` diff --git a/pages.cn/windows/reg-load.md b/pages.cn/windows/reg-load.md new file mode 100644 index 0000000000..16d84f6fed --- /dev/null +++ b/pages.cn/windows/reg-load.md @@ -0,0 +1,8 @@ +# reg load + +> Load saved sub keys into a different sub key in the registry. +> This is intended for troubleshooting and temporary keys. + +- Load a backup file into the specified key: + +`reg load {{key_name}} {{path/to/file}}` diff --git a/pages.cn/windows/reg-query.md b/pages.cn/windows/reg-query.md new file mode 100644 index 0000000000..1fc52ba850 --- /dev/null +++ b/pages.cn/windows/reg-query.md @@ -0,0 +1,23 @@ +# reg query + +> Display the values of keys and sub keys in the registry. + +- Display all values of a key: + +`reg query {{key_name}}` + +- Display a specific value of a key: + +`reg query {{key_name}} /v {{value}}` + +- Display all values of a key and its sub keys: + +`reg query {{key_name}} /s` + +- Search for keys and values matching a specific pattern: + +`reg query {{key_name}} /f "{{query_pattern}}"` + +- Display a value of a key matching a specified data type: + +`reg query {{key_name}} /t {{type}}` diff --git a/pages.cn/windows/reg-restore.md b/pages.cn/windows/reg-restore.md new file mode 100644 index 0000000000..f294c29ead --- /dev/null +++ b/pages.cn/windows/reg-restore.md @@ -0,0 +1,8 @@ +# reg restore + +> Restore a key and its values from a backup file. +> See `reg-save` for more information. + +- Overwrite a specified key with data from a backup file: + +`reg restore {{key_name}} {{path/to/file}}` diff --git a/pages.cn/windows/reg-save.md b/pages.cn/windows/reg-save.md new file mode 100644 index 0000000000..7f120eadf1 --- /dev/null +++ b/pages.cn/windows/reg-save.md @@ -0,0 +1,11 @@ +# reg save + +> Save a registry key, its sub keys and values to a file. + +- Save a registry key, its sub keys and values to a specific file: + +`reg save {{key_name}} {{path/to/file}}` + +- Forcefully overwrite an existing file without a prompt: + +`reg save {{key_name}} {{path/to/file}} /y` diff --git a/pages.cn/windows/reg-unload.md b/pages.cn/windows/reg-unload.md new file mode 100644 index 0000000000..23d769d482 --- /dev/null +++ b/pages.cn/windows/reg-unload.md @@ -0,0 +1,7 @@ +# reg unload + +> Remove data from the registry that was loaded using the `reg load` command. + +- Remove data from the registry for a specified key: + +`reg unload {{key_name}}` diff --git a/pages.cn/windows/reg.md b/pages.cn/windows/reg.md new file mode 100644 index 0000000000..abd48916e3 --- /dev/null +++ b/pages.cn/windows/reg.md @@ -0,0 +1,16 @@ +# reg + +> A command line interface for managing keys and their values in the Windows registry. +> See `reg-query`, `reg-add` and other pages for additional information. + +- Execute registry commands: + +`reg {{command}}` + +- Display general information and list all available commands: + +`reg /?` + +- Call help on a specific command: + +`reg {{command}} /?` diff --git a/pages.cn/windows/repair-bde.md b/pages.cn/windows/repair-bde.md new file mode 100644 index 0000000000..320229599c --- /dev/null +++ b/pages.cn/windows/repair-bde.md @@ -0,0 +1,35 @@ +# repair-bde + +> Attempt to repair or decrypt a damaged BitLocker-encrypted volume. + +- Attempt to repair a specified volume: + +`repair-bde {{C:}}` + +- Attempt to repair a specified volume and output to another volume: + +`repair-bde {{C:}} {{D:}}` + +- Attempt to repair a specified volume using the provided recovery key file: + +`repair-bde {{C:}} -RecoveryKey {{path/to/file.bek}}` + +- Attempt to repair a specified volume using the provided numerical recovery password: + +`repair-bde {{C:}} -RecoveryPassword {{password}}` + +- Attempt to repair a specified volume using the provided password: + +`repair-bde {{C:}} -Password {{password}}` + +- Attempt to repair a specified volume using the provided key package: + +`repair-bde {{C:}} -KeyPackage {{path/to/directory}}` + +- Log all output to a specific file: + +`repair-bde {{C:}} -LogFile {{path/to/file}}` + +- Display all available options: + +`repair-bde /?` diff --git a/pages.cn/windows/rmdir.md b/pages.cn/windows/rmdir.md new file mode 100644 index 0000000000..5246e51f3f --- /dev/null +++ b/pages.cn/windows/rmdir.md @@ -0,0 +1,15 @@ +# rmdir + +> Remove a directory and its contents. + +- Remove an empty directory: + +`rmdir {{path/to/directory}}` + +- Remove a directory and its contents recursively: + +`rmdir {{path/to/directory}} /s` + +- Remove a directory and its contents recursively without prompting: + +`rmdir {{path/to/directory}} /s /q` diff --git a/pages.cn/windows/scoop.md b/pages.cn/windows/scoop.md new file mode 100644 index 0000000000..c0c923688d --- /dev/null +++ b/pages.cn/windows/scoop.md @@ -0,0 +1,35 @@ +# scoop + +> A command-line installer for Windows. + +- Install a package: + +`scoop install {{package}}` + +- Remove a package: + +`scoop uninstall {{package}}` + +- Update all installed packages: + +`scoop update *` + +- List installed packages: + +`scoop list` + +- Display information about a package: + +`scoop info {{package}}` + +- Search for a package: + +`scoop search {{package}}` + +- List all known buckets (a bucket is an application repository): + +`scoop bucket known` + +- Add a bucket by its alias or a Git repository URL: + +`scoop bucket add {{bucket}}` diff --git a/pages.cn/windows/set.md b/pages.cn/windows/set.md new file mode 100644 index 0000000000..b7d98619d1 --- /dev/null +++ b/pages.cn/windows/set.md @@ -0,0 +1,19 @@ +# set + +> Display or set environment variables for the current instance of CMD. + +- List all current environment variables: + +`set` + +- Set an environment variable to a specific value: + +`set {{name}}={{value}}` + +- List environment variables starting with the specified string: + +`set {{name}}` + +- Prompt the user for a value for the specified variable: + +`set /p {{name}}={{prompt_string}}` diff --git a/pages.cn/windows/sfc.md b/pages.cn/windows/sfc.md new file mode 100644 index 0000000000..48f84ab71c --- /dev/null +++ b/pages.cn/windows/sfc.md @@ -0,0 +1,31 @@ +# sfc + +> Scans the integrity of Windows system files. + +- Display information about the usage of the command: + +`sfc` + +- Scan all system files and, if possible, repair any problems: + +`sfc /scannow` + +- Scan all system files without attempting to repair any: + +`sfc /verifyonly` + +- Scan a specific file and, if possible, repair any problems: + +`sfc /scanfile={{path/to/file}}` + +- Scan a specific file without attempting to repair it: + +`sfc /verifyfile={{path/to/file}}` + +- When repairing offline, specify the boot directory: + +`sfc /offbootdir={{path/to/dir}}` + +- When repairing offline, specify the Windows directory: + +`sfc /offwindir={{path/to/dir}}` diff --git a/pages.cn/windows/shutdown.md b/pages.cn/windows/shutdown.md new file mode 100644 index 0000000000..d87cc01fd5 --- /dev/null +++ b/pages.cn/windows/shutdown.md @@ -0,0 +1,35 @@ +# shutdown + +> A tool for shutting down, restarting or logging off a machine. + +- Shutdown the current machine: + +`shutdown /s` + +- Restart the current machine: + +`shutdown /r` + +- Hibernate the current machine: + +`shutdown /h` + +- Log off the current machine: + +`shutdown /l` + +- Specify a timeout in seconds to wait before shutting down: + +`shutdown /s /t {{seconds}}` + +- Specify a comment for the shutdown reason: + +`shutdown /s /c "{{reason}}"` + +- Abort a shutdown sequence whose timeout is yet to expire: + +`shutdown /a` + +- Shutdown a remote machine: + +`shutdown /m {{\\hostname}}` diff --git a/pages.cn/windows/sigverif.md b/pages.cn/windows/sigverif.md new file mode 100644 index 0000000000..f2f0b22b05 --- /dev/null +++ b/pages.cn/windows/sigverif.md @@ -0,0 +1,7 @@ +# sigverif + +> A GUI signature verification tool for checking system files. + +- Open the File Signature Verification interface: + +`sigverif` diff --git a/pages.cn/windows/subst.md b/pages.cn/windows/subst.md new file mode 100644 index 0000000000..b273cbb3e6 --- /dev/null +++ b/pages.cn/windows/subst.md @@ -0,0 +1,15 @@ +# subst + +> Associates a path with a virtual drive letter. + +- List active associations: + +`subst` + +- Add an association: + +`subst {{Z:}} {{C:\Python2.7}}` + +- Remove an association: + +`subst {{Z:}} /d` diff --git a/pages.cn/windows/systeminfo.md b/pages.cn/windows/systeminfo.md new file mode 100644 index 0000000000..e519658147 --- /dev/null +++ b/pages.cn/windows/systeminfo.md @@ -0,0 +1,19 @@ +# systeminfo + +> Display operating system configuration for a local or remote machine. + +- Display system configuration for the local machine: + +`systeminfo` + +- Display system configuration in a specified output format: + +`systeminfo /fo {{table|list|csv}}` + +- Display system configuration for a remote machine: + +`systeminfo /s {{remote_name}} /u {{username}} /p {{password}}` + +- Display detailed usage information: + +`systeminfo /?` diff --git a/pages.cn/windows/taskkill.md b/pages.cn/windows/taskkill.md new file mode 100644 index 0000000000..cef32c3143 --- /dev/null +++ b/pages.cn/windows/taskkill.md @@ -0,0 +1,27 @@ +# taskkill + +> Terminate a process by its process id or name. + +- Terminate a process by its id: + +`taskkill /pid {{process_id}}` + +- Terminate a process by its name: + +`taskkill /im {{process_name}}` + +- Forcefully terminate a specified process: + +`taskkill /pid {{process_id}} /f` + +- Terminate a process and its child processes: + +`taskkill /im {{process_name}} /t` + +- Terminate a process on a remote machine: + +`taskkill /pid {{process_id}} /s {{remote_name}}` + +- Display information about the usage of the command: + +`taskkill /?` diff --git a/pages.cn/windows/tasklist.md b/pages.cn/windows/tasklist.md new file mode 100644 index 0000000000..b28ac073be --- /dev/null +++ b/pages.cn/windows/tasklist.md @@ -0,0 +1,23 @@ +# tasklist + +> Display a list of currently running processes on a local or remote machine. + +- Display currently running processes: + +`tasklist` + +- Display running processes in a specified output format: + +`tasklist /fo {{table|list|csv}}` + +- Display running processes using the specified `.exe` or `.dll` file name: + +`tasklist /m {{module_pattern}}` + +- Display processes running on a remote machine: + +`tasklist /s {{remote_name}} /u {{username}} /p {{password}}` + +- Display services using each process: + +`tasklist /svc` diff --git a/pages.cn/windows/title.md b/pages.cn/windows/title.md new file mode 100644 index 0000000000..600954699b --- /dev/null +++ b/pages.cn/windows/title.md @@ -0,0 +1,7 @@ +# title + +> Set the title of the command prompt window. + +- Set the title of the current command prompt window: + +`title {{new_title}}` diff --git a/pages.cn/windows/tree.md b/pages.cn/windows/tree.md new file mode 100644 index 0000000000..4f18e513fb --- /dev/null +++ b/pages.cn/windows/tree.md @@ -0,0 +1,19 @@ +# tree + +> Display a graphical tree of the directory structure for a path. + +- Display the tree for the current directory: + +`tree` + +- Display the tree for a specific directory: + +`tree {{path/to/directory}}` + +- Display the tree for a directory including files: + +`tree {{path/to/directory}} /f` + +- Display the tree using ASCII characters instead of extended characters: + +`tree {{path/to/directory}} /a` diff --git a/pages.cn/windows/type.md b/pages.cn/windows/type.md new file mode 100644 index 0000000000..67c1c840d1 --- /dev/null +++ b/pages.cn/windows/type.md @@ -0,0 +1,7 @@ +# type + +> Display the contents of a file. + +- Display the contents of a specific file: + +`type {{path/to/file}}` diff --git a/pages.cn/windows/tzutil.md b/pages.cn/windows/tzutil.md new file mode 100644 index 0000000000..addff5b7b3 --- /dev/null +++ b/pages.cn/windows/tzutil.md @@ -0,0 +1,15 @@ +# tzutil + +> A tool for displaying or configuring the system time zone. + +- Get the current time zone: + +`tzutil /g` + +- Display a list of available time zones: + +`tzutil /l` + +- Set the system time zone to the specific value: + +`tzutil /s {{timezone_id}}` diff --git a/pages.cn/windows/units.md b/pages.cn/windows/units.md new file mode 100644 index 0000000000..ab4d9e1046 --- /dev/null +++ b/pages.cn/windows/units.md @@ -0,0 +1,23 @@ +# units + +> Provide the conversion between two units of measure. + +- Run in interactive mode: + +`units` + +- Show the conversion between two simple units: + +`units {{quarts}} {{tablespoons}}` + +- Convert between units with quantities: + +`units {{15 pounds}} {{kilograms}}` + +- Show the conversion between two compound units: + +`units {{"meters / second"}} {{"inches / hour"}}` + +- Show the conversion between units with different dimensions: + +`units {{"acres"}} {{"ft^2"}}` diff --git a/pages.cn/windows/ver.md b/pages.cn/windows/ver.md new file mode 100644 index 0000000000..efd00ed3bf --- /dev/null +++ b/pages.cn/windows/ver.md @@ -0,0 +1,7 @@ +# ver + +> Display the current Windows or MS-DOS version number. + +- Display the current version number: + +`ver` diff --git a/pages.cn/windows/vol.md b/pages.cn/windows/vol.md new file mode 100644 index 0000000000..9e2439c9f7 --- /dev/null +++ b/pages.cn/windows/vol.md @@ -0,0 +1,11 @@ +# vol + +> Display information about volumes. + +- Display the label and serial number for the current drive: + +`vol` + +- Display the label and serial number for a specific volume: + +`vol {{D:}}` diff --git a/pages.cn/windows/where.md b/pages.cn/windows/where.md new file mode 100644 index 0000000000..ae9f053f83 --- /dev/null +++ b/pages.cn/windows/where.md @@ -0,0 +1,20 @@ +# where + +> Display the location of files that match the search pattern. +> Defaults to current work directory and paths in the PATH environment variable. + +- Display the location of file pattern: + +`where {{file_pattern}}` + +- Display the location of file pattern including file size and date: + +`where /T {{file_pattern}}` + +- Recursively search for file pattern at specified path: + +`where /R {{path/to/directory}} {{file_pattern}}` + +- Display only the error code for the location of file pattern: + +`where /Q {{file_pattern}}` diff --git a/pages.cn/windows/whoami.md b/pages.cn/windows/whoami.md new file mode 100644 index 0000000000..e784ab8ad3 --- /dev/null +++ b/pages.cn/windows/whoami.md @@ -0,0 +1,23 @@ +# whoami + +> Display details about the current user. + +- Display the username of the current user: + +`whoami` + +- Display the groups that the current user is a member of: + +`whoami /groups` + +- Display the privileges of the current user: + +`whoami /priv` + +- Display the user principal name (UPN) of the current user: + +`whoami /upn` + +- Display the logon id of the current user: + +`whoami /logonid` diff --git a/pages.cn/windows/xcopy.md b/pages.cn/windows/xcopy.md new file mode 100644 index 0000000000..a30792c852 --- /dev/null +++ b/pages.cn/windows/xcopy.md @@ -0,0 +1,35 @@ +# xcopy + +> Copy files and directory trees. + +- Copy the file(s) to the specified destination: + +`xcopy {{path/to/file_or_folder}} {{path/to/destination}}` + +- List files that will be copied before copying: + +`xcopy {{path/to/file_or_folder}} {{path/to/destination}} /p` + +- Copy the directory structure only, excluding files: + +`xcopy {{path/to/file_or_folder}} {{path/to/destination}} /t` + +- Include empty directories when copying: + +`xcopy {{path/to/file_or_folder}} {{path/to/destination}} /e` + +- Keep the source ACL in the destination: + +`xcopy {{path/to/file_or_folder}} {{path/to/destination}} /o` + +- Allow resuming when network connection is lost: + +`xcopy {{path/to/file_or_folder}} {{path/to/destination}} /z` + +- Disable the prompt when the file exists in the destination: + +`xcopy {{path/to/file_or_folder}} {{path/to/destination}} /y` + +- Display detailed usage information: + +`xcopy /?`