Linux system is simple file manipulation commands

project content
This work belongs courses Course Link
Where this requirement in the job Experimental requirements
Student ID - Name 17043114- Li Qiang
Job learning objectives Learning in the command line in Linux terminal. Common command-line operation and control through command-line operations to solve simple problems

Linux system is simple file manipulation commands

(1) view the current directory

Q: prompt difference of $ # and?

A: For the average user, Base shell prompt, the default is the dollar sign $; for the superuser (root user), Bash Shell default prompt is the pound sign #.

(2) to create a directory named own student number in the user directory and see whether creating success

Q: 1) How to list all the current directory the following files?

A: The use ls -a

2) in the form of a list of how to list the current contents of that directory?

A: ls -l command

What 3). And .. are?

A: represents the current directory, .. indicates the parent directory of the current directory.

(3) enter with their student ID named directory, view the current directory, and then create their own full name directory named

Q: The difference between 1) the relative and absolute paths?

A: The relative path is relative to the directory where the current program, the current directory is constantly changing as the program executes. However, an absolute path is relative to the root path / root path is constant.

2) How to return the user's home directory from the current directory?

3) How do I delete a directory?

(4) create a file in a subdirectory of the current directory and name a.txt

Q: 1) What is the role if the file already exists after the touch command will produce?

A: The time attributes modify file modify the current time, the other intact.

(5) the current into the first subdirectory of the current directory, and then displays the current directory and list the contents of the current directory, and file a.txt write a string Hello World

Q: figure symbol> What does that mean?

A: Linux in> represents overwrite the original file contents (file date will be updated).

(6) to return to their student number named directory tree command can be used to see if you can not use it, install tree, use this command after a successful installation

(7) the first subdirectory of the current directory a.txt copied to the second subdirectory, and then again to copy the first subdirectory a.txt to third subdirectory named b.txt Finally, the first subdirectory a.txt rename c.txt. View the current situation through the directory tree command.

1) Present a subdirectory directory a.txt copied to the second subdirectory

2) copy the first subdirectory and the subdirectory to a third a.txt named b.txt

3) The first subdirectory a.txt rename c.txt.

Q: cp and mv respectively illustrate the use of? And with the screenshot below.

A: Function cp command to copy a file or directory is to be given to another file or directory, mv command to move a file or directory, a file or directory may be renamed. For example, create a file folder m.txt in li

Then m.txt use cp copied to the second folder

Li reuse mv command to get inside m.txt below qiang2

As can be seen in m.txt li is moved to the next qiang2, not copied to the next qinag2, it can be seen that different Mv and cp is a movement renamed, a copy is used.

(8) Copy the / etc directory passwd file to his own student number named folder

(9) See passwd file with a front head 5 row of content to view the contents of row 5 passwd file by tail

Q: What's the command file to see? And brief description of the method used

(1) vi filename # editing view, modify, and finally type: q to exit the view, for example: vi passwd

(2) cat # file name display all file contents: cat passwd

(3) more filename # page display file contents

(4) less filename # acquaintance with More

(10) Under delete student number file named passwd file and delete the current heads of the third sub-folder.

Q: 1) delete the folder also what commands can be used? If you use this command should I do?

A: The use of force delete file rm -rf, rm -i will prompt you to delete

2) a brief description of use of the rm command? (Screenshot)

A: rm command: 1 Format:. Rm [options] files;

(1) rm -i prompt when you delete

(2) rm -rf, forcibly delete files without prompting

(3) delete any .log files; one by one to ask confirmation before deleting

Guess you like

Origin www.cnblogs.com/liqi2/p/12442264.html
Recommended