Unix Command

จด Unix/Linux command แบบเบื้องต้นใช้ใน Terminal หรือ Command Line

DescriptionCommandExample
list contentsls$ ls -l
make directorymkdir <dirname>$ mkdir environment
change directorycd <dirname>$ cd environment/
cd one directory up$ cd ..
cd to home directory$ cd ~ or just $ cd
cd to path incl. home dir$ cd ~/environment/
move file (rename)mv <source> <target>$ mv foo bar
copy filecp <source> <target>$ cp foo bar
remove filerm <file>$ rm foo
remove empty directoryrmdir <directory>$ rmdir environment/
remove nonempty directoryrm -rf <directory>$ rm -rf tmp/
concatenate & display file contentscat <file>$ cat ~/.ssh/id_rsa.pub

Leave a Comment

Your email address will not be published. Required fields are marked *