• Home
  • WP tuts
  • Hosting talk
    • Free hosting
    • Cheap Hosting
    • comparison cloud , vps, shared, wordpress
    • managed wordpress hosting
    • managed cloud hosting
  • Speed up wordpress
  • Pc world
  • Services
  • About Me

RAaz Kumar .com

wordpress tutorials seo hosting etc

Top 10 most used Cat commands with examples (create, view, append files)

cat (short for “concatenate)
Create,view,concatenate,
cat [OPTION] [FILE]…
main advantage with just command
It will create file &writes data. unlike
nano &vim editors.

#1viewing content of file with cat command

cat /etc/passwd
To view content of multiple files
cat file1.txt file2.txt

#2  creating a file with cat command

cat >test2
Type text.
Then press ctrl+d to exit

#3 cat command reading file with line numbers & sorting

sorting
cat file1.txt | more
cat file2.txt | less

Display along with numbers of line

cat -n filename

Display $ at the End of every line with -e option

cat -e test

Multiple Files at Once (semi colons required)

cat file; cat file1; cat file2

#4 Overwritting existing file with cat command

cat file > file1
existing contents of file1 will be overwritten by contents of file file.

Appending(Standard Output with Redirection Operator)

cat file >> file1
contents of file file will be appended at the end of file1 file.

#5 appending at end of existing file with command ft ssh authorizedkeys

1st step we created public & private keys.
private key on local machine.
public key should be added to
./ssh/authorized_keys
we may copy & edit nano command save it.
nano ./ssh/authorized_keys
sometimes we generate in remote machine
cat  publickey.pub >> ./ssh/authorized_keys

Redirecting Standard Input with Redirection Operator

cat < file2
Displays the file2 information on the terminal

 #6creating single file from multiple files

cat file file1 file2 > file3
all data in 3 files will be create  new file 3

#7 Sorting Contents of Multiple Files in a Single File

cat file file1 file2 file3 | sort > file4,
all the contents piped and sort and results will be an new file

#8 creating file & writing data cat eof to file

cat >/etc/nginx/sites-enabled/newserver.conf<<EOF
server {
listen 80;
root /var/www/html/;
server_name _;
include /etc/nginx/conf.d/global.config;
}
EOF

it will creates a file newserver.conf in the prescribed path.

2nd

it adds content to file with eof command in linux shell script.

EOF (end-of-file)

 

 

 

touch command only to create a file

touch newfile.txt
later you have to use vim or nano to edit.

Nano file editor

sudo nano newfile.conf
#configuration
#press ctrl+x and then y save changes.

Vim editor

sudo apt-get install vim
vim file.txt
Press i insert or edit,
press Esc and then :wq to save and exit.
e opens file
:W save
:q exit
:Wq  to save changes and exit
:q! Exit without changes
0 to mive cursor to the first line

writting to files with echo command

to create a file

echo > phpinfo.php

or

echo > /var/www/html/phpinfo.php

write/print the words to document

echo “phpinfo();” > phpinfo.php

 

 

Related topics:

  1. top 10 apt & apt-get commands (most used) apt vs apt-get
  2. Top 10 zip / tar commands to compress & extract files in linux
  3. Top 10 GREP Commands in linux to search files
  4. linux commands pdf (files & Directories, zip & unzip process, search etc)
  5. TOP 10 mv & cp commands in linux to move & copy files in Linux




tutorials

  • Android Studio tutorials syllabus Topics Course details #AndroidApplicationDevelopment
  • xampp tutorials 2021 installation errors fix wordpress phpmyadmin mysql apache
  • Devops Syllabus topics PDF
  • CCNA Syllabus pdf (CCNA / CCNP vs devops vs mcsa /MCSE)
  • how to create a website free of cost on google
  • what is vpn vs proxy vs tor, http vs https, http2, tcp vs udp, kali linux sql source code injection
  • nginx server tutorials (installation, configuration, performance tuning, security)
  • Vivek Bindra Videos Transcription (business strategy)
  • AUdio Editing Background Noise removal (Audacity, Adobe Premiere Addition, Camtasia Filmora Windows Obs)
  • MySQL Tutorial (create,connect database, update tables, export etc) Documentation & TIPS
  • [INTRO] Ethical hacking / cyber Security / Penetration testing Tutorial -{updates frequently}
  • ubuntu tutorials installation download issues etc
  • Php tutorials
  • HTML & CSS Tutorials
  • Core Java Tutorial Free online
  • Linux sysadmin tutorials linux system administrator
    • top 10 apt & apt-get commands (most used) apt vs apt-get
    • linux commands pdf (files & Directories, zip & unzip process, search etc)
    • linux performance tuning inode limit file descriptors tco, kernel etc
    • Top 10 most used Cat commands with examples (create, view, append files)
    • Ip tables / ufw / firewall d commands for block port ip rate limiting
    • Top 10 zip / tar commands to compress & extract files in linux
    • TOP 10 mv & cp commands in linux to move & copy files in Linux
    • Top 10 GREP Commands in linux to search files
    • lsof netstat commands to know listening ports in linux 3 ways
    • Upgrade Ubuntu from 18.04 (19.10) to 20.04 LTS command line or gui server | desktop
    • 3 Ways (SCP, rsync, Sftp) linux server migration between two remote server apache nginx
    • linux system specs commands (CPU, Memory, Disk )speed, type. manufacture
    • linux sysctl.conf performance tweaks net.core.somaxconn nginx kernel settings
  • apache server tutorial (install,config, performance tuning, security, error handling)

About

 

raaz kumar comI am Raaz Kumar, Most Of the time in a day , I Spend on WordPress, Hosting, Server related issues, So i decided write clean posts from my personal notes, so it will be useful for every one like me. Read More,,

Please Support my work by sharing, it can helps to create free content like this.

Twitter

Facebook

Youtube

 

PUBG Mobile Tips & Tricks

free fire how to play (a-z guide) guns, tips &#038; tricks etc

Windows 10 tips & tricks

Pagespeed optimization

Pc building tips & tricks

nginx server tutorials

apache server tutorials

linux sysadmin tutorials

mysql Commands list pdf

Android studio tutorials

Gaming/ streaming tips

Airtel dth channel list

 

wordpress

 

Top 5  WP Google Analytics Plugins

WP Backup Plugins

Wp Comment Plugins

Top wordpress Security Plugins

WP Seo Plugins

WP Caching Plugins

Best Adsense Plugins for WordPress

Wp social Sharing Plugins

autoshare social media plugins

WP speed Optimization Plugins

Speedup WordPress google Score

More Wp tuts

Server Admin Cloud

 

Installing Nginx LEMP On ubuntu

Installing apache Lamp ubuntu

nginx fastcgi cache enable

php – fpm install  & Configuration

Opcache install & Configure

php -fpm pool manager explained

Mysql Install & Configuration

Redis Object cache install & configure

 

Nginx as Reverse Proxy and Load balancer

Load Balance / auto scaling in google cloud

Linux Commands PDF

Mysql Commands Pdf

Letsencrypt tutorial

mysqldump export & import 

Pagespeed Module install & configure

nginx.conf best file

mysql.conf best file

upgrade ubuntu

© 2021 - All Rights Reserved Disclaimer & Privacy Policy