Introduction to Linux System Operations
1. Logging into the System Console
1.Graphical interface console has 2 options: Ctrl+Alt+(F1-F2) to switch. The default login is on Ctrl+Alt+F2 console.
2.Character interface console has 4 options: Ctrl+Alt+(F3-F6) to switch.
2. Terminal Usage Methods
1.Ctrl+Shift++ to enlarge the terminal.
2.Ctrl+- to reduce the terminal size.
3.Ctrl+Shift+t to create a new tab.
4.Ctrl+Shift+n to open a new terminal.
5.exit to close the terminal.
6.Ctrl+Shift+c to copy content.
7.Ctrl+Shift+v to paste content.
8.Ctrl+Insert to copy.
9.Shift+Insert to paste.
10.Ctrl+L to clear the screen; you can also type the command clear.
3. Functions of Each Directory Under Root (/)
Note: Everything in Linux is a file, and all files are under the root (/).
1./etc directory stores configuration files for system programs or application services.
2./home directory stores the home directories of regular users, e.g., /home/tom.
3./root directory stores the home directory of the administrator (root) user.
4./bin directory stores commands for regular users. The /bin directory is a symbolic link, its original path is /usr/bin, similar to a Windows shortcut.
5./sbin directory stores commands for the administrator user. The /sbin directory is a symbolic link, its original path is /usr/sbin, similar to a Windows shortcut.
6./usr/local directory stores the installation directory for third-party source packages, similar to the Windows software installation path C:\Program Files (x86).
7./tmp directory stores temporary files generated during system operation, which are released upon shutdown, and all files inside can be deleted.
8./var directory stores some rolling data files during system operation, e.g., system log information in /var/log/.
9./boot directory stores system kernel files and boot files.
10./media directory stores the default mount points for removable devices.
11./mnt directory stores manual mount points for devices.
12./dev directory stores device files, e.g., disk files, CD-ROM files.
13./proc directory stores virtual files, e.g., hardware information, process files.
4. Path Representation Methods in Linux
1.Absolute Path
Paths that start with root and are unique, with no path preceding root, e.g., cd /home/tom.
2.Relative Path
Paths that reference the current path, where the current path can be replaced with . or ./.
[root@test home]# pwd /home [root@test home]# cd ./tom [root@test tom]# pwd
The command to go up one level can use .. or ../ to represent the parent directory.
[root@test tom]# cd .. [root@test home]# pwd /home
3.pwd command to view the current path location.
4.cd command to change the current directory path.
5. Meaning of [root@test ~]#
1.root indicates the username of the currently logged-in user.
2.@ indicates the host (here it has no meaning).
3.test indicates the hostname of the system.
4.~ symbol indicates the current user’s home directory.
5.~ location indicates the current path entered.
6.# symbol indicates that the currently logged-in user is the administrator (root), and only the administrator user is represented by #.
7.$ symbol indicates that the currently logged-in user is a regular user, and all regular users are represented by $.
6. Precautions When Entering Commands
1.Know your current location using pwd.
2.Know what user you are using with whoami.
3.Know what you want to do.
4.Linux strictly distinguishes between uppercase and lowercase letters.
5.Commands and paths can be auto-completed using the tab key.
Pressing the tab key once without a result indicates that the command is not unique, or that the path does not exist; pressing the tab key again can provide more options.
6.Pay attention to error messages when entering commands.
[root@rhel9 ~]# ca /etc/ bash: ca: command not found…
[root@rhel9 ~]# cd /etc/selinua bash: cd: /etc/selinua: No such file or directory.