Browsing Tag Cheat Sheet

2 Post Found in Cheat Sheet Tag

My Favorite Bash aliases that increases productivity

My Favorite Bash aliases that increases productivity

Intoduction

I have been using Linux (Ubuntu) well over a decade and I fell in love with command line interface which gives you more control and power over the system.Any one who loves linux would probably agree with me. The more you use command line, you will tend to notice that you use some

Continue reading

Bash Cheat Sheet - File operation

Bash Cheat Sheet - File operation

Get filename with file extension


FULLFILENAME=$(basename $FILE)

Get filename without file extension


FILENAME="${FILE%.*}"

Get extension from filename


EXTENSION="${FILE##*.}"

Get MIME type of the given file


MIME_TYPE=`file --brief --mime-type "$FILE"`

Get current directory of the script

Get the full directory name of the script no matter where it is being called

Continue reading