linux - Using the passwd command from within a shell script

from "man 1 passwd": --stdin This option is used to indicate that passwd should read the new password from standard input, which can be a pipe. So in your case adduser "$1" echo "... Read More

linux - How to get the name of the current git branch into a variable in a shell script?

The * is expanded, what you can do is use sed instead of grep and get the name of the branch immediately: branch=$(git branch | sed -n -e 's/^\* \(.*\)/\1/p') And a version using git symbolic-ref, as... Read More

linux - Command output redirect to file and terminal

Yes, if you redirect the output, it won't appear on the console. Use tee. ls 2>&1 | tee /tmp/ls.txt... Read More

linux - "No such file or directory" error when executing a binary

The answer is in this line of the output of readelf -a in the original question [Requesting program interpreter: /lib/] I was missing the /lib/ file, which is needed to run... Read More

linux - Curl Command to Repeat URL Request

You could use URL sequence substitution with a dummy query string (if you want to use CURL and save a few keystrokes): curl[1-20] If you have other query strings in your URL, a... Read More

linux - How to deal with LinkageErrors in Java?

LinkageError is what you'll get in a classic case where you have a class C loaded by more than one classloader and those classes are being used together in the same code (compared, cast, etc). It doe... Read More

c - What does the brk() system call do?

In the diagram you posted, the "break"—the address manipulated by brk and sbrk—is the dotted line at the top of the heap. The documentation you've read describes this as the end of the "data segment... Read More

linux - How do I get cURL to not show the progress bar?

curl -s > temp.html works for curl version 7.19.5 on Ubuntu 9.10 (no progress bar). But if for some reason that does not work on your platform, you could always redirect stderr to... Read More

networking - Network usage top/htop on Linux

NetHogs is probably what you're looking for: a small 'net top' tool. Instead of breaking the traffic down per protocol or per subnet, like most tools do, it groups bandwidth by process. NetHogs does... Read More

linux - how do I check in bash whether a file was created more than x time ago?

Only for modification time if test `find "text.txt" -mmin +120` then echo old enough fi You can use -cmin for change or -amin for access time. As others pointed I don’t think you can track creati... Read More