Skip to content

Instantly share code, notes, and snippets.

@sorquan
sorquan / linux_general.md
Last active September 16, 2021 21:34
Some general commands for GNU/Linux

Format output with delimiter

ls /var/ | xargs | sed 's/ /,/g'

Add text to end of file if it not exists in the file

sed -e '/option=/{s/.*/option=value/;:a;n;:ba;q}' -e 'aoption=value' /dir/filename

Count inodes

@sorquan
sorquan / aix_general.md
Last active March 1, 2021 10:53
Some general commands for AIX

Show top 10 largest directories

du -sg | sort -r | tail -n10