• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
sharadchhetri

sharadchhetri

Tutorials On Linux, Unix & Open Source

  • Home
  • Linux Commands
  • Resources
    • Learn Linux
  • My WordPress plugins

How to create a file with cat command

June 25, 2013 by Sharad Chhetri Leave a Comment

How to create a file with cat command

Cat command has many use , in my earlier post I wrote about how to see line no. in file with cat command

In this example I will guide how simply you can also create a file and write content in it.

Steps to follow

In this first you hit the command cat > file-name .
After this cursor will move to next line itself. Now you can start writing.
For saving the file press “CTRL with D” from your keyboard.

cat

And to append more content in file

cat >> file-name

Note: What happen if you hit CTRL+z key while writing file using cat command.

ctrl+z is basically use for background process, to check background process run command jobs and to take back the process in foreground use fg %jobno eg. if you do cat > filename and after writing if you press ctrl+z the process will go background. When we hit the command jobs it will show jobs no. respective of process running.
To make foreground now run fg command eg fg %1 here %1 is job no. 1 . But after this the old content get clear now you can write new content again in same process.

Share this:

  • Twitter
  • Facebook
  • More
  • Print
  • Email
  • LinkedIn
  • Reddit
  • Tumblr
  • Pinterest
  • Pocket
  • Telegram
  • WhatsApp
  • Mastodon

Related posts:

  1. How to see line numbers in file through cat command
  2. Linux Tac Command : Reverse Of cat Command Output
  3. cat,sed and awk commands to display file contents
  4. NOTICE: nagios.cmd file not found. Please specify the location of this file in your /etc/vshell.conf file
  5. How to create iso file from CD/DVD and how to mount .iso file in folder
  6. Convert video file into gif file through command line in linux
  7. How to convert rpm file into deb file
  8. Create new swap file on CentOS 7 / RHEL 7
  9. Error: Could not stat() command file ‘/var/lib/nagios3/rw/nagios.cmd’!
  10. Give permission reference to file/dir from other file/dir in linux

Filed Under: Linux, Tips And Tricks Tagged With: cat

Reader Interactions

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Primary Sidebar

Our Social Media Presence

  • Facebook
  • GitHub
  • Twitter

Linux Command

What is Linux Internal And External Command

Linux Basic Commands With Examples For Every Beginner

tr command to convert lines to space , tab and vertical tab

smbpasswd command not found on CentOS 7 and RHEL 7

Solution : semanage command not found

Unix / Linux : How to print duplicate lines from file

More Posts from this Category

You Might Like These Articles!

simplecodesyntax wordpress plugin

SimpleCodeSyntax : My Another WordPress Plugin

Install Nginx

How To Install Nginx On Ubuntu 22.04 LTS

Install Latest Git package in Ubuntu Operating System

How To Always Install Latest Git Package In Ubuntu Operating System

Bash script for installing VirtualBox on Ubuntu 22.04 LTS Desktop

Install VirtualBox On Ubuntu 22.04 LTS Desktop (Bash Script)

libfuse

dlopen(): error loading libfuse.so.2 – Got Error On Ubuntu

Failed to open/create the internal network

VirtualBox Error: Failed to open/create the internal network

Always Useful Tips And Tricks

Learn Linux Date Command With Examples

How to change smtp port number 25 in postfix

How to see line numbers in file through cat command

convert space into new line using sed command

find command to search keyword in files recursively in linux

How to page scroll up/down in Linux terminal

How to put slider shortcode only in home page in WordPress

Explore 90+ Article On "Linux Tips And Tricks"

Copyright © 2023 ยท
The material in this site cannot be republished either online or offline, without our permission.
Proudly Blogging From Bharat.

  • Contact
  • About Me
  • My WordPress plugins
  • Privacy Policy