W e will discuss in detail about the Shell input/output redirections. Most Unix system commands take input from your terminal and send the resulting output back to your terminal. A command normally reads its input from the standard input, which happens to be your terminal by default. Similarly, a command normally writes its output to standard output, which is again your terminal by default. Output Redirection The output from a command normally intended for standard output can be easily diverted to a file instead. This capability is known as output redirection. If the notation > file is appended to any command that normally writes its output to standard output, the output of that command will be written to file instead of your terminal. Check the following who command which redirects the complete output of the command in the users file. $ who > users Notice that no output appears at the terminal. This is because the output has been redirected from the default standard o...
The find() Method To query data from MongoDB collection, you need to use MongoDB's find() method. Syntax The basic syntax of find() method is as follows − >db.COLLECTION_NAME.find() find() method will display all the documents in a non-structured way. Example Assume we have created a collection named mycol as − > use sampleDB switched to db sampleDB > db . createCollection ( "mycol" ) { "ok" : 1 } > And inserted 3 documents in it using the insert() method as shown below − > db . mycol . insert ([ { title : "MongoDB Overview" , description : "MongoDB is no SQL database" , by : "tutorials point" , url : "http://www.tutorialspoint.com" , tags : [ "mongodb" , "database" , "NoSQL" ], likes : 100 }, { title : "NoSQL Database" , description : "NoSQL database doesn't have tables" , by : "tutoria...
The hearth of each OS are its (apart from the Kernel of course) processes. Linux provides various ways to control the current running processes on the server and we will list a couple of examples to illustrate them. Probably the command you would most often use is the “ ps ” command which lists all processes based on a certain criteria. Please note that you can not manipulate the system processes (executing ps, kill, pgrep, top and strace) on the shared server, since your account will not have such privileges. However, on our dedicated servers you will have root permissions and you will be able to control the system processes. To list all processes which are started by your user, you can use: ps x where ps is naturally the command itself and x is the argument we are passing to it. The result will look like the following one: PID TTY STAT TIME COMMAND 3735 pts/0 R 0:00 bash 3775 pts/0 R+ 0:00 ps x 5032 ? Ss 1:01 wget -mbr --no-passive-ftp…. There are 5 columns in the re...
Comments
Post a Comment