Getting started with Linux

Source: Internet
Author: User
1. man helps explain familiar or unfamiliar commands. for example: manls, you can view 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 to view the directory or file owner * and list the files under any Directory. for example: ls/usr/man

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 the 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
Display 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 use this command to compile the code.


8. chmod command permission modification usage: chmod one-digit octal number filename
Eg: chmod u + x filenmame // you only want to run the command for yourself.
// The U table shows the file owner. g indicates the group in which the file is located. o indicates others. r table is readable, w table is writable, and 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 under DOS; date: display 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)
// Id: Print your UID and GID. (UID: Unique id of the user identity. GID: Unique id of the user group. each user can only have one unique UID and GID .)
Eg: whoami // Display your login user name
Whereis bin: The Directory where the bin is located. The directory is/usr/local/bin.
Which bin

13. grep, find grep: text content search; find: file or directory name and permission owner matching search
Eg: grep success */* find all files in the current directory that contain success characters

14. kill can kill a running or dest process.
Eg; ps ax

15. passwd can be used to set a password

16. commands used by the history User
Eg: history // displays the commands used by the user in the past.

17 .!! Execute The Last Command

18. mkdir command
Eg: mkdir netseek // create the netseek Directory

19. tar decompression command
Eg: tar-zxvf nmap-3.45.tgz // Extract this to the nmap-3.45 Directory

20. finger allows users to query data of other users
Eg: finger // view the user's usage information
Finger root // view the root information

 

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.