Basic operations of linux

Release: 2020-05-20 13:07:18
Original
124 people have browsed it

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

• View the current path: pwd

• Command format: Command - Options - Parameters (directory)

• View files under the current path: ls

– d: View only the information of the current directory

– l: View detailed information

– a : Display all. Add "." in front of any file to indicate hidden files

– h: Display file size

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!

Related labels:
1
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Articles by Author
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!