Linux Shell Script Common Command Manual

  
 

man Helps you familiar or unfamiliar commands to explain eg:man ls You can view the usage of ls. Note: Press q or ctrl+c to exit. Under linux, you can use ctrl+c to terminate the current program. ls View the directory or file genus*, list the files under any directory
eg: ls /usr/manls -la.d indicates the directory (directory), if it is a "-" indicates that it is a file If it is l, it means a connection file (link) b. indicates file or directory permission. It can be read (r), writable (w), and run (x). cp copy file
eg: cp filename1 filename2 //copy filename1 to filename2cp 1.c netseek/2.c //copy 1.c to netseek directory and name it 2.crm delete Files and directories
eg: rm 1.c //Remove the 1.c file mv Remove the directory or change the file name
eg: mv filename1 filename2 //Rename filename1 to filename2mv qib.tgz ../qib.tgz //Move to the previous directory cd Change the current directory pwd View the current directory full path
eg: pwd //View the current directory path cd netseek //Enter netseek directory cd //Exit the current directory cat, more command to display the contents of a file. The difference between the two commands is: cat prints the contents of the file all the time, and more displays the 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 //can view the contents inside. gcc -o 1 1.c //Compile 1.c into an .exe file, we can use this to compile the code.
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 for the file owner and g for the file file group. o indicates other people; r table readable, w table writable, x table can run chmod g+x filename //people in the same group to execute clear, date command
clear: clear screen, quite similar to DOS The following cls; date: shows the current time. mount Load a hardware device
Usage: mount [parameter] The device load point to be loaded eg: mount /dev/cdromcd /mnt/cdrom //Enter the CD directory su without logging out Next, switch to another person's identity
Usage: su -l username (or switch to root if the username defaults) eg:su -l netseek (switch to netseek this user, will prompt for a password) whoami,whereis,which,id
//whoami: Confirm your identity //whereis: the directory where the query is located and the directory where the help documentation is located //where: query the directory where the command is located (similar to whereis) //id: Print out your own UID and GID. (UID: User identity unique identifier. GID: User group identity unique identifier. Each user can only have one unique UID and GID) eg: whoami //Show your own login username whereis bin shows the directory where the bin is located, Displayed as: /usr/local/binwhich bingrep, find
grep: text content search; find: file or directory name and permission owner search search eg: grep success * /* find all current directory The file containing the success character kill can kill a process that is in progress or already in the dest state
eg; ps axpasswd can set the password
history user used Command
eg: history //can display the commands used by the user in the past!! Execute the most recent command mkdir command
eg: mkdir netseek //Create the netseek directory tar decompression command
Eg: tar -zxvf nmap-3.45.tgz //Extract this into the nmap-3.45 directory. finger allows the user to query some other user's data
eg: finger //View the usage of the user Information

Copyright © Windows knowledge All Rights Reserved