Articles tagged with #cli




grep without filenames

I needed to grep a directory, and sub directories, and not displaying the filenames in the output. This is when the man page came to the rescue. man grep | grep filename Output -H, --with-filename -h, --no-filename There we go, -h, --no-filename, is what I needed. Example with output to a …



Using xargs to parallel a process in the command line

Most of us have multiple CPUs in our personal machines. I would also hope that your servers do too. If you're running an intensive command line process, running them in parallel will speed it up by paralleling the process. Say you need to find a string in all of your …



Add a command file to Laravel artisan

In order to run a custom command from the command line utility called artisan you need to do two things: Create a new CustomCommand file Register that command with artisan Here's a sample Command file called FooCommand.php which should be placed in *app/commands/ * [php]



How to set local environment as default in command line (CLI) for Larvel 4 artisan

Typically when Laravel 4 artisan is run from the command line (cli) it uses the production configuration files. This can be changed by using a flag when running the command. [ps]php artisan migrate --env=local[/ps] However, adding --env-=local each time while running a script can slow down …



How to close a linux screen session

After working within a screen session on a CentOS server I had forgotten how to close the screen session that I was done with. It's a rather simple command. exit Perfect, exit means exit. Of note if you just want to disconnect use. ctrl+a (press) d That'll disconnect you …



Setup an alias in Linux

Setting up an alias in linux is very easy and very helpful. It allows you to determine a short phrase for running a longer command. Or change a common typo to the command you meant. Here's an example alias: \$ alias lsl="ls -la" This maps lsl to the command ls …