Home > Article > Backend Development > Basic operations of linux
Basic user operations
• Add a user: useradd (administrator) Only administrators can operate
– Usage: useradd user Name
• Set the user’s login password: passwd (administrator)
– Usage: passwd Username
• View the currently logged in user: whoami
• Switch users: su
– Usage 1: su user name Usage 2: su Enter (switch to root)
– Features: Administrators do not need a password to switch ordinary users. Password is required to switch between
• Administrator login (#), ordinary user login ($)
shell shortcut key
• Ctrl a: Move to the beginning of the command line
• Ctrl e: Move to the end of the command line
• Ctrl u: Move the cursor to the beginning of the command line Clear
• Ctrl k: Clear the content from the cursor to the end of the command line
• Ctrl r: Search for a command in the history list
• Ctrl l: Clear screen
•
• history //Display historical commands
! [number] //Directly execute the command that has been executed now
Up/Down Arrow
##View files and directories
Path switching
• Path switching: cd– -: Return to the previous directory – ..: Return to the upper level directory “.”: Current directory, “.. ”Upper-level directory– ~: To the user’s home directory• • Absolute path and relative path• • Create a file: touch##Directory structure
• /boot Files required when Linux starts
• /dev device file
• /etc configuration file
• /home user home directory
• /media media file
• / mnt mount file
• /opt third-party software
• /proc virtualization file
• /root administrator’s home directory
• / run process file
• /srv compressed file
• /sys system file
• /usr installed software, shared library
• / var variable data, log file
• /tmp temporary file
• /usr/bin commands that ordinary users can use
• /usr/sbin that super users can use The command
•/usr/lib 32-bit library file
•/usr/lib64 64-bit library file
linux file processing
d: Indicates directory
-: Indicates file
l: Connection file
b: Device file, provides storage interface device
c: Device file, provides serial interface device-keyboard, mouse
The above is the detailed content of Basic operations of linux. For more information, please follow other related articles on the PHP Chinese website!