Common linux system commands

Source: Internet
Author: User

Common commands for linux system I. common commands for linux systems 1. command date is used to view and set the time of the current system: format the display time: date + % Y -- % m -- % d2. command hwclock (clock) is used to display the clock time of the hardware 3. command cal to view calendar 4. run the uptime command to view the system running time. output and view command 1. command echo is used to display the input content. 2. the command cat is used to display the file content, but for long files, the cat command can only be displayed on one page from start to end, very unfriendly. 3. command head is used to display the first few lines of the file (10 lines by default)-n specifies the number of lines displayed 4. the command tail is used to display the last few lines of the file (10 lines by default)-n specifies the number of lines to be displayed-f (fllow) tracks display file updates (generally used to view logs, the command will not exit, instead, the newly added content is continuously displayed.) 4. command more is used to display the file content (only page flip is allowed) 5. the command less is used to display content on pages (pages can be turned up or down) 3. shutdown and restart 1. run the shutdown command to shut down and restart the computer-h to shut down the computer-r and restart the computer. For example, shut down immediately: shutdown-h now10 minutes and then shut down: shutdown-h + 10 (a "+" plus a number indicates the number of minutes after shutdown) shutdown: shutdown-h immediate restart: shutdown-r now2. command poweroff to immediately shut down the computer 3. run the reboot command to immediately restart the computer. archive and compress 1. command zip to compress the file zip linuxcast.zip Myfile (zip + compressed file name + file to be compressed) 2. command unzip to decompress the zip file unzip linuxcast.zip 3. command gzip is used to compress the file gzip liangjin4. command tar is used to package the file tar-cvf package name. tar is used to package the file into the package (put a file into the package by category, this process does not compress the file) tar-xvf package name .tar unpacks the files in the package and releases them to the current directory tar-cvzf package name .tar.gz/etc (the folder to be archived and compressed is etc) the-z parameter compresses the archive file by gzip to reduce the size by 5. search 1. locate is used to quickly find files and folders. In fact, it is used to find files in the database. This Command requires a database to be created in advance. The database is updated every day by default. You can use the update command to manually create and update the database, the disadvantage is that it cannot be found if the new file is not updated to the database. Locate vim: Find the file with vim in the file name, and search for it in the entire computer. 2. the find command is used to search for files and folders in advanced mode. For example, find. -name * liangjin *: find all files whose names contain "liangjin" in the current directory. find/-name *. conf: Find the file name suffix in the root directory. conf file find/-perm 123 find all files on the hard disk with the permission of 123 (the number must be set at 123) find/-type d (search by file type) find all directories (d Indicates Directories. -name "a *"-exec ls-l {}\; searches for files whose names start with a and uses the search results as parameters, and passes the "ls-l" command, displays the details of all files starting with. "Ls-l" can also be replaced with other commands.

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.