What is the difference between echo and/dev/null in command for clearing file content?
We know that there are many methods to clear the file content. This article only talks about the differences between echo "And/dev/null.
1. What is the black hole device/dev/null?
In Linux, the null device is basically used to discard output streams that are no longer needed
Using/dev/zero to create a virtual hard disk/dev/zero is a special device in Linux, each time you read it, It outputs a byte (all of them are "0" in the editor). Now we can create a 10 m data file, then run the file command to view [root @ xx ~]. # Dd if =/dev/zero of = hd. img bs = 1 k count = 10000 [root @ xx ~] # File hd. img the file command hd. img is a data
Webpack-dev-server Remote Access configuration method,
The webpack-dev-server configured in the package. json file below is the Development Mode. You can use http: // localhost: 8080 or http: // 127.0.0.1: 8080 for access.
"Scripts": {"dev": "cross-env NODE_ENV = development webpack-dev-server -- open -- hot", "build
Review above:In the above section, we mainly introduce how to create a custom project in Dev. The structure of the package is briefly introduced later. Next I will complete the preparation of the package.
Chapter 2 Dev-CPP package preparation
First, let's take a look at the dev-CPP package. The Dev-CPP package has
Recently, the company has never been able to do anything, so it began to visit the forum to pay attention to some things. I accidentally saw the information about the android game engine, so I started to learn OpenGL with a whim. I personally think this should be a foundation for learning the game engine. Recently I was reading the C programming language, so I plan to start learning OpenGL from the C language.
Maybe Java has been doing for a long time, especially do not like Microsoft's develop
I have introduced some examples of Python and C ++ interoperability.
Series of articles:
Python calls C/C ++ functions (1)
Python calls C ++ (2) encapsulated by boost Python)
C ++ calls Python (3)
C ++ calls Python (4)
C ++ and Python advanced application interoperability (5)
C ++ calls the pythonapi thread status and global interpretation lock (6)
It is very prone to problems, such as Unicode problems and importerror problems. So let's introduce the installation and configuration.
1. Install P
System CentOS 7
Df-h view current partition usage;
Dfisk/dev/xvda operation of the/DEV/XVDA disk (new partition and formatting)
N
P
Enter the default partition number;
Enter the default disk creation start location;
Enter the default disk creation end location;
T set the partition type
8e LVM Type
W Save
Restart
LVM into LVM Management
Lvm>pvcreate/
command:$WC-L You can also use here Document in a script, for example:
#!/bin/bash
Cat
A simple lookup program
For good (and bad) restaurants
In Cape town.
Eof
Operation Result:This was a simple lookup programfor good (and bad) Restaurantsin Cape town.The following script saves the document to the Test.txt file through the VI editor:
#!/bin/sh
FileName=test.txt
VI $filename
I
This file is created automatically from
A
Using shell commands under Linux often uses shell output redirection like this:
1>/dev/null 2>1
At the end of the shell command, we can redirect the output through the > symbol.
1. Standard input stdin file descriptor is 0, standard output stdout file descriptor is 1, standard error stderr file descriptor is 2
2./dev/null empty equipment files, equivalent to garbage cans
3. REDIRECT Symbol:>
Explain
Shell may often see: Echo log>/dev/null 2> 1
Command results can be defined in the form of %>/Dev/null: Indicates an empty device file.>: Indicates the redirection location, for example, Echo "123">/home/123.txt1: Indicates stdout standard output. The default value is 1. Therefore, ">/dev/null" is equivalent to "1>/dev
I. Software Installation
I am using Dev-C ++, mainly using its GCC and G ++, notepad ++ 5.6.6
2. Set Dev-C ++ Environment Variables
1. Set the path of the compiler and add D:/dev-CPP/bin to the path of the Windows environment variable. Do not forget to add a semicolon before and remove it from others.2. Set the path of the C Language header file and add c_inclu
To configure in Webpack.config.js:Const PATH = require ("path");Module.exports = { entyr:{ .... Set the portal file }, output:{ .... Set export File }, module:{ .... Configure loader, note using rules instead of loaders }, plugins:[... . Note is the array ], devserver:{ //We are here to configure Webpack-dev-server } }The configuration object properties commonly used in Dev
First. NFS Service configuration1. Set up the board IP, the same network segment2. Development Board Operation: Ifconfig eth0 192.168.1.203. Test if you can ping the pass: Ping 192.168.1.194. Test whether the board IP is occupied:On the host: sudo ifconfig eth0 down to see if the IP on the Development Board is disconnected.Restart Network:/etc/init.d/networking force-reload/etc/init.d/networking restartMount 192.168.1.19:/opt/target/mnt-o NolockLs/mntUbuntu
Label:1. Create a folder resource and forms to store the PLL and forms (mainly used in APSTAND.FMB, APPSTAND.FMB, template.fmb) files;2. Modify the Registration FormHkey_local_machine/software/oracleValue Name: Nls_langValue: American_america. UTF8Hkey_local_machine/software/oracleValue Name: Forms_pathValue: modified to the above two folder path (note that only the last layer of the folder path can be loaded)Hkey_local_machine/software/oracle\home0Value name: Tns_admin (new string value)Value:
Elevation of permission for devices read/dev by Android applications (2)In privilege escalation for devices in/dev for Android applications (1), two methods of privilege escalation are briefly summarized:
Device_initAnd
Init. RC. In this article, I will summarize in detail that it is easy to confuse people without being careful.
Init. c,
Device_initAnd
Init. RCHow do they work.
Directory structure ls: Syst
[From] http://www.ixdba.net/a/ OS /linux/2010/0422/35.html
Shell may often see:>/dev/null 2> 1
Command results can be defined in the form of %>
Break down this combination: ">/dev/null 2> 1" is five parts.
1:> indicates the redirection location, for example, echo "123">/home/123.txt2:/dev/null indicates that the device file is empty.> Indicates stderr standard
In linux, the/dev/shm system loads/dev/shm by default. it is called tmpfs. some people say it is different from ramdisk (virtual disk. Like a virtual disk, tmpfs can use your RAM, but it can also use your swap partition for storage. And traditional virtual magnetic...
In linux, the/dev/shm system loads/dev/shm by defa
Break down this combination: ">/dev/null 2>1" is part five.(1 for standard output, 2 for standard error output, 2>1 to redirect standard error output to standard output)Where does the 1:> delegate redirect to, for example: echo "123" >/home/123.txt2:/dev/null represents an empty device file3:2> indicates stderr standard error4: means equal to, 2>1, 2 output redirect equals 15:1 means stdout standard output,
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.