Linux Command 2 and Linux Command 2

Source: Internet
Author: User

Linux Command 2 and Linux Command 2

In the process of viewing linux, File Attribute management is a difficult point. Therefore, as a beginner, I put it directly behind it for further research, therefore, I personally think it is an excellent opinion to learn some of the following knowledge points first and then go back and try to understand what you don't understand. By the way, I would like to add that for beginners, standing on the shoulders of the omnipotent god is the king of learning. If this involves user management, I think this is something I want to consider after learning linux well. "laruence's Private food" is indeed good, but I think it is too detailed in many places, it's easy for us to understand! So details are also its advantages! As for how to obtain the root, OK

Su root

Enter the password of the root user!

The last article mentioned 7, so take the last content:

8. cp: the target file of the cp source file is copied to the file.

9. The ls cd commands are the most commonly used commands in linux. The ls command displays the files in the directory cd to the directory.

10. touch [file name] creates an empty file.

11. Create an empty directory by mkdir [directory name]

When it comes to directories, we cannot talk about relative paths and absolute paths.

Absolute path: the path must be written in the root directory/

Relative Path: the path is not written /.

What are the absolute and relative paths?

The relative path is that you are already in this house. If you want to go to any room in this house, you just need to open that room in the current house, and the path is absolute, you are standing on the console of the hotel. To enter a room, you must first find the hotel and then find a specific room number under the hotel to find your room.

12. delete commands. I personally think that when I first came into contact with rmdir, I deleted empty directories and many delete commands, but I think we only need to remember the most awesome command first. rm-rf [anything you want to delete]

This command is forced to delete without notice. Beginners will remember this and I will delete it if I want nothing. You need to know that we are engaged in development. linux learners generally do not treat linux as their own computer operating system!

13. environment variables. Oh, my God, even if we are using windows, we have not actually changed the environment variables on our computer, of course, I did involve environment variable settings during the installation of Android software, but we should not have to worry about this issue too much. If you are interested in environment variables, check the echo $ PATH command in linux to find out why the ls command may be helpful.

14. view the command cat

Do you still remember the nano command? On the terminal, we can directly use the cat command to view the information, which is excellent.

15. The mv command is used to rename and transfer files. Let's look at the figure:

This Is renaming

This is to transfer the file to the directory test1

OK. I personally think these commands are enough for linux directory and file management. Other commands are not commonly used. For Beginners, it is enough to have these commands. Important commands should be learned in their own development process, in this way, we will constantly update what we have learned to become the ceo. We will welcome Bai fumei and embark on the peak of our life.

Sorry, I am a student, and I am just a little bit on linux. I am willing to share my linux path with you!


Common linux Commands include

Common linux commands (BASICS)

1. man provides help explanations for familiar or unfamiliar commands

For example: man ls, you can view the ls-related usage.

Note: Press q or ctrl + c to exit. in linux, you can use ctrl + c to terminate the current program.
2. ls view the directory or file owner * and list the files under any directory

Eg: ls/usr/man

Ls-l

A. d indicates directory. If it is a "-", it indicates a file. If it is l, it indicates a connection file (link)

B. Permission for file or directory permission. Read (r), write (w), and run (x) respectively ).

3. Copy files using cp

Eg: cp filename1 filename2 // copy filename1 to filename2

Cp 1.c netseek/2.c // copy 1.c to the netseek directory and name it 2.c.

4. rm delete files and directories

Eg: rm 1.c // Delete the. c file.

5. Remove the directory or change the file name.

Eg: mv filename1 filename2 // rename filename1 to filename2

Mv qib. tgz ../qib. tgz // move to the upper-level directory

6. Change the current directory pwd on cd to view the complete path of the current directory

Eg: pwd // view the current directory path

Cd netseek // enter the netseek directory

Cd // exit the current directory

7. cat, more command

Displays the content of a file. The two commands are different: cat prints the file content all the time, and more is displayed on the split screen.

For example; cat> 1.c // You can paste the code into the. c file and press ctrl + d to save the code.

Cat 1.c or more 1.c // you can view the content in it.

Gcc-o 1 1.c // compile 1.c into the. exe file. We can compile the Code with this command.

8. Modify the chmod command permission usage: chmod one-digit octal number filename.

Eg: chmod u + x filenmame // you only want to run the command for yourself.

// U indicates the file owner. g indicates the group of the file. O indicates others; r table readable; w table writable; x table can run

Chmod g + x filename // the same group of people to execute

9. clear, date command

Clear: clear screen, equivalent to cls in DOS; date: displays the current time.

10. mount a hardware device

Usage: mount [parameter] device load point to be loaded

Eg: mount/dev/cdrom

Cd/mnt/cdrom // enter the cd directory

11. su switches to another person's identity without logging out.

Usage: su-l user name (if the user name defaults, the user name is switched to the root state)

Eg: su-l netseek (switch to the netseek user and the user will be prompted to enter the password)

12. whoami, whereis, which, id

// Whoami: confirm your identity

// Whereis: queries the directory where the command is located and the directory where the help document is located

// Which: query the directory where the command is located (similar to whereis)

... The remaining full text>

Linux L command Question 2

-Aux is a ps parameter. It shows all processes that contain other users. For more information, see man ps or go to the following URL.
Fanqiang.chinaunix.net/a1/b1/20010379/142437.html

Grep is a text filtering tool. For more information, see man grep or go to the following URL.
Bbs.chinaunix.net/viewthread.php? Tid = 446683

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.