In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Network Security >
Share
Shulou(Shulou.com)06/01 Report--
1. Input and output redirection
One of the important links in the structure of the computer is the Istroke O device, which is the input and output device, such as keyboard, display, terminal and so on. There are three different operating states in the Icano device, namely, standard input, standard output and error output. "" to redirect the output, take the previous content output as input to the latter option: cat file > mail-s "e-mail" username. The standard input is STDIN-0 as the default keyboard input, the standard output is STDOUT-1 as the default output to the terminal, the standard error is STDERR-2, and the error information is output to the terminal by default. Among them,-0-1-2 can be carried out before the input and output symbols, "for example, XXX (error message) > filename will output the error message directly on the terminal, but 2 > in this way, adding the standard error symbol before the output redirection symbol can redirect the error message to the specified folder." Another way is to output both the correct information and the wrong information to the specified folder: "for example, use ls / boot / ddd (directory that does not exist) > / testdir/a. You can use & > to successfully redirect two pieces of information to a file or directory, or you can use a format like 1 > 2 &, but it should be noted that this format is relatively old and must be at the end of the command, and 1 / 2 must correspond to the correct or wrong location of the previous file. (2) when using input and output redirection, if the input information exists and there is content in the redirected file, it will cause the file content to be overwritten by the later redirect output. In order to prevent the input content from being overwritten, set-C can be used to prevent the contents of the file from being overwritten. Set + C allows the file to be overwritten. The biggest effect of this command is to prevent it from being overwritten later when writing a script. This command is one-time and only valid for the current user.
The symbol "> >" overwrites the content of file when using output redirection, but it only injects information into the file and does not overwrite or empty the original information content in the file. For multiple command redirects, multiple commands are enclosed in parentheses, separated by semicolons: (pwd;ls) > / testdir/test.log is similar to this way you can see the path of the current directory and directory information in / testdir/test.log text.
Here are some extra tips:
two。 The essence of hard link is to give the same file multiple file names, the number of links is equal to the number of file names, each directory references the same inode number, hard link can not cross the partition or driver; soft link ln-s original file absolute path or relative path (is equivalent to the soft link file relative path), that is, equivalent to the shortcut, can cross the partition. A hard link is one file and a soft link is two files.
Rm deleted the name, not the contents of the file.
Instead of using file names within the Linux system, inode numbers are used to identify files. For the system, the file name is just an alias or nickname for the inode number to identify. On the surface, the user opens the file by the file name. In fact, the internal process of the system is divided into three steps: first, the system finds the inode number corresponding to the file name; secondly, it obtains the inode information through the inode number; finally, according to the inode information, it finds the block where the file data is located and reads the data.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.