(1) linux beginners: linux concepts and Common commands, common linux commands

Source: Internet
Author: User
Tags touch command

(1) linux beginners: linux concepts and Common commands, common linux commands
Linux introduction:

Linux is a free, free, and open source operating system. It is also the most famous example of open-source software. Its main purpose is to establish a Unix-like compatible product that can be used all over the world without the copyright control of any commercialized software. however, deploying the server in Linux will be more stable, secure, efficient, and superior to the performance of windows.

Linux features:

Open, multi-user, multi-task, rich network functions, reliable system security, good portability, standard compatibility, good user interface (command interface, graphic interface, etc ), excellent Speed and Performance

Linux composition:

Kernel: it is the heart of the system and the core program for running programs and managing hardware devices such as disks and printers.

Shell: A system user interface that provides an interface for users to interact with the kernel. It receives user-input commands and sends them to the kernel for execution. It is a command interpreter. But it not only enables the command interpreter, but also advanced programming languages and shell programming.

File System: The file system is the organization method for storing files on disks and other storage devices. Linux supports multiple file systems, such as ext3, ext2, NFS, SMB, and iso9660.

Applications: standard Linux operating systems have a set of applications, such as X-Window and Open Office.

Linux directory structure:

Bin stores binary executable files (ls, cat, mkdir, etc)

Boot stores various files used for system boot.

Dev is used to store device files.

Etc stores system configuration files

Home: root directory for storing all User Files

Lib stores the shared libraries and kernel modules required for running programs in the file system.

Mnt System Administrator installation of Temporary File System

The location where the optional application package of opt is additionally installed

The proc Virtual File System stores the current memory ing.

Root Super User directory

Sbin stores binary executable files, which can only be accessed by the root user

Tmp is used to store various temporary files

Usr is used to store system applications. An important directory is the/usr/local administrator software installation directory.

Var is used to store files that need to change data during running.

 

How to connect to a linux Server: 1) after installing lrzsz using crt, xhsf-/ ssh, and other tools, you can use sz and rz to upload and download yum for installation:
yum -y install lrzsz
Compile method installation: http://blog.chinaunix.net/uid-20639775-id-154615.htmlscp filename. User Name @ IP :~ Can be uploaded to linux2) use the cmd command in windows to directly connect to linux (a high level, with fewer users)

Common Command Parsing:

Useradd command

The useradd command is used to add a user to the system. For example, useradd username is used to directly create a user without following the options. Other attributes of the user are default. After the user is created, the passwd command is used to add a password.

Useradd faith creates a user faithpassed faith to set a password for faith. After the command is entered, a prompt will be prompted to enter the password and confirm the password.

Whoami and id commands

Id commandDisplays valid user IDs and group IDs ). UID is a single identity for a user. The Group ID (GID) corresponds to multiple UIDs. The id command is pre-installed in most Linux systems by default. To use it, you only need to enter the id in your console. The input id without option is displayed as follows:

[root@localhost ~]# id uid=0(root) gid=0(root) groups=0(root),1(bin),2(daemon),3(sys),4(adm),6(disk),10(wheel)
-G or -- group: displays the ID of the group to which the user belongs. -G or -- groups displays the ID of the additional group to which the user belongs. -N or -- name indicates the name of the user, group, or additional group. -R or -- real displays the actual ID. -U or -- user displays the user ID.Common commands

Su command

Su commandUsed to switch users, for example, su faith, to the faith user. The user name is not added after the su command is executed by a non-root user, and is switched to the root user by default.

Su faith switches to the faith user, and the current directory remains unchanged. A message is displayed, prompting you to enter the password su-faith to switch to the faith user and switch to the faith main directory. A message is displayed, prompting you to enter the password [root @ localhost ~]. # Su faith [faith @ localhost ~] $ Directly switch to faith. The root user does not need to enter the password when switching to another user. [faith @ localhost ~] $ Su enter the password: [root @ localhost ~] # Switch to the root userUsage

Env command

Env commandUsed to view existing system variables in the system, that is, path. For example:

[Root @ localhost ~] # Env can be viewed directly. Other options are not required later.

Cd command

Cd commandUsed to switch the working directory, for example, cd dirname, where dirName can be an absolute or relative path. If the directory name is omitted, it is changed to the user's home directory (that is, the home directory ). In addition ,~ It also indicates the meaning of home directory.

. Indicates the current directory.. indicates the parent directory of the current directory.

Common commands:

Cd to go to the user's home directory; cd ~ Go to the user's home directory; cd-Return to the directory where the user is located before the Directory; cd .. returns the upper-level directory (if the current directory is "/", it is still "/" after execution); cd .. /.. returns the last two levels of directories;Usage

Ls command

Ls commandUsed to view folder content

1 ls-l: displays and sorts the details in the current folder, but does not show hidden content. 2 ls-al: displays all the content in the current folder, sort-hide content also show 3 ll ls-l shorthand

 Mkdir command

Mkdir commandCreate a new folder, for example, mkdir dirname. Create a folder in the current directory.

Mkdir/opt/tutu/aaa create a folder named aaamkdir-p/opt/tutu/aaa under the/opt/tutu/directory. If the folder does not exist, add-p

Touch command

Touch commandTo create a new file, you can directly touch filename to create a new file.

-A: Or -- time = atime or -- time = access or -- time = use only change the access time;-c: or -- no-create does not create any files;-d: <time and date> use the specified date and time instead of the current time.-f: this parameter will be ignored and will only be used to solve compatibility issues of the BSD touch command.-m: or -- time = mtime or -- time = modify only change the change time;-r: <reference file or directory> change the date time of the specified file or directory, all are set to the same date and time as the reference file or directory;-t: <date and time> use the specified date and time, not the current time;Option

Dhclient command

Dhclient commandUsed to automatically obtain IP addresses

[Root @ loaclhost ~] # The IP address can be automatically obtained by entering the command in dhclient.

 

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.