Header Ads

Recently post

Linux basic command for beginner

LINUX BASIC COMMAND--




 ls -l --> this command use to list of all directory

2- cd /var/log - change directory

3-grep - this command use for filter

4- su / sudo - this change root permission

5- pwd - use for current directory

6- passwd - chanage user account password

mv - move file 

cp- copy file

rm - remove file

rmdir -r - remove directory

mkdir - make directory

------------------------------------------------------------------------------------

chmod - change permission mode

0 - no permission                                 ---

1 - execute permission                            --x

2 - write permission only                         -w-

3 - wirte and execute permission                   -wx-

4 - read permission                                r--

5 - read and execute permission                    r-x

6 - read and write permission (2+6)=6               rw-

7 - read, write, execture permission, means full permission (1+2+4) - rwx

-------------------------------------------------------------------------




The first number stands for the user who is associated with the file

The second number is for the group associated with the file

The third number is associated with everyone else who is not a part of the user or group


Example - 

-rwxr--r--rwx

"-rwx" -- this is the user permission

r--    this this the group permission

r--     this is the others that is not part of user and groups




--------------------------------------------------------------------------------

change owner of a file/folder or even multiple files and folders for a specified user/group


command - chown owner_name file_name


example

chown user1 script.sh


i have changed script.sh file owner as root so any normal user can use sudo to run this file


------------------------------------------------------------------------------


cat - concatenate

cat file.txt

cat file.txt file1.txt


show all output of text file on command line



---------------------------------------------------------

use echo command 


to display a text or a string to the standar output


$echo "this is my youtube channel"


$ echo –e “This is an article is for beginners. \nIt is on basic linux commands


This is an article is for beginners.

It is on basic linux commands

----------------------------------------------------------------------------


use wc - word count


wc -1 readme.txt


wc -l : Prints the number of lines in a file.

wc -w : prints the number of words in a file.

wc -c : Displays the count of bytes in a file.

wc -m : prints the count of characters from a file.

wc -L : prints only the length of the longest line in a file.


---------------------------------------

man use for manaul page for commands

man grep 

man mkdir


-----------------------------------------------------------

history -- check history 

------------------

clear - use clear to clear command line

------------------------------------------------

apt-get - this is a power and free frond end package manager for debian and ubuntu systems, its used to install new software and remove update packages, upgrade as well as upgrade entire operating system.

APT - adavanced packaging tool


------------------------------------------------------------------------

reboot - reboot the system

---------------------------------------------











No comments