Showing posts with label unix. Show all posts
Showing posts with label unix. Show all posts

Tuesday, January 8, 2019

Cheat sheet for echo


The syntax for echo is:
echo [option(s)] [string(s)]
1. Input a line of text and display on standard output
$ echo Tecmint is a community of Linux Nerds 
Outputs the following text:
Tecmint is a community of Linux Nerds 

Cheat sheet for cat command


Display content of the file
cat /etc/passwd

View contents of the multiple files in the terminal
cat sample1 sample2
First sample
This is the second sample;

Create file with cat ctrl+d to exit
cat >testcat
Testing file with cat command


cheat sheet for ls



1. List Files using ls with no option
ls with no option list files and directories in bare format where we won’t be able to view details like file types, size, modified date and time, permission and links etc.


[vn04nxr@client-236651385-1-270480917 ~]$ ls
affiliate_spend_viq_08-13-2018_to_08-23-2018.tsv  employee    first_file  
2 List Files With option –l 
Here, ls -l (-l is character not one) shows file or directory, size, modified date and time, file or folder name and owner of file and its permission.
[vn04nxr@client-236651385-1-270480917 ~]$ ls -l
total 64
-rw-rw-r-- 1 vn04nxr vn04nxr    22 Aug 23 19:11 affiliate_spend_viq_08-13-2018_to_08-23-2018.tsv
-rw-rw-r-- 1 vn04nxr vn04nxr 14510 Sep  3 14:58 cat_more
-rw-rw-r-- 1 vn04nxr vn04nxr    35 Aug 23 21:46 employee