This article goes over a list of commands that can be useful in the Ubuntu environment. You may want to bookmark it and use it as a reference.
Use grep: grep -i -n "<SEARCH_KEYWORDS>" *
Example: grep -i -n "burger" *
If you want to search all files recurisvely, then add the -r argument.
For example: grep -r -i -n "burger" *
Normally, you can use "find -name <SEARCH_KEYWORDS>" but it only returns certain subset of results that match the search keywords.
Instead, you want to pipe the results to grep.
For example: find . | grep <SEARCH_KEYWORDS>
This command is recursive, since find is functionally recursive.
Many users have been tricked by the sudo command for piping commands into restricted files, files that need higher prviledges such as the following command.
sudo dmesg > <restricted_file_path>
Instead, you need the command "sudo tee", which you can pipe results into. Use it like the following.
dmesg | sudo tee <restritected_file_path>
A common use case is to pipe mulitple schema files into a database such as MYSQL.
For example, mysql_table.sql, mysql_keys.sql, and mysql_data.sql into the database.
For this purpose, you can use the command "cat <file1> ... <filen>".
Example: cat mysql_table.sql mysql_keys.sql mysql_data.sql | mysql -u root -p database
Just use the command "export", it is as simple as that
R4ujwE Very neat article. Really Great.
Really appreciate you sharing this article.Much thanks again. Keep writing.
Really informative post.Thanks Again. Really Great.
Thanks for sharing, this is a fantastic blog.Really looking forward to read more.
Very neat blog post. Really Cool.