Linux : command output to a file


In this series of mini posts I will teach you a Linux lesson every day, it can be command , tricks , how to. The post will cover for beginner to advanced level. Welcome to Linux terminal.

Follow us and start learning Linux today

how to output a command result to a file?

In Linux we can output command result directly to a file using output operator(>). Suppose we want to list directory and redirect to to it a file called mydir, here is the trick

ls > mydir
cat mydir

You may love to learn following Linux commands and tutorials

Linux cat


In this series of mini posts I will teach you a Linux lesson every day, it can be command , tricks , how to. The post will cover for beginner to advanced level. Welcome to Linux terminal.

Follow us and start learning Linux today

cat

cat is used to create ,view files in Linux. It is useful when dealing with scripts and output some command result. It can used to view multiple files as follows

cat file1 file2

To create file we can use the cat with an input file name as follows

cat> file name
Ctrl+Z

You may love to learn following Linux commands and tutorials

For copying content of a file into another we can use

cat myfile>file4
Ctrl+Z

Linux : arbitrary calculator language


In this series of mini posts I will teach you a Linux lesson every day, it can be command , tricks , how to. The post will cover for beginner to advanced level. Welcome to Linux terminal.

Follow us and start learning Linux today

bc

bc is a command line arithmetic calculator. It is a an arbitrary calculator language which means that it is an interactive calculator programming language. We can use expressions,variable,print,decision make statement etc

a=13
print a
a<1
0
a>12
1

A comparison with >,< return 0 if it fails or 1 if it it true, I think that make sense.

We can also use the bc with output statement as follows

echo '100*9'|bc

You may love to learn following Linux commands and tutorials

Linux ASCII character art with banner


In this series of mini posts I will teach you a Linux lesson every day, it can be command , tricks , how to. The post will cover for beginner to advanced level. Welcome to Linux terminal.

Follow us and start learning Linux today

banner

banner is a command for fun, it print first 10 character in a string with big ASCII character. Yo can install the banner using the following command

sudo get install sysvbanner
banner LINUX

You may love to learn these Linux commands and tutorials

Searching for a Linux command


In this series of mini posts I will teach you a Linux lesson every day, it can be command , tricks , how to. The post will cover for beginner to advanced level. Welcome to Linux terminal.

Follow us and start learning Linux today

apropos

Sometimes it is hard to remember everything we learned,earned. isn’t it ?. Linux has many commands, lots of commands, how can I memorize all these ? impossible.

Here is command every Linux had which help us to find commands based on purpose/keyword.

It can’t memorize but can help find something worthy

apropos search man page and bring a list of commands. For example apropos cpp will brings all cpp commands.

apropos python
apropos printer -- list all printer commands

You may love to learn these Linux commands and tutorials

Command line music player for Linux


In this series of mini posts I will teach you a Linux lesson every day, it can be command , tricks , how to. The post will cover for beginner to advanced level. Welcome to Linux terminal.

Follow us and start learning Linux today

aplay and aplaymidi

aplay allows us to play music from a terminal window with options such as delaying setting frequencies etc . Check out aplay –help for complete list of supported formats.

We can set duration of the play using the –duration option. It can play on a selected device on a network. It works with ALSA audio driver.

Wanna play a MIDI file ? aplaymidi command will be at your service. A hardware MIDI device is required to play the MIDI file

Sample usage

The following command will play the mp3 form 30 seconds

alpay -d 30 -r2500hz jinglebell.mp3
aplay --help
alpaymidi -d 30  play.midi

You may love to learn these Linux commands and tutorials

How to enable Flutter Web support in Ubuntu Linux


Flutter can be used to create web applications, which is possible by enabling the feature. Before that I would like recommend the basic flutter setup on Ubuntu post.

How to install Flutter on Ubuntu Linux

Lets Install Flutter for Ubuntu Linux development. As a open source project, we can install the flutter SDK from GitHub.

The prerequisites

In order to clone the repository we have to use git . In case your SUSE doesn’t know what it is, let’s install it with snap . Also recommend to have Visual Code /Atom for editing the code.

The following post may help you to install VS Code on Ubuntu

Install the git

sudo snap install git

Clone the repo

Get the latest stable version from GitHub repository or alternatively can download from flutter site

git clone https://github.com/flutter/flutter.git -b stable --depth 1

Use the -b option to clone the stable version

Setup the path variable

You also need to set the path variable using the shell command as follows.

export PATH="$PATH:pwd/flutter/bin"

Call the Doctor

run Flutter doctor command to inspect status of your Flutter SDK

Flutter Doctor

Android IOS development

For Android you have to install the Android Studio for development tool support which can be download from official website.

For official documentation visit flutter.dev

Enable web feature

Before starting make sure you have chrome/chromium installed on your system. Otherwise the feature may not work

For enabling the web feature we have to switch to the beta channel ( web feature is an experimental feature and official full support is not yet released)

flutter channel beta
flutter upgrade
flutter config --enable-web

Run the flutter device command again and then check the web feature is list or not by using

flutter devices

and it will list the web feature

Test Run

Create sample Flutter project

flutter create myweb_app
Flutter Web on Ubuntu

run the app using flutter run command

flutter run -d chrome

For building the web we can use

flutter build web

How to enable Flutter Web support in openSUSE Linux


Flutter can be used to create web applications, which is possible by enabling the feature. Before that I would like recommend the basic flutter setup on openSUSE post.

Flutter setup for openSUSE Linux

Lets Install Flutter for Linux development. As a open source project, we can install the flutter SDK from GitHub.

The prerequisites

In order to clone the repository we have to use git. In case your SUSE doesn’t know what it is, let’s install it with zypper. Also recommend to have Visual Code /Atom for editing the code.

The following post may help you to install VS Code and Atom on Linux

Install the git

sudo zypper install git

Clone the repo

Get the latest stable version from GitHub repository or alternatively can download from flutter site

git clone https://github.com/flutter/flutter.git -b stable --depth 1

Use the -b option to clone the stable version

Setup the path variable

You also need to set the path variable using the shell command as follows.

export PATH="$PATH:pwd/flutter/bin"

Call the Doctor

run Flutter doctor command to inspect status of your Flutter SDK

Flutter Doctor

Android IOS development

For Android you have to install the Android Studio for development tool support which can be download from official website.

For official documentation visit flutter.dev

Enable web feature

Before starting make sure you have chrome/chromium installed on your system. Otherwise the feature may not work

For enabling the web feature we have to switch to the beta channel ( web feature is an experimental feature and official full support is not yet released)

flutter channel beta
flutter upgrade
flutter config --enable-web

Run the flutter device command again and then check the web feature is list or not by using

flutter devices

and it will list the web feature

Test Run

Create sample Flutter project

flutter create myweb_app

Flutter Web on openSUSE

run the app using flutter run command

flutter run -d chrome

For building the web we can use

flutter build web

Create app launcher in Fedora


Fedora Linux is not meant for everyone, it is for developers and
those who love to learn developing. You can add application using
neat GUI or use dnf[treminal] to search and install packages you needed.

Some ventors supplies tar file which require manually run from terminal. For convenience you can create launchers for them, so that
you can run them as regular applications.

Desktop Entries

Desktop entries are responsible for showing application menus under
differrnt categories. My Fedora uses GNOME desktop which has Activities
menu, shows favourietes and menus

Where should I place applications files

I recomment you should place application files on usr/share, you need to extract the tar/zip files on home folder then move to
the share folder using following way

In this example we have Typora Markdown Editor, extract the file and open terminal and issue following command

sudo mv Typora-linux-x64 /usr/share

This will place the typora file to the share folder, you can’t directly place or copy without sudo command in /share or application files

Desktop Entry format

[Desktop Entry]
	Name=FooCorp Painter Pro
	Exec=foocorp-painter-pro
	Icon=foocorp-painter-pro
	Type=Application
	Categories=GTK;GNOME;Utility;   

For more options and guides for desktop entry visit GNOME Guide

Create Desktop Entry and move it to applications folder

create a Text file with named typora.desktopentry with following content

 [Desktop Entry]
Type=Application
Encoding=UTF-8
Name=Typora
Comment=A sample Markdown Editor
Exec=/usr/share/Typora-linux-x64/Typora %f 
Icon=/usr/share/Typora-linux-x64/typora_icon.jpg
Terminal=true

Let’s move it to the /usr/share/applications/

sudo mv Ttypora.desktopentry /usr/share/applications

Now check the menu for the entry, I additionally added a image file for use as icon

How to Install Pinegrow on Fedora/Linux


Pinegrow Web Editor

alter text

Pinegrow is a easy to use web editor which help designers quickly
develop and deploy web desines. It is tool for developers and designers
as well. The software come with 30 days trial and after that you can buy
a copy.

Using Pinegrow on Linux

Pine grow can be installed on Windows/Mac/Linux. In Linux you no need to install instead you use binary file to execute.

Follow these steps to install Pine grow on Linux.

  • Download Pinegrow for Linux Zip file
  • Extract the files
  • Make sure the PinegrowLibrary File is executable
chmmod +x PinegrowLibrary

Execute the file by using

./PinegrowLibrary

and it will launch the Pinegrow

Infact you can extent the trial period unlimted by moving the system date backaward.