Here are some basic Linux Command everyone should know.
ls
- 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
pwd --> prints current working directory with path
cd
- 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
To know list of directories under double tap on tab key after cd command.
history
history --> shows all the commands list used in the session.
touch, gedit, vi, nano
- 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.
To create multiple files add files name after touch command.
rm
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
mkdir --> to create new directory
cat
cat --> displays the contents in the file on terminal
above command joins two files and creates a new file and stores in it.
cp
cp [from] [to] --> copies from a file to another file or location.
mv
mv [from] [to] --> moves file content from one to another file or location. Also deletes the from file.
echo
echo--> it prints the content same in terminal
echo [texts] >> [filename] -->to append texts into the file
It also appends text and create file it filename doesn't exist.