Shell Script

Loop ls

for f in *; do 
  echo $f
done;

Rename

echo "abc123" || sed -e "s/abc/deg/g"

 

Git

for f in ItTechOffice*;
do
  n=$(echo $f | sed -e "s/ItTechOffice//g");
  echo $f " change to " $n;
  git mv $f $n;
done;
git commit -m "Rename Project Prefix"
git push

 

List Process

ps aux
ps aux | grep <Process Name>

 

Reference

 

 

廣告