Posts Tagged With: shell

Change the Shell

Tagged with: , , , ,

Use this command to change the default shell you are using.


chsh
No Comments »

A Shell Script to Create a Build of Firefox Extension

Tagged with: , , , , , , ,

This shell script will create a build of a firefox extension in linux. This is created according to my details(eg, the guid has @binnyva.com in it) - but you can modify it and use it yourself.


app=$1
folder=$2

if [ $# -eq 0 ] ; then
	echo "Useage: sh build.sh  []"

elif [ $# -eq 1 ] ; then
	folder="$1@binnyva.com/"
fi

rm $app.xpi
cp -r $folder temp
cd temp
rm -rf .git

zip -r $app.xpi .>/dev/null
mv $app.xpi ..
cd ..
rm -rf temp
echo "Built $app successfully"

No Comments »

Fish Shell Command History Meme

Tagged with: , , , , , , , ,

Use this command if you want to know your command usage stats in the fish shell.


grep -v "^\#" ".config/fish/fish_history"|awk '{print $1}'|sort|uniq -c|sort -rn|head -n10
No Comments »

Fish Alias/Function Location

Tagged with: , , , , , ,

The alias/function of the fish shell are stored at ‘/home/username/.config/fish/functions’

No Comments »

Run a Command if Another Command Succeeds

Tagged with: , , , , , , ,

This will let you run a linux command based on the success of anther command. Note: This will only work in bash shell.


ruby Create_PDF.rb && if [ $? == 0 ]; then kpdf report.pdf; fi
No Comments »

Creating an Alias in fish shell

Tagged with: , , , , , ,

Fish shell has an easy method to create a command alias…


alias del='rm'
save_function del
No Comments »

Create a Permanent Alias in Fish Shell

Tagged with: , , , , ,

This is how you create a permanent alias is fish


alias x='exit'
save_function x
1 Comment »

Fetch columns of Output using Awk

Tagged with: , , , , , , , , , ,

One can use awk to get a specific column from a command output…

First column of the command
date|awk '{print $1}'

11th Column of the command
ps aux|awk '{print $11}'

Use a different Field separator
cat /etc/passwd|awk -F ':' '{print $1}'

[tags]awk,sed,shell,script,output,filter,text,cli,linux,string,separator[/tags]

No Comments »