Difference between revisions of "Linux"
From ACL@NCU
(→tcsh) |
(→tcsh) |
||
Line 9: | Line 9: | ||
</pre> | </pre> | ||
find files with a suffix recursively under subdirectories | *find files with a suffix recursively under subdirectories | ||
<pre> | <pre> | ||
find . -name \*.mgz -print | find . -name \*.mgz -print | ||
</pre> | </pre> | ||
delete or copy filenames from a "pattern" search | *delete or copy filenames from a "pattern" search | ||
<pre> | <pre> | ||
rm `find */*/*anat+tlrc.*` | rm `find */*/*anat+tlrc.*` | ||
</pre> | </pre> | ||
comment multiple lines | *comment multiple lines | ||
<pre> | <pre> | ||
:<<LABEL | :<<LABEL | ||
Line 29: | Line 29: | ||
LABEL | LABEL | ||
</pre> | </pre> | ||
* Extract a substring [http://www.starlink.rl.ac.uk/docs/sc4.htx/node38.html] | |||
Translation between bash and tcsh [http://joelinoff.com/blog/?page_id=235] | Translation between bash and tcsh [http://joelinoff.com/blog/?page_id=235] |
Revision as of 01:15, 5 May 2013
Useful tcsh and python commands
tcsh
- Find files
with defined stem pattern under multiple different folder
find */*/*anat+tlrc.*
- find files with a suffix recursively under subdirectories
find . -name \*.mgz -print
- delete or copy filenames from a "pattern" search
rm `find */*/*anat+tlrc.*`
- comment multiple lines
:<<LABEL comment line #1 comment line #2 comment line #3 ... comment line #final LABEL
- Extract a substring [1]
Translation between bash and tcsh [2]
file system
- Determine file creating and modification times [3]
stat *
Network Connection
- Blocking a port [4]
sudo ufw deny 80
other ufw usage [5]
- Scanning available ports
nmap -PS <IP address>
- Scanning all available IPs in subnet
nmap -sP 192.168.1.0/24
- restart network GUI (allow the top-left icon of network to show up)
sudo service network-manager restart
Install new packages
- pip [6]
sudo apt-get install python-pip python-dev build-essential sudo pip install --upgrade pip sudo pip install --upgrade virtualenv