|
Home >> Information
|
| SJScott News and Information
|
|
Written by Administrator
|
|
Monday, 08 May 2006 |
Here is a list of linux commands that help me out. Maybe they will get you going too.
Count files recursively
find . -not -type d | wc -l
Command line for loop
for i in `seq 6 15`; do echo "showing $i"; done
note: for bsd use the jot command
for i in `jot 10000 1 10000`; do echo $i; done
kill multiple processes
for i in `ps axw |grep postExports |cut -f1 -d '?' |tr -d ' '`; do kill -9 $i; done
Rename Multiple Files in linux
rename .src .c *
Find files over certain size in linux
This one seems to work better:
find / -size +200000k -ls
Find and Replace recursively in multiple files
find ./ -type f -exec sed -i 's/tofind/replacewith/' {} ;
Find and remove files/directory
Removes subversion directories
find . -name .svn* -exec sudo rm -Rf {} ;
rm argument list to long
find . -name '*.log' -print0 | xargs -n1000 -0 rm
Linux log out user by killing
skill -KILL -u auser
Rename multiple files with perl
for i in *.JPG; do mv "$i" "${i/.JPG}".jpg; done
Unsort unix file command
perl -wne 'printf "%016.0f%s", rand 2**53, $_' < /tmp/ips.txt | sort | cut -b17- > /tmp/ips.txt
|
|
Last Updated ( Tuesday, 14 July 2009 )
|
|
|
| |