Wanted to do a quick “du -sh” on only the directories in / (‘root’) and NOT any of the mounted partitions. This one liner worked nicely: cd / ls -la / | awk ‘{ print $9 }’ | egrep -v ‘boot|part1|var|\.’ | xargs du -sh
Entries Tagged as 'One Liners'
Show disk usage excluding some directory structures
December 14th, 2011 · Comments Off
Tags: Coding · Linux · One Liners · Operating System
Default a port on old Cisco 3548
June 20th, 2010 · No Comments
I wanted to default the configuration of a number of ports on an old Cisco 3548. The latest version of IOS support on this system does not support the range command, so, had to manually run a small script (bash 1 liner on linux) and paste in the contents: $ for i in `seq 40 [...]
Tags: Cisco · Coding · Networking · One Liners · Uncategorized
Remove ^M’s from a file or more
January 26th, 2009 · No Comments
How to remove ^M from within a file: perl -pi -e ‘y/\015//d’filename
Tags: Coding · One Liners · Operating System