Linux Quick Reference (1)
2018-01-30 13:35
351 查看
所有下面的指令都是在Linux环境下使用的
mkdir - To organize files and directions. This will make a new directory: 例子:mkdir Programs 这样就可以创立一个名叫Programs的文件夹了
cd - change into another directory:
a. To change into a specific directory: cd CS_Program
b. To change into a directory using a wild card: cd CS*
c. To change back to the directory above: cd ..
d. To change to the root directory (regardless): cd
ls - list directory contents:
a. To list contents of the current directory: ls
b. To list the contents of specific files (e.g., that start with a capital P): ls P*
c. To list the contents of a specific directory: ls CS_Program
d. To list the contents of directories using a wild card: ls CS*
e. Add flags to get more detailed displayed: ls -l/etc
f. Use the wildcard() to list all the .cpp files in the current director: ls .cpp
cat - to display the contents of a file: cat test1.cpp
pwd - to determine your current path and directory name: pwd
cp - copy a file or directory:
a. For example: cp source dest if you want to copy a directory use the -R option for recursive. The forward slash (in front of the path) means that we are working from the root directory: cp -R ./source ./dest
b. The source and destinations may be complete paths or a path from the current directory, the following will copy the entire CS_Program directory and all of its files into the CS_program directory:
mkdir CS_program
cp -R CS_Program CS_program
mv - move a file or directory. You could think of this as a rename but it can also move a file to another directory! Make sure to pay close attention to the order of the arguments. The first argument (source) is the file or directory that you want to copy from and the second arguments (dest) is the file that you want to copy to (e.g., the file to be created). Keep in mind that a move does not leave the original (unlike copy) so use it with great caution !
a. Syntax: mv source dest
b. Move a file: mv program1.cpp new_name.cpp
c. Rename a directory: mv CS_Program new_directory_name
mkdir - To organize files and directions. This will make a new directory: 例子:mkdir Programs 这样就可以创立一个名叫Programs的文件夹了
cd - change into another directory:
a. To change into a specific directory: cd CS_Program
b. To change into a directory using a wild card: cd CS*
c. To change back to the directory above: cd ..
d. To change to the root directory (regardless): cd
ls - list directory contents:
a. To list contents of the current directory: ls
b. To list the contents of specific files (e.g., that start with a capital P): ls P*
c. To list the contents of a specific directory: ls CS_Program
d. To list the contents of directories using a wild card: ls CS*
e. Add flags to get more detailed displayed: ls -l/etc
f. Use the wildcard() to list all the .cpp files in the current director: ls .cpp
cat - to display the contents of a file: cat test1.cpp
pwd - to determine your current path and directory name: pwd
cp - copy a file or directory:
a. For example: cp source dest if you want to copy a directory use the -R option for recursive. The forward slash (in front of the path) means that we are working from the root directory: cp -R ./source ./dest
b. The source and destinations may be complete paths or a path from the current directory, the following will copy the entire CS_Program directory and all of its files into the CS_program directory:
mkdir CS_program
cp -R CS_Program CS_program
mv - move a file or directory. You could think of this as a rename but it can also move a file to another directory! Make sure to pay close attention to the order of the arguments. The first argument (source) is the file or directory that you want to copy from and the second arguments (dest) is the file that you want to copy to (e.g., the file to be created). Keep in mind that a move does not leave the original (unlike copy) so use it with great caution !
a. Syntax: mv source dest
b. Move a file: mv program1.cpp new_name.cpp
c. Rename a directory: mv CS_Program new_directory_name
相关文章推荐
- Real-time Linux Software Quick Reference Guide
- Linux下编程工具的使用(6) - VIM编辑器系列(2) - Vi Quick Reference
- A Quick Reference for Oracle Database 10g RAC on Linux and Unix Platforms
- LINUX_System_Call_Quick_Reference
- Quick Reference for Linux Device Drivers Development (kernel 2.6.15)
- Linux Quick Reference
- linux c++ undefined reference
- J2ME Nokia UI API Quick Reference[小糊涂的灵感]
- J2ME in a nutshell: a desktop quick reference
- Objective-C Cheat Sheet and Quick Reference
- Linux and UNIX security portable reference
- Linux gcc编译提示:undefined reference to `sqrtf' collect2: error: ld returned 1 exit status
- [Linux] undefined reference to `itoa'
- Linux / Unix Command: bunzip2--reference
- WebLogic 11g interactive quick reference
- Linux 下解决pthread_create undefined reference 方法
- linux源码编译安装php5.4.43报错Directive 'allow_call_time_pass_reference' warning
- ----linux--内核编译的问题:undefined reference to `printascii'
- Linux下基于opencv程序编译时,出现undefined reference to `cv::SIFT::SIFT(int, int, double, double, double)
- linux下编译多线程程序, undefined reference to `pthread_create',undefined reference to `pthread_join'