linux basis of software testing

Linux main catalog:

/: Root directory, in general, only the root storage directory, and only one root directory under linux, everything is from here when the input / home in the terminal, is in fact tell the computer, start with the / (root directory) to start, then go to the home directory 

/ Bin, / usr / bin: directory executable binary files, such as the commonly used commands ls, tar, mv, cat, etc. 

/ Boot: the boot files used in place linux system, such as linux kernel file: / boot / vmlinuz, system boot manager: / boot / grub 

/ Dev: file storage device linux system, access a file in the directory, which is equivalent to access a device commonly used to mount the CD mount / dev / cdrom / mnt

/ Etc: system configuration files directory is not recommended to store executable files in this directory

/ Home: the default user's home directory, create a new user account, the user's home directory are stored in this directory

   ~ Represents the current user's home directory

  ~ Edu edu representation of the user's home directory 

/ Root: system administrator root's home directory 

Common Linux commands:

1. view the file information: ls

-lah tupian LS   A: all the files in the specified directory l: display file details h: mating -l shows the file size to human

2. Change the working directory: cd

cd / home / admin switch to the user admin directory, CD ~ switch to the current user, CD. switch to the current directory, CD .. switch to the parent directory, CD - switching to the previous directory

3. The current path: pwd

pwd pwd direct input to, not behind parameters

4. Create a directory: mkdir

mkdir tupian tupian create a directory in the current directory, mkdir A / B / C -p   parameter -p represents recursively create directories

5. Delete the file: rm

rm -r abc abc delete this folder, r: content directory recursively delete, delete the folder you want to add this parameter, f: force the removal, i: will be a friendly reminder when you delete Delete

6. Copy: cp

cp 1 .txt 2 .txt 1.txt to copy the contents of the 2.txt    -a : typically used when copying directories to retain the original properties include links to these folders, 
                         -f : overwrite an existing file and do not prompt , -i : interactive copy, will prompt the user to determine when coverage requirements file,
                         -r : If the source file is a directory, then copy recursively all directories and files in the directory, the target file must be a directory name -v : display copy progress

8. move, rename: mv

mv . 1 .txt 2 .txt to move content 1.txt 2.txt, 2.txt if not present, will 1.txt 2.txt renamed, moved mv command can be a file or directory 
         -f : prohibition interactive operation, there will not be covering tips, -i : interactive operation, covering prompts the user to confirm, -v : show progress

9. Create a file: touch

Generally not to create an empty file, but the file was created while the editorial content, so usually use gedit command

touch hello.txt create an empty file 
gedit hello.txt hello.txt edit the file if the file does not create this file

1 0. The output redirection:>

Note:> output redirection overwrites the original content >> redirect the output will be appended to the end of the file. 

ls> test.txt the output of the ls test.txt to this file, if the file is not created, then cover it if there is content

11. Pipeline: |

Pipes: a command can be output as an input of another command through the pipeline.

ls / | more to the front of the command ls / command more to the back of the handle

12. Establish links file: ln

Create a shortcut to establish the link under the equivalent windows

Soft links: soft links do not take up disk space, delete the source file is a soft link failure.

Hard links: hard link can only link a regular file, directory can not be linked.

Hard Links: 
LN source file link
soft link:
LN -s source file link file

If there is no representative of the -s option to create a hard link file, two files occupy the same space the size of the hard drive, even if you delete the source files, link files still exist, so the -s option is the more common form.

Note: If the soft link files and source files are not in the same directory as the source file using the absolute path, you can not use relative paths.

 

hello.txt

Guess you like

Origin www.cnblogs.com/Jhuahua/p/11488777.html