Embedded Linux Learning 1 -- Introduction to Linux-related commands

Source: Internet
Author: User
Tags gz file

It's hard to study embedded Linux. I will share my learning achievements with you in the next days.

"Keep learning, don't be afraid"

First, the basics of Linux

Linux features:

1. Free Open Source

2. Portability and device platform independence

3. Powerful network functions

4. POSIX (Portable Operating System Interface) Standard

5. Multi-task, multi-user operating system

This is also because of these advantages, it is often used in enterprise service applications (SINA, Baidu...) embedded systems (ARM, MIPS, PowerPC ...)

And personal desktop applications (RedHat Ubuntu ...)

Common Linux commands: (I only list Common commands and common methods. For details, refer to relevant documents)

1. Common file management commands

Cat: displays information about a file.

Common usage # Cat filename

Chmod: modify directory or File Permissions

A file or directory has the following permissions:

Drwxr-XR-x
2 root Root 4096 Apr 10 13:15 Server

Frontend D indicates a directory (-indicates a common file; C indicates a character file; B Indicates a block device file; L indicates a connection file)

Red background indicates the file owner attribute R: Read (readable); W: Write (writable); X: Execute (executable)

The green background indicates the attributes of users in the same group as the file owner.

The blue background indicates the attributes of other users.

You can use chmod to modify attributes.

I commonly used # chmod *** filename (*** represents three numbers respectively representing the properties R-4, W-2, x-1 of the three objects ;)

For example, chmod 751 Hello --- changes the attribute of the hello file to the attribute of the file owner rwx to the same group of users R-X to other users -- X.

CP: copy a file or directory

Common usage: # cp-r path1 path2 copies the relevant files in the path1 path to path2

MV: Move a file (directory) or modify a file name

Common usage: # mv path1 path2 cut the files in the path1 path to path2

# Mv filename1 rmfilename2 rename the file named filename1 to filename2

RM: delete a file or folder

Common usage # rm-RF path deletes the files used in Path

DIFF: Compare file differences

General Usage # diff file1 file2: if the two files are the same, no information is displayed. If the two files are the same, the corresponding prompt is displayed.

Mkdir: create a directory

General Usage # mkdir dirname

Touch: create a file

General Usage # Touch filename

2. Common disk management commands

CD: Switch the directory (needless to say)

DF: commonly used to view the file system status # DF-a to view the disk usage

PWD: displays the current directory directly # PWD to see the directory path

Ls: displays the file list in the current directory

Common usage: # ls // The most basic usage

# Ls-l // display the file size usage attributes and other trust information

# Ls-A // all files in the top 10 directories, including shadow files starting.

The most common # ls-Al (the effect is not to mention the first two sets)

Mount & umonut: Mount & detach a disk

General Usage # Mount path/mnt/dirname: mount the files in path to the dirname directory of MNT as Dev files.

# Umount dirname or # umount path unmount

3. Common system management commands

Adduser or useradd: Add a user

PS: displays the current process

General Usage # ps-a to view all processes

# Ps-A | the grep process name can locate the corresponding process

Kill: Kill the process

General Usage # Kill process number (that is, the PID Number at the top of PS)

Halt: Shut down the system

General Usage # halt-P Shutdown

Su: switch to another user

Su-User Name

4. Common compression backup commands

Tar pressurization and decompression

# Tar-CVF file.tar path // compress the file under pathinto A file.tar File

# Tar-xvf file.tar // extract the file.tar file to the current directory

# Tar-zcvf file.tar.gz path // compress the file under pathinto A file.tar.gz File

# Tar-zxvf file.tar.gz // extract file.tar.gz to the current directory

-C path can be used to specify the decompressed directory.

Zip unzip: compress and decompress the file

# Zip file.zip File

# Unzip file.zip

5. Common device management commands

This section will be introduced in kernel and driver

There are mainly insmod rmmod lsmod mknod...

6. Common disk maintenance commands

I have never talked about it. Please refer to the relevant materials.

7. Common System Setting commands

Clear: Clear the screen # Clear

Clock: displays the current time

8. Common network communication commands

Ping: Test connectivity

[Root @ localhost Fuxi] # Ping 192.168.1.102

Ping 192.168.1.102 (192.168.1.102) 56 (84) bytes of data.

64 bytes from 192.168.1.102: icmp_seq = 1 TTL = 64 time = 1.10 MS

64 bytes from 192.168.1.102: icmp_seq = 2 TTL = 64 time = 0.289 MS

64 bytes from 192.168.1.102: icmp_seq = 3 TTL = 64 time = 0.195 MS

64 bytes from 192.168.1.102: icmp_seq = 4 TTL = 64 time = 0.200 MS

64 bytes from 192.168.1.102: icmp_seq = 5 TTL = 64 time = 0.181 MS

Ifconfig: view or configure network interfaces

Common usage # ifconfig // View

# Ifconfig eth0 192.168.1.108 // Configuration

Netstat; displays the network status

Usually use the # netstat-A | grep network application // view the network application used together

[Root @ localhost Fuxi] # netstat-A | grep TFTP // check whether TFTP is enabled

UDP 0 0 *: TFTP *:*

9. common text processing commands

Grep: Search for strings matching the conditions in the file for reference.

Other text processing commands have never been used.

You can use the command name -- help to view the usage of uncommon commands.

You can also use the man command name to view details)

But they are all in English ......

Now, the basic commands in Linux are described. The rest is that you can remember to query more information after you practice more.

For the first time I wrote such a professional things, it is inevitable that I will not be in place. Please advise.

Next, we will introduce the related Linux configuration TFTP. NFS ....

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.