Home > Operation and Maintenance > Linux Operation and Maintenance > What are the basic operations of Linux?

What are the basic operations of Linux?

coldplay.xixi
Release: 2020-06-30 11:02:21
Original
3768 people have browsed it

Basic Linux operations include: 1. [passwd] is to set a password; 2. [su] is to switch users; 3. [who] is to view online users; 4. [whoami] is to view the current user User; 5. [hostname] displays the host name, etc.

What are the basic operations of Linux?

The basic operations of Linux are:

1. Overview

1. Common operating systems

Server operating systems: linux, unix, windows server

Stand-alone operating systems: windows (dos, ucdos, win95, win98, win2000, XP, Vista, Win7, Win8)

Mac, Linux (Ubuntu)

mobile operating system Android, iOS, Windows Phone

# 2, Linux operating system introduction introduction

Linux is a free and open source UNIX-like operating system. It has openness, multi-user, multi-tasking, rich network functions, reliable system security, and good portability. Good user interface (command interface, graphical interface, etc.), excellent speed performance and other advantages. Now it is mainly used for:

  • Most servers use linux, and JEE is deployed to the server

  • Some companies and schools use linux for R&D and Teaching

  • Many embedded development uses linux

  • Cloud computing and big data are cluster networks linux: centos

Linux is composed of:

  • linux kernel (managed by linus team)

  • shell: the interface for users to interact with the kernel

  • File system: ext3, ext4, etc. windows have fat32, ntfs

  • Third-party application software

Linux The operating system version consists of a kernel version (managed by the linus team) and a release version (some software companies use the kernel as the basis, and then add some software and documents to form a release version). Common release versions are:

- red hat : rhel, centos

- debian : debian, ubuntu (desktop)

- android

2. Linux system environment

By default, there are 6 command interaction channels and a graphical interface interaction channel. The graphical interface channel is entered by default:

  • Command interaction mode switching: ctrl alt f1---f6

  • Graphic interactive interface ctrl alt f7

1. Graphical interface interaction mode

  • terminal: The command terminal of the graphical interface, which is an extension of the graphical interface interaction channel and depends on the graphical interface

2. Command interaction mode

  • Command prompt:

    shen@ubuntu:~$

  • shen: Username

  • ubuntu: Host name

  • ~ : Path, if the current If the path is exactly the root directory where the user stores data, it will display ~

  • $: Type of user $ represents ordinary user # represents super User

3. Commonly used commands

(press tab to create automatic completion)

1. Log out, Shut down and restart

  • Logout: logout or exit

  • Shutdown: shutdown - h Time

h: Shut down

Time:

1. now: Immediately

2. 12.30: Specify the specific time

3. 3: A few minutes later

Note: Not every user can complete the shutdown. A super user or authorized user is required to execute this command. Ordinary users must The super user configuration sudo command can perform the shutdown operation (the permissions are placed here/etc/sudoers). When an ordinary user is authorized, the operation can be completed through [sudo shutdown -h now]. sudo means using the super user permissions (given ) to execute a command, similar to running as administrator in window

Restart:

shutdown -rTime (permission issues are similar to the above)

2. System command

    ##passwd: Set password
  • The default root account of ubuntu is not enabled. As long as Set the root password to open [sudo passwd root]

    su: Switch users
  • For example, su root, the root user will not switch to other accounts. Password required

sudo apt-get update

Update system

    who and whoami
  • ##where

    who
  • : View online users

  • whoami : View the current user, such as

What are the basic operations of Linux?

Which window tty2 represents (ctrl alt f2), pts/1 represents the terminal opened in the graphical interface.

  • hostname: Display host name

  • ##uname: Display system information

      -

    a : Display complete system information

  • top: Display information on the current time-consuming process (part), every 3 Refresh once every second, similar to Windows Task Manager (cltr c interrupt)

  • ps : Display a snapshot of the current process (all)

    - axu

  • df :Disk usage (disk free)

  • ifconfig :View or Configure the network card information, such as ipconfig of windows

  • ping Test the connection with the target host

For example, test the connection between the local machine and the target host The connection situation in the virtual machine, (local IP: 169.254.64.182, virtual machine IP: 172.25.0.95), in the virtual machine terminal, test

ping 169.254.64.182 [Press Ctrl c to end], in Ping 172.25.0.95

  • netstat in this machine (cmd): Network connection details

  • clear : Clear the screen (windows: cls)

  • man: Help command

You can view the parameters of the command , such as man ls

  • kill: kill process (kill pid)

  • useradd : Add user

First check the user information, the command is sudo cat /etc/passwd, introduce one of the user information

 hadoop:x:1000:1000:UbuntuA,,,:/home/hadoop:/bin/bash
Copy after login

-

hadoop:Username

-

x: Password: Already encrypted, the password is stored in /etc/shadow

-

1000: Account id, userId

-

1000: Group id, group id

-

UbuntuA,,,: Account description

-

/ home/hadoop: The default location where the account stores files ~

-

/bin/bash: The user’s shell script parsing method, sh, bash, rbash

Then create a user (take creating the "lijing" user as an example), the steps are as follows:

1. Create the

/home/lijing directory (create the "lijing" file under home )

What are the basic operations of Linux?

2. Execute the

useradd command

What are the basic operations of Linux?

-d: Specify the home of the user Path

- s: The user’s shell parsing method

3. Use

passwd to set the password

What are the basic operations of Linux?

4 .

suSwitch user

Related learning recommendations:

linux video tutorial

The above is the detailed content of What are the basic operations of Linux?. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template