sed '/^\s*$/d' a.txt # delete ALL blank lines
sed '/./,$!d' a.txt # delete all leading blank lines at top of file
sed '=' a.txt | sed 'N;s/\n/\t/' # cat -n a.txt
sed '/./=' a.txt | sed '/./N; s/\n/\t/' # number each not blank line of file
sed '1!G;h;$!d' a.txt # reverse order of lines
sed '/./,$!d' a.txt # delete all leading blank lines at top of file
sed '$!N; /^\(.*\)\n\1$/!P; D' a.txt # delete duplicate, consecutive lines
gawk '$1~/[0-9].*/{total += $2} END{print total}' a.txt
gawk 'BEGIN {"cat c.txt | wc -l"|getline n} n>10 {print}' a.txt
ls | gawk -F. '{system("mv " $0 " " sprintf("%03d", $1) "." $2)}
分享到:
相关推荐
- **Keyboard Shortcuts**: Enhances productivity by enabling quick access to frequently used commands. - **Multitouch Screen Usage**: Supports touch gestures for navigating and manipulating designs, ...
- **Aliases**: Aliases can be defined to simplify frequently used commands. For example, `git config --global alias.co checkout` sets `co` as an alias for `checkout`. - **Editor Settings**: Git uses ...
UltraEdit includes a Search and Replace Favorites feature that allows you to manage frequently used Find and Replace strings. Create, name, and edit your Search and Replace Favorites... Customizing ...
Describe the different types of indexes and how indexes can be used to improve performance. Describe what statistics are used for and how they can help in optimizing query performance. ...
Acknowledgments: Over the years, several students and colleagues have helped us prepare this solutions manual. Special thanks goes to HongGang Zhang, Rakesh Kumar, Prithula Dhungel, and Vijay ...