变量之间用空格分隔

terminal 怎么知道这些程序的?有一个东西叫做环境变量 (environment variable),是给一个编程语言的用的变量。是每当 shell 启动时就有的变量,而不是你在 shell 中设的变量 废话

没错,shell 也是一个编程语言,它可以用控制语句,shell scripting。

Basic command

echo $PATH  # print all PATH the shell will look for
which date  # print where the program is
pwd         # print working directory
cd ./Jinix  # change directory to Jinix in current directory
ls /        # list the file in current directory, 0 or more path para
mv 1.c 11.c # move f & d, require two paths; *or can rename*
cp 1.c 11.c # copy only file
cp -r dir1 dir2 # but can provide '-r', for recursion cp to copy a dir
rm 1.c      # remove only file, but similarly:
rm -r dir1
rmdir dir1  # remove dir only if the dir is empty
mkdir My Photos # make two dirs named 'My' & 'Photos' respectively
man rmdir   # show manual of program 'rmdir'

Special word

cd ~/Desktop # tilde for the home directory
cd -         # dash for the previous dir, a handy way to toggle between two dirs
ls --help    # --help will show the usage 

Permission of files and directory

如果你有一个文件的w,但是没有这个文件所在目录的w,那么你可以 empty it, but cannot delete it

dx determine whether you can cd in the directory,同时需要他的父目录都要x

Stream