(i) Linux system commands and files

Source: Internet
Author: User
Tags touch

Linux principles (Everything is file)

1. Open Linux operating system, require root user login Gnome GUI, language support choice for Chinese

Linux operator interface

Right-click on the desktop and click Open Terminal

Enter "Su", click Enter, the password appears, enter the password, hit enter, show the normal user switch root user success.

2. Use the shortcut key to switch to virtual Terminal 2, log in as a normal user, and view the system prompt

CTRL+ALT+F2 Switching to Terminal 2

Enter the account return, enter the password

3. Use the command to exit the logged on user on virtual Terminal 2

Enter exit

Click Enter to log the user out of virtual Terminal 2 success

4. Use the shortcut key to switch to virtual Terminal 5, log on as an administrator, and view the system prompt

CTRL+ALT+F5 Switching to Terminal 5

Enter "Su", click Enter, enter password, click Enter

5. Use the command to exit the logged on user on virtual Terminal 5

Enter "Exit" and click Enter to enter "Exit" again

Click Enter to exit the account success

6. Switch back to the graphical interface, right click on the desktop to open the terminal, enter the command to shut down the system

Cut back to the graphical interface, CTRL+ALT+F1 switch to the graphical interface

Enter "Init 0" to shut down the system

7. See which users are working on the system

Open terminal, enter "who" click Enter. The results show all current users, and the current time and place.

8. The current time of modification is August 26, 2018 11:28

Enter "date + month datetime year", click Enter

9. View the October 2015 calendar

Enter "Cal +10 2015" carriage return

10. Use two methods to view the instructions for using the LS command

(1) input "ls--help" point enter

(2) enter "Man LS" point return

11. Clear the screen

(1) Enter "Clear" and click Enter

(2) shortcut key "Ctrl+l"

12. Use "Useradd Tom" command to create a new Tom user, set the password for Tom user "123"

Enter "Useradd Tom", enter the input "passwd Tom", enter the password "123", return, enter the password again, successfully set the password for the user Tom.

13. Switch the current user to Tom

Input "Su-tom", enter, switch user success.

14. View the user name used by the current login Linux system

Input "WhoAmI", enter

15. Turn on the Linux operating system and require the root user to log in to the Gnome graphical interface

Same as the first question.

16. Right-click on the desktop to open the terminal and use the "Useradd Lucy" command to create a Lucy user

17. Use the mouse to click on the method to enter the root directory

18. Click the Home directory to enter the root user

Double-click "Home" to open the root directory. Or turn on the desktop "home"-"Computer"-"root".

19. Click to enter the home directory of the Lucy user

Turn on the desktop "home"-"computer"-"home"-"lucky".

20. Click to enter the directory used to store the frequently used executable files.

Bin directory: Used to store common executable files. Open "Home"-"computer"-"bin" on the desktop.

21. Click the directory to enter the executable file to store the system

Sbin Directory: The executable file used to store the system. Turn on the desktop "home"-"Computer"-"sbin".

22. Click to enter the device files directory

Dev directory: Device files directory. Turn on the desktop "home"-"computer"-"dev".

23. Click to enter the profile directory

ETC Directory: Configuration file directory. Turn on the desktop "home"-"computer"-"etc".

24. Create a directory WG

Input "MKDIR/WG" in terminal, enter

25. Create a new file in the WG directory using the absolute path method a.txt

Type "CD/" switch to the root directory "/" and type "ls" to list the contents of the directory. Type "CD WG" to switch to the "WG" directory. Type "Touch A.txt" to create a new file a.txt.

26. Enter the WG directory

Type "CD/" to switch to the root directory, type "ls" to list the root files, type "CD WG" to switch to the WG directory, and type "LS/WG" to list the files in the WG directory.

27. Create a new WG01 directory and B.txt file in the current directory using a relative path method

Type "CD/WG" to switch to the WG directory, and type "ls" to list the contents of the WG. Type "mkdir wg01" to create the directory wg01, and type "ls" to list the contents of the WG directory. Type "Touch B.txt" to create the B.txt file, and type "ls" to list the contents of the WG directory.

28. List content in the current directory in long list format

Type "Ls-l".

29. Delete Empty directory Wg01

Type "RmDir wg01" in the current directory.

30. Go to the previous level working directory

Type "CD.."

31. Force Delete Non-empty directory WG

32. Copy/etc/passwd to the current directory, named File1

33. Read-only view of the contents of the File1 file in a non-stop manner

Type "Cat File1" and enter.

34. View the first 3 lines of the File1 file

35. View the following 2 lines of the File1 file

36. Paging through the contents of the File1 file as a percentage

37. Paging through pages to view the contents of the File1 file

38. Create the following directory structure
sh-3.2# tree/ftpserver/
/ftpserver/
├──bin
│├──register.py
│└──start.py
├──conf
│└──settings.py
├──core
│└──server.py
├──db
│└──user.db
├──lib
│└──common.py
└──log
└──access.log

1: Switch to the path/TMP and append to the start.py to write the content. and displays the path.

2. Switch to the log directory, create a new directory access, and then move the Access.log to the directory.

3. Switch to the core directory and create a new auth.py file under the path

4. Open two terminals, one terminal to add content to the Access.log file, and then dynamically view the new content on the Access.log at another terminal.

5. Close the terminal above, and then write the content to the access.log in a overwritten manner

The append symbol is wrong and should be echo>

6. Delete the/ftpserver directory

(i) Linux system commands and files

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.