I noticed that the bash shell can suggest command line switches for your command. Just type your command, a dash (-) and type tab. The shell will show you available switches. For example, try: and press tab – Surprise! The question is: How do I interface with this feature. I.e., if I write a program that is to be run
Tag: command-line
How to list running screen sessions?
I have a bunch of servers, on which I run experiments using screen. The procedure is the following : ssh to server XXX launch screen start experiments in a few tabs detach screen disconnect from the server While the experiments are running, I can easily find on which servers they are by sshing to all servers and listing my running
What is the safest way to empty a directory in *nix?
I’m scared that one day, I’m going to put a space or miss out something in the command I currently use: Is there a safer way of emptying the current directory’s contents? Answer The safest way is to sit on your hands before pressing Enter. That aside, you could create an alias like this one (for Bash) alias rm=”pwd;read;rm” That
How can I search for a multiline pattern in a file?
I needed to find all the files that contained a specific string pattern. The first solution that comes to mind is using find piped with xargs grep: But if I need to find patterns that spans on more than one line, I’m stuck because vanilla grep can’t find multiline patterns. Answer So I discovered pcregrep which stands for Perl Compatible
How to create a file with a given size in Linux?
For testing purposes I have to generate a file of a certain size (to test an upload limit). What is a command to create a file of a certain size on Linux? Answer For small files: Where file_size is the size of your test file in bytes. For big files:
How do I Send Email from the Command Line?
I would like to quickly send email from the command line. I realize there are probably a number of different ways to do this. I’m looking for a simple way to do this from a linux terminal (likely a bash shell but anything should do) and an alternative way to do this on Windows. I want to be able to