How to show the TXT record of a domain?
Answer:
To show the TXT record of a domain, use the dig command like:
# dig TXT google.com
That's it.
Linux Ask! is a Q & A web site specific for Linux related questions. Questions are collected, answered and audited by experienced Linux users.
How to show the TXT record of a domain?
Answer:
To show the TXT record of a domain, use the dig command like:
# dig TXT google.com
That's it.
Drop a collection in MongoDB
Answer:
To drop a collection in MongoDB, enter the interactive shell, and type:
db.foo.drop()
If you want to remove all the objects only, not dropping the collection, try
db.foo.remove()
Insert a new document to MongoDB
Answer:
To insert a new document to MongoDB, try the following statement in the shell,
# db.test.save({ "foo" : "bar"});
So you have saved a key-value pair in the test document.
Remove the last word when typing a command in Bash
Answer:
When you are typing a command in Bash shell, , to quickly remove the last typed word, press "Ctrl + w"
This trick is very handy and should be known by all Bash users.
How to rename a user in Linux?
Answer:
Firstly, you need to have a account with root privileges (You cannot change the account name if you have this user currently logged in)
To rename a user, do the following steps:
1. Rename user
# sudo usermod -l new_user -d /home/new_user -m old_user
2. Update group (Usually the same as user name)
# sudo groupmod -n new_user old_user
That's all.