Linux Basic Commands

Part-1

Linux Basic Commands

Here are some basic Linux Command everyone should know.

ls

Screenshot from 2022-08-22 19-26-39.png

  • ls --> lists the directories and file name under current directory.
  • ls -a --> lists all including hidden directories and file name under current directory.
  • ll --> lists the permission of he directories and file name under current directory.

pwd

Screenshot from 2022-08-22 22-04-31.png

pwd --> prints current working directory with path

cd

Screenshot from 2022-08-22 22-09-41.png

  • cd --> change directory means to navigate for particular directory. Just give directory name if it's under your current directory or give the path to navigate for your preferred directory.
  • cd .. helps you to go single step back in directories Screenshot from 2022-08-22 22-16-45.png To know list of directories under double tap on tab key after cd command.

history

Screenshot from 2022-08-22 22-28-04.png

history --> shows all the commands list used in the session.

touch, gedit, vi, nano

Screenshot from 2022-08-22 22-34-26.png

  • touch --> creates new file.
  • gedit --> creates new file and also open a text editor to edit, you need to save the file.
  • vi --> it also opens a edit but inside the terminal only, no need of other text editor software.
  • nano -->it also opens inside the terminal and need to save the file.

Screenshot from 2022-08-22 22-37-50.png

To create multiple files add files name after touch command.

rm

Screenshot from 2022-08-22 22-51-10.png

rm --> remove a file, to remove multiple file and files name, to remove files of similar pattern name use * like in the example above.

mkdir

Screenshot from 2022-08-23 17-22-41.png

mkdir --> to create new directory

cat

Screenshot from 2022-08-23 17-29-34.png

cat --> displays the contents in the file on terminal

Screenshot from 2022-08-23 17-33-27.png

above command joins two files and creates a new file and stores in it.

cp

Screenshot from 2022-08-23 17-40-40.png

cp [from] [to] --> copies from a file to another file or location.

mv

Screenshot from 2022-08-23 17-44-58.png

mv [from] [to] --> moves file content from one to another file or location. Also deletes the from file.

echo

Screenshot from 2022-08-23 17-51-43.png

  • echo--> it prints the content same in terminal

  • echo [texts] >> [filename] -->to append texts into the file

Screenshot from 2022-08-23 18-13-18.png It also appends text and create file it filename doesn't exist.