Linux Notes 1
Linux Notes 1
$ ls -l <dirname> (To
display given directory content)
$ mkdir <dirname>
$ rmdir <dirname>
touch : To create empty file
rm : To remove file
$ rm -r <dirname> (to
delete non-empty directories)
$ cp f1.txt f2.txt
cd : To change directory
$ cd <dirname>
(Going into that directory)
$ cd .. (come out
from directory)
wc : Word count
$ wc f1.txt
$ head <filename> (
It will print first 10 lines of data )
$ head -n 15
<filename> (it will print first 15 lines of
data)
$ grep 'devops' *
(It will search for devops keyword in all
files in the pwd)
$ grep -i 'devops' *
(It will search for devops keyword in all
files - case insensitive)
$ grep -i 'devops'
data.txt ( To search for data in given file )
============================
Working with text editors ( VI )
===========================
vi : Visual Editor
===============
SED command
===============
$ man ls
$ man clear
$ man head
========================
User Management in Linux
=======================
$ id <username>
ec2-user : /home/ec2-user
ashok : /home/ashok
john : /home/john
smith : /home/smith
root : /root
#Swtich to root user account
=========================
Create new users & Groups
=========================
# delete user
$ sudo userdel <username>
# Delete Group
$ sudo groupdel <group-name>