Introduction to linux commands (1)

Source: Internet
Author: User
Linux contains commands executed by the administrator root and commands managed by common users: the commands run by Root are put into/sbing and/usr/sbinAllusers and put into/bin and/usr/binLinux. by default, there is a built-in user nobody in the system to add the user: useradd to set the password: passwd...

Linux contains commands executed by the administrator root and commands managed by common users:

Put the commands run by Root in/sbing and/usr/sbin.

All users execute commands in/bin and/usr/bin

 

 

By default, there is a built-in user nobody in Linux.

Add User: useradd

Set password: passwd

Usage: useradd wds

Passwd wds

 

File view file type

 

 

Command:

Ifconfig to view ip information;

Su-user name and password switch user;

 

Command name: ls

Command: list

Command path strength:/bin/ls

Execution permission: all users

Function description: displays directory files.

Syntax: ls option [-ald] [file or directory]

-A: displays all files, including hidden files.

-L detailed information display

-D. View directory properties.

 

 

The information of the file queried by ls-l:

Drwxr-xr-x 2 root 4096 sep 4 13:07 bin

D: indicates the file type. in linux, there are three file types: d File,-executable file, and x soft connection.

R (read) indicates readable, w (write) can be written, and x (execute) can be executed;

U (user) owner g (group) owner group o (other) other

Rwx indicates that the owner has these three permissions.

R-x indicates that the group has two permissions.

R-x indicates the permissions of other users.

2 indicates the number of hardware connections

Root owner

Root group

4096 (inaccurate)

Sep 4 creation or last modification time

Bin file name

 

 

Command name: cd

Command: change directory

Command path strength: shell built-in commands

Execution permission: all users

Function description: switch directories.

Syntax: ls [directory name]

You can use the following commands

 

Command name: pwd

Print working directory

Command path strength:/bin/pwd

Execution permission: all users

Function description: displays the current working directory.

Syntax: pwd

Example: $ pwd

/Etc/rc5.d

 

 

Command name: touch

Command path strength:/bin/touch

Execution permission: all users

Function description: creates an empty file.

Syntax: touch [file name]

Example: $ touch newfile

 

 

 

Command name: mkdir

Make directories

Command path strength:/bin/mkdir

Execution permission: all users

Function description: Creates a directory.

Syntax: mkdir [directory name]

Example: $ mkdir newdiw

 

 

 

Command name: cp

Command syntax: copy

Command path strength:/bin/cp

Execution permission: all users

Function description: copy a file or directory.

Syntax: cp-R [source file or directory] [destination directory]

-R Directory

When copying a directory, you must add-R

 

 

 

Command name: mv

Command: move

Command path strength:/bin/mv

Execution permission: all users

Function description: move and rename a file

Syntax: mv [source file or directory] [destination directory]

Example: $ mv file1 file2 (renamed)

$ Mv file1 dir2 (mobile)

 

 

 

Command name: rm

Command: remove

Command path strength:/bin/rm

Execution permission: all users

Function description: delete an object.

Syntax: rm-r [file or directory]

-R: Delete a directory.

-F: force delete. do not ask if you want to delete

 

Rmdir: delete an empty directory (not applicable. you cannot delete any files in it)

Author "???"
 

Related Article

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.