Here’s how to put the result of several commands to a variable. This is quite useful.
> echo $(ls|sort|uniq|wc)
14 14 342
Posted by hide1713 on April 19, 2009
Here’s how to put the result of several commands to a variable. This is quite useful.
> echo $(ls|sort|uniq|wc)
14 14 342
Posted in shell | Leave a Comment »
Posted by hide1713 on November 26, 2008
Tar could be one of most powerful and complex command which we need to use every day. Here some tips for tar
Find file and put them in to tar:
find ./ -name “*.jpg” | tar -cvf yourtar.tar -T -
or
tar -cvf yourtar.tarĀ `find *.c -print`
Posted in shell | Tagged: tips | Leave a Comment »
Posted by hide1713 on November 26, 2008
There is a way to embeded a command inside another command by using ` key. This key is on the left of 1 key
Example
tar -cvf aa.tar `find *.c -print`
This command finds all the *.c file and send it to aa.tar
Posted in shell | Tagged: tips | Leave a Comment »
Posted by hide1713 on November 14, 2008
Chmod recursively in directory
remove execute from files under aa directory. This is useful when you copy files from fat or ntfs.
find aa/ -type f -exec chmod -x {} \;
Posted in shell | Tagged: shell, tips | Leave a Comment »