bash
-
Check how much is used up by a specific user
You can use below command to check how much space is consumed by a specific user (‘testuser’ in this case). $ cd / $ find . -user testuser -type f -exec du -k {} ; | awk ‘{ s = s + $1 } END { print “Total used: “, s }’ Total used: 5322333… Continue reading
-
Simple tip to redirect all results into a file.
Here is a simple shell that works for that. #!/bin/bash exec 1<&- exec 2 shell_result.txt exec 2>&1 ls -l ls fake_data echo “Done” It will close standard output/error and open that file descriptors for the file shell_result.txt. As a result, all the following commands’ output will be redirected to the specified file. Continue reading
About Me
A software engineer who loves any technologies that makes life easier. That’s why I love Linux and Mac at the same time.