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 add web/desktop support for existing flutter app in OpenSUSE


Have flutter project in hand which is built for Android and iOS, now want to built desktop and web counter part?

Make sure that you have enabled, web, desk features. To ensure this run the following

Flutter devices

If not please go through the web/desk support post.

How to enable Flutter Web support in Ubuntu Linux - How to enable Flutter Web development in Ubuntu Linux
How to enable Flutter Desktop support in Ubuntu Linux - How to setup Flutter Desktop development environment on Ubuntu

Here is the solution

Make sure you had an active internet connection.

Cd to your project folder and in the console enter these commands

For few second it will add tools for desktop and web features.

Flutter create . 

Run the flutter command

Flutter run -d chrome

Flutter will goes through building process and will bring you a local host id.

For desk top try to run

Flutter run -d windows/linux/mac 

How to install openSUSE Tumbleweed on Virtual Machine /Virtual Box


Virtual Box allow us to install and use OS (Mac/Windows/Linux) on your Machine as an application. It occupy separate filesystem in form folder/virtual disk.

You can move the Virtual Box file from one to another with ease and peace.

Virtual Box provide a safer way to try Linux on Mac/Windows. Let’s install openSUSE Tumbleweed on Virtual Machine

Prerequisites

Install the Oracle Virtual Box and get ISO file of latest Mint Linux. We also need at least GB RAM and 150 GM Free HDD/SSD space.

Create a new Virtual Machine

Follow the Wizard and Give appropriate Name and continue setup ( configure enough space and memory for apps, 120 GB is recommended), finish the setup.

Continue reading How to install openSUSE Tumbleweed on Virtual Machine /Virtual Box

How to create a file in Linux


Unable to install apps using snap in Ubuntu Linux

Got an error while installing app on Ubuntu using snap or Ubuntu Software Center ? We can solve the issue by simply issue an update command on the Terminal

Open the Terminal and enter the following

sudo apt update

and try again to install the app using the software center

How to create a file in Ubuntu


We have many option to create a simple file in Terminal of Linux . The examples were working in Ubuntu and most other Linux distributions.

Cat

The cat command can be use to create and view simple files.

cat>simplefile.txt 
I am a file
Ctrl+Z
‚Äč

Will create a file and can be viewed using cat simplefile.txt command.

gedit

gedit GUI text editor which can be also used to create file from terminal using

gedit myfile

Which will open the GUI editor

vi

Ubuntu also have the classic vi command which can be used to create and edit file from the console

vi filename

You can also get the help for each command using command –help