COMMANDS
Environment Control
cd d Change to directory d
mkdir d Create new directory d
rmdir d Remove directory d
mv f1 [f2...] d Move file f to directory d
mv d1 d2 Rename directory d1 as d2
passwd Change password
alias name1 name2 Create command alias
unalias name1 Remove command alias name1
rlogin nd Login to remote node
logout End terminal session
setenv name v Set env var to value v
unsetenv name1 name2...] remove environment variable
Environment Status
Output, Communication, & Help
Process Conotrol
file type of file file *
jobs in current shell jobs
kill stop process kill 23098 kill -9 23098
nice process priority nice ./a.out
ps list processes ps -ef | sort | more
which command filename which netscape
File Manipulation
Compiler
cc c++ gcc g++ C and C++ compilers cc -o myprogram progA.c
f77 f90 f95 Fortran compilers f90 -o myprogram progA.f90
diff line-by-line difference diff file1.txt file2.txt
strings text embedded in binary strings a.out
tar archiving files tar cf myarchive.tar file1 file2 dir3 dir4
gzip compress file gzip myarchive.tar
gunzip uncompress file gunzip myarchive.tar.gz
Other Utilities:
man manual page man ls man -k editor
cal calendar cal cal 12 2005
date current date/time date
du total size of directory du -k | sort -n
echo print to screen echo "This is great stuff."
look suggest words look stri
File/directory commands: sample usage
cd change directory cd bin cd ~/2350/hw cd
chgrp change group ownership chgrp appm2350 index.html
chmod change permissions chmod 664 myfile.html
cp copy file(s) cp thisfile newfile cp file* subdir/
ls list files ls -l ls -alrt *.html
mkdir make new directory mkdir 2005fall
mv move/rename file(s) mv a.out ProgramE mv file* subdir/
pwd present working directory pwd
rm remove/delete file(s) rm -i *.aux rm -rf subdir/
rmdir delete
Editing, Email, Documentation: sample usage
emacs text editor emacs mythesis.tex
vi text editor vi mythesis.tex
nedit text editor nedit mythesis.tex
pico text editor pico mythesis.tex
pine email pine
mailx email mailx mailx smith@hotmail.com
latex compiles DVI document latex mythesis.tex
pdflatex compiles PDF document pdflatex mythesis.tex
Remote login and file copying: sample usage
scp copy between computers scp myfile amath.colorado.edu:subdir/file8
sftp copy between computers sftp
ssh log onto remote computer ssh amath.colorado.edu -l username
Text filters: sample usage
cat display text contents cat file1.txt file2.txt file3.txt
grep find word/string grep keyword file1 file2 file3
head display first few lines head -5 file.txt
more display 20 lines at a time more file.txt
sort re-order text lines sort -r -n file.txt
spell find misspelled words spell file.txt
tail display last few lines tail -5 file.txt
wc word count wc file.txt cat *.tex | wc
Miscellaneous
x
- for i in `find ./ -name pom.xml`;do echo "Checking: $i"; diff ../../TRUNK-CQ-JOB1/content-parent/$i $i; echo **done**; done;
for file in `find TST*JAVA* -type f ! -iname "*svn*" -exec fgrep -l B2CCommerce '{}' +`; do echo $file; diff $file ../TRUNK-HARDROCKJAVA-BUILD/$file; done;
find TST16-HARDROCKJAVA-JOB1/ -type f ! \( -iname "*svn*" -or -iname "*local*" \) -exec fgrep -l B2CCommerce '{}' + | egrep -o /.*
find TST16-HARDROCKJAVA-JOB1/ -type f ! \( -iname "*svn*" -or -iname "*local*" \) -exec fgrep -l B2CCommerce '{}' + | xargs egrep -o /.*
for file in `find . -iname "*.MF" ! -iname "*svn*" ! -iname "*local*" -exec fgrep -l B2CCommerce '{}' +`; do echo "++ Parsing: $file"; diff $file ../TRUNK-HARDROCKJAVA-BUILD/$file; done;
for server in `ctllist @ | cut -d, -f 1 | sort | uniq`; do host $server | head -1 | egrep -oh "^[^ ]"
bash `for server in `ctllist @ | cut -d, -f 1 | sort | uniq`; do host $server | head -1 | egrep -oh "^[^ ]+"; done;` | sort | uniq
Find commands
- find . -name \* -print | xargs grep tst14
- find . -name \* -print | xargs grep -i tst14
- find . -type f -exec 'grep B2CCommerce' {};
- find . -type f -exec 'grep B2CCommerce {}';
- find . -type -f | xargs fgrep B2CCommerce
- find . -type f | xargs fgrep B2CCommerce
- find . -type f | xargs fgrep B2CCommerce -c
- find . -type f | xargs fgrep B2CCommerce -c | grep -v ":0$"
- find . -type f -exec grep -l B2CCommerce '{}' +
- find . -type f -exec grep -l B2CCommerce '{}' +
- find . -type f \( ! -iname "*svn*" \) -exec fgrep -l B2CCommerce '{}' +
- find . -type f ! -iname "*svn*" -exec fgrep -l B2CCommerce '{}' + | diff $1 ../TRUNK-HARDROCKJAVA-BUILD/$1
- find . ! -iname "*svn*" ! -iname "*local*" -exec fgrep -l B2CCommerce '{}' +
- same above command in other way as below
- for file in `find . ! -iname "*svn*" ! -iname "*local*" -exec fgrep -l B2CCommerce '{}' +`; do echo "Processing: $file"; diff $file ../TRUNK-HARDROCKJAVA-BUILD/$file; done;
3) rsync -dev atg@b2cfst7://sites/lwe/conf/master.conf .
Grep commands
grep python-cu *
set -o vi
grep python-cu *
Cat commands
- cat /tmp/myfile.out | ~/cq_packages/bin/python-cust -mjson.tool
- cat /tmp/myfile.out | ~/cq_packages/bin/python-cust -mjson.tool | sed -n -e '/"path":/s/^.*"\(.*\)".*/\1/p'`
- cat /tmp/myfile.out | ~/cq_packages/bin/python-cust -mjson.tool | sed -n -e '/"path":/s/^.*"\(.*\)".*/\1/p'
- cat /tmp/myfile.out | ~/cq_packages/bin/python-cust -mjson.tool | sed -n -e '/"path":/s/^.*"\(.*\)".*/\1/p' > /tmp/sorted.out
- cat /tmp/sorted.out | wc -l
Export
export PS1="[\[\e[1;34m\]\u\[\e[0m\]@\[\e[1;32m\]\H\[\e[0;1m\] \[\e[1;35m\]\W\[\e[0m\]]\$ ";
export PS1="[\[\e[1;34m\]\u\[\e[0m\]@\[\e[1;32m\]\H\[\e[0;1m\] \[\e[1;35m\]\W\[\e[0m\]]\$ ";
- svn pe svn:externals .
- svn commit
- svn add ONLINE/GLOBAL/config/atg
- svn up
- svn co svn://cmserv01.edc.cingular.net/cm/websvn/SERVICES/SEARCH/branches/project_globalnav_accessibility_br/lucid
- svn info
- svn co svn://cmserv01.edc.cingular.net/cm/websvn/SERVICES/SEARCH/branches/project_globalnav_accessibility_br/lucid/conf
- svn commit master.conf -m " updating the master.conf with the right ports for restart to work - ax1629" .
- svn commit build.xml -m " updating the build xml for external services - ax1629"
- svn propget svn:externals .
No comments:
Post a Comment