Tag Info

Hot answers tagged

2

This one handles filenames with whitespace or apostrophes, and works on systems which do not support xargs -d or sort -h: du -s * | sort -n | cut -f2 | tr '\n' '\0' | xargs -0 -I {} du -sh "{}" which results in: 368K diskmanagementd 392K racoon 468K coreaudiod 472K securityd 660K sshd 3.6M php-fpm


2

Use a program such as Screen. Start a screen with Screen -S "name", resume it with screen -x


1

You can use nohup in conjunction with & like this: nohup ./m_script.sh & The magic of nohup is that it allows a process to run even if your connection to the machine is gone. Meaning you logged out or are even disconnected. The & at the end means the process should run as a background process. So when you enter that command the combo of ...


1

You can do this with Perl regular expressions: $ echo 'GOOD_STRING1 > GOOD_STRING1BAD_STRING' | grep -P '(GOOD_STRING1|GOOD_STRING2)(?!BAD_STRING)' GOOD_STRING1


1

It's possible to create a simple shell function which works as it is reading from stdin (although in fact it is writing to a temporary file then reading that). Here's the code I'm using: # An emacs 'alias' with the ability to read from stdin function e { # If the argument is - then write stdin to a tempfile and open the # tempfile. if [[ $# -ge ...



Only top voted, non community-wiki answers of a minimum length are eligible