Network

Search

find

Remove all Subversion-Content

find . -name .svn -exec rm -rf {} \;

Replace the String bst with fwe in all files of the name Root (recursively)

find . -name Root | xargs perl -pi -e 's/bst/fwe/';

Delete old access log files

find /tomcat/logs/ -name "*access*" -mtime +40 -exec rm {} \;

grep

Observe all lines in Access-Log besides the ones containing the word BigIP or pullData

tail -f xxx_access_log.2009-03-18.txt | grep -v "BigIP\|pullData"

Compare local file with file from foreign host

ssh user@host cat /path/to/remotefile | diff /path/to/localfile -

File processing

cut

Extract second column from file using the whitespace as delimiter

grep ERROR xxx_servlet_log | cut -d " " -f 2

Working with the shell

history

Show the last executed commands (the size of the history can be configured through $HISTFILESIZE)

history

Execute the last command

!!

Execute the command with the number n

!n

Execute the last command beginning with text

!text

Environment

id

Displays information about your identity. If you are interested to see all users of
a system, use cat /etc/passwd. There is a distinction between system user,
which do not have a shell (/bin/false in /etc/passwd) and standard users which do have
a shell (/bin/bash for example). Interessant information about user permissions in linux
can be found here: http://de.wikibooks.org/wiki/Linux-Kompendium:_Benutzer-_und_Berechtigungskonzepte

cat /proc/cpuinfo

Displays infos about the processors.

Subversion

svn propset

svn propset svn:ignore "WEB-INF" web-app/

Ignores the WEB-INF directory

 
wettstein/linuxcommands.txt · Last modified: 2009-11-03 23:11 by frank.wettstein
 
Recent changes RSS feed Creative Commons License Powered by GNU/Linux Powered by Gentoo Powered by Apache Powered by XCache Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki