echo $PATH # print all PATH the shell will look forwhich date # print where the program ispwd # print working directorycd ./Jinix # change directory to Jinix in current directoryls / # list the file in current directory, 0 or more path paramv 1.c 11.c # move f & d, require two paths; *or can rename*cp 1.c 11.c # copy only filecp -r dir1 dir2 # but can provide '-r', for recursion cp to copy a dirrm 1.c # remove only file, but similarly:rm -r dir1rmdir dir1 # remove dir only if the dir is emptymkdir My Photos # make two dirs named 'My' & 'Photos' respectivelyman rmdir # show manual of program 'rmdir'
Special word
cd ~/Desktop # tilde for the home directorycd - # dash for the previous dir, a handy way to toggle between two dirsls --help # --help will show the usage
About "Path"
诶哟,原来 . 代表当前目录,.. 代表父目录,不用加 /。因此 cd .. 代表去往 the parent directory of current. 确实,本来目录最后一个都不用加斜杠的
easyDecode # a environment variable? a program? The former# a program in the relevent directorySelf-madeTools/easyDecode# echo a "world" word../../bin/echo worldcd Self-madeTools/
但是也许需要它是目录的时候,给他一个 / 指明会更好?
Permission of files and directory
如果你有一个文件的w,但是没有这个文件所在目录的w,那么你可以 empty it, but cannot delete it
dx determine whether you can cd in the directory,同时需要他的父目录都要x