Tag:
command
Here is a great little command line trick to list only the subdirectories in your current working directory. $ ls -d */
By default the echo command will include a trailing newline at the end of a string. There are many times when you may want to suppress this newline for example when you want to format text in a certain way.There are a couple easy ways to do this. First you can use the ‘-n’ option. [...]
Most programs will return an exit status of 0 if the program was successful, while a non-zero exit status usually indicates an error. You can find the exit status or exit code of the previously executed command by accessing the “$?” shell variable. $ COMMAND $ echo $? Typically when a command terminates on a [...]
When you run the find command on the root directory of a system you may want to exclude all network filesystems and confine your search to only your local machine. The benefits of this are obvious as it will save you a great amount of time especially if the mounted filesystem is very large. Luckily [...]
BASH has the ability to execute a command string and replace that string with the output of the command. Or to say it another way, the output of a command will replace the command itself. There are 2 ways to accomplish this. The first is to surround the command with backticks or blockquotes. `command` You [...]