User Tools

Site Tools


shell_tips

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
shell_tips [2010/06/11 12:18] – created 172.26.14.218shell_tips [2018/04/30 10:08] (current) – Meh, remove this old crap. aorth
Line 1: Line 1:
-====== Shell tips and tricks ====== 
  
-  * [[shell_tips#gnu_screen|GNU Screen]] - a terminal multiplexer 
-  * [[shell_tips#modules|Environment modules]] - dynamically load support for different software packages using ''modules'' 
- 
-===== Searching for a string in multiple files ===== 
-Ever need to search through all your files for a certain word or phrase? You probably know about the grep command, but did you know it's recursive?  
- 
-Here's an example. In this case we're searching for the word "modules": 
- 
-<code>grep -r "modules" .</code> 
- 
-By using the "-r" switch, we're telling grep to scan files in the current directory and all sub-directories. It will return a list of files the string was found in, and a copy of the line it was found on. 
- 
-If you'd rather just get the file names and skip the rest of the output, use the "-l" switch, like so: 
- 
-<code>grep -lr "modules" .</code> 
- 
-Here's another tip: grep also supports regular expressions, so matching against a wildcard pattern is easy: 
- 
-<code>grep -lr "mod.*" .</code> 
- 
-That command will print a list of files containing any word starting with "mod". 
- 
-You can also use grep to search for multiple words: 
- 
-<code>grep -r "drupal\|joomla\|wordpress" .</code> 
- 
-And, of course, grep supports file name wildcards in the standard unix fashion. In this example, grep will search only file names starting with "log": 
- 
-<code>grep -lr "mod.*" ./log*</code> 
- 
- 
-===Bluetooth=== 
-sudo apt-get install obextool gnome-vfs-obexftp blueman 
- 
-=== Statically linking executable === 
- 
-<code> ./configure LDFLAGS=-static </code> 
-<code> make LDFLAGS=-all-static </code> 
shell_tips.1276258711.txt.gz · Last modified: (external edit)