Linux Common commands

Source: Internet
Author: User
Tags echo display touch command

CP command: CP filename1 filename2cp-r directory1 directory2cp-rv directory1 Directory2 (can show progress)  MV command mv filename1 filename 2 (if the command renames the file in the same directory)  MV filename directory/ mv filename directory/filename2 (The command will move the file filename to the directory folder and rename it to filename2)  RM command rm filename (delete file) rm-r directory (delete folder) Rm-ri Directory (interactive command that will ask you if you want to delete)  mkdir create an empty directory rmdir delete an empty directory (which can be replaced with the Rm-r directory command)  touch command can create a blank file, If you touch an existing file, the timestamp of the file is updated. Use the LS-A command to view all files, including hidden files. Ls-l Display Detailed information ls-r displays the subdirectory structure ls-ldfile filename can view the file information   date, time 1.data view current system date is formatted as: Data +%y-%m-%d (It doesn't feel interesting) Change time: Date-s "time: minutes: Seconds" (requires root) 2.cal View calendar 3.uptime View System uptime   Output, view command 1.echo display input echo "Hello World" >> myfile You can append the contents of the quotation marks to a text file  2.cat display the contents of the text 3.less myfile a page of text that can be displayed up and down (for text with more content) 4.head-n 3 shows only three lines at the beginning Tail-n 3 shows only three rows at the end tail-f can be View text content in real time (typically used to view log files)   View hardware information 1.lspic view pic Device Parameters-V to display details 2.LSUSB view USB Device parameter-V to display details 3.lsmod view loaded driver   Shutdown restart 1.shutdown-h Now shutdown 2.shutdown-r now restart 3.shutdown-h +Shut down after 100 minutes 4.shutdown-h 23:30 Specify time off  poweroff immediate shutdown reboot restart   Archive 1.TAR-CVF Outfile.tar myfile (can be a folder) (packaged) 2.tar -XVF Outfile.tar (unpacking) 3.tar-cvzf outfile.tar.gz myfile (packaged and compressed) 4.tar-xvzf outfile.tar.gz (uncompressed) 5. zip Outfile.zip Myfi can also be used Leunzip outfile.zipgzip outfile.gz   Find 1.locate keyword using the Locate command is based on an already established index, there are newly added files that have not been indexed, In the case of a condition that cannot be retrieved, the index 2.find+ location + Find parameter can now be updated by UpdateDB command find. -name *filenam* (in the current directory, look for the name ... files) Find/-perm 777 (Find a file with a permission of 777 under the root directory)  -user-group-ctime based on the modified Time-type-size vim command précis-writers Command mode I insert text before the cursor O Insert DD on the next line of the current row to delete the current row u undo last action yy copy current line 3yy copy cursor row three line contents p paste copied content R Replace current character/find keyword  ex mode: w Save current change: Q exit: q! Force exit (Do not save modification): X or: Wq Save and exit: Set Nu set line number: SH switch to terminal command, Ctrl + D back to vim   File directory Description: Bin: Common executable command sbin: The command that only root can execute boot: Boot system boot file dev: Save the hardware abstraction files etc: the system configuration file. Confighome: A folder named after the user name, there are several folders that appear on the user's list. MNT: Mounted Directory opt: Generally save large-scale software, such as database software proc: Each process corresponds to a folder, real-time files (in-memory data) SYS: Some information on the underlying hardware TMP: temporary files, will automatically be deleted usr: Where to save the application Var: save some frequently changing information (such as log)   hard disk partition simple concept SDA  a refers to the first hard drive sda1 1 refers to the first partition SDB &NBSp;b refers to the second hard drive SDB1 1 refers to the first partition  MBR applied to the majority of PC devices using BIOS   

Linux Common commands

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.