Disclaimer: This article is a blogger original article, follow the CC 4.0 BY-SA copyright agreement, reproduced, please attach the original source link and this statement.
- Into the root directory:
- List all the contents of the specified directory:
- List all the contents of the specified directory and detailed information on the contents of the display:
- List all the contents of the specified directory and display hidden files:
- View history message documents:
- View the current working directory:
- Create a new file, empty file:
- Create a new directory, refers to the folder:
- Written content from the terminal to the specified file: finished after Ctrl + C to exit write
- Copy to copy the file or directory, use cp, if the file does not exist, the duplicate, if prompted to overwrite, and then copy
- To delete a file or directory, a directory can delete one or more files and directories:
- View types of files:
- Switch working directory specified:
- View the contents of the file: ; display number of each line, including blank lines, with -n: ; display number of each line, not including blank lines, with -b:
- To sort the contents of the file:
- Check the contents of the file header, the default number of lines -num look at the first 10 rows can be manually specified, you want to see:
- View file contents in the tail, just look after the default number of lines 10 lines, -num can manually specify needed to view:
- less: view the file, press enter to turn down one line, press the space bar a scroll down, press the down arrow key to turn up or down the line, and press the q exit, similar to man
- more: to view the file, the file contents when less time, and use exactly the same cat, the output content to the terminal; when the contents of the file more recommended to use more, by the spacebar and enter keys to control flip and turn the line
- The number of lines of a file, the file name and the number of bytes of information:
- View file details, access to file name, size, permissions, last access time and time Recent changes:
- Find data, you can find there:
- Value output terminal of the string or variable:
- Redirect>, the results will be redirected to a file, if the file exists, the contents of the file will be overwritten; if the file does not exist, create the file, and then redirect. As a result file will be directed to non-existent file d:
- >> output redirection, the results will be redirected to a file and display the contents stored in the terminal to the specified file, appended file contents. As the a.txt, b.txt, c d.txt redirected to a file:
- Linking files, the equivalent of shortcuts for Windows. [Link hard link can only regular files, directories can not link]: soft link: ln -s file link source file; soft link [do not take up disk space, delete the source files will fail soft link]: Hard link: ln source file link file
- Open a text editor for Linux:
- View the current time [date], to view the current calendar [cal], see ifconfig ip address connectivity [], [ping] detection network