20 commands commonly used in linux system (suitable for novice practice)

  1. man provides help and explanation for commands you are familiar with or unfamiliar with
    eg:man ls can view ls related usage

Note: press q key or ctrl+c to exit, you can use ctrl+c under linux

Terminate the current program running.

  1. ls View the category * of a directory or file, and list the files under any directory
    eg: ls / usr / man ls -l

ad means directory, if it is a “-” means it is a file, if

If it is l, it means it is a link file (link)

b. Represents the permissions of files or directories. Readable (r), writable (w), and

Run (x).

  1. cp copy files
    eg: cp filename1 filename2 // copy filename1 into

filename2

cp 1.c netseek/2.c //Copy 1.c to the netseek directory and name it 2.c

  1. rm delete files and directories
    eg: rm 1.c //delete the file 1.c
  2. mv remove the directory or change the file name
    eg: mv filename1 filename2 // rename filename1

filename2

mv qib.tgz ../qib.tgz //Move to the upper directory

  1. cd to change the current directory pwd to view the full path of the current directory
    eg: pwd //View the current directory path

cd netseek //Enter the netseek directory

cd //Exit the current directory

  1. cat, more commands
    Display the contents of a file. The difference between the two commands is: cat puts the text

The content of the file is always printed, and more is displayed on a split screen

eg; cat>1.c //You can paste the code into the 1.c file, press ctrl+d

Save the code.

cat 1.c or more 1.c //You can view the content inside.

gcc -o 1 1.c //Compile 1.c into .exe file, we can use this command to edit

Translate the code.

  1. chmod command permission modification usage: chmod an octal number
    filename。

eg: chmod u+x filenmame //I just want to run for myself, others can only read

//u represents the owner of the file, and g represents the group where the file is located. o means other

People; r table can be read, w table can be written, x table can be run

chmod g+x filename //The same group of people to execute

  1. clear, date command
    clear: clear the screen, equivalent to cls under DOS; date: display the current time.
  2. Mount to load a hardware device
    Usage: mount [parameter] the mount point of the device to be loaded

eg: mount /dev/cdrom

cd /mnt/cdrom //Enter the CD directory

  1. su switch to another person’s identity without logging out
    Usage: su -l username (if the username is default, switch to root state)

eg:su -l netseek (switch to the netseek user, you will be prompted to enter

password)

12.whoami,whereis,which,id
//whoami: confirm your identity

//whereis: The directory where the query 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 out your UID and GID. (UID: unique identification of user identity.

GID: The unique identifier of the user group identity. Each user can only have one unique UID

And GID)

eg: whoami //Show your own login username

whereis bin displays the directory where bin is located, which will be displayed as:

/usr/local/bin

which bin

  1. grep,find
    grep: text content search; find: file or directory name and permission owner, etc.

Match search

eg: grep success * /*Find all files in the current directory

Files containing success characters

  1. kill can kill a process that is in progress or is already in dest state
    Procedure

eg; ps ax

  1. passwd can set password
  2. Commands used by history users
    eg: history //You can display the commands used by the user in the past
  3. !! Execute the most recent command
  4. mkdir command
    eg: mkdir netseek //Create netseek this directory
  5. tar decompression command
    eg: tar -zxvf nmap-3.45.tgz //decompress this to nmap-3.45

In this directory

  1. Finger allows users to query some other users’ data
    eg: finger //View the usage data of the user used

finger root //View root’s information

ftp upload and download ftp192.168.1.100

User: xiangf Pwd xiangf

Putmput upload multiple Get mget download multiple
————————————————
版权声明:本文为CSDN博主「奈河桥」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/guxinaiheqiao/article/details/39337329

Leave a Reply

Your email address will not be published.

en_USEnglish