Basic Linux Commands
1] cp (copy files) :-
cp is a Linux command used to copy files and directories in Linux command line terminal. To copy file means to duplicate a file or make an extra copy of a file. The Linux cp command is quite important and used frequently when we work in the command line terminal. Normally, we use Linux cp command to backup a file. A situation example is when we are going to edit an important file such as a server configuration file. We can either copy one file to a given destination, or copy many files to a destination directory.
cp’s basic syntax is
cp [option] SOURCE DESTINATION
Ex:
cp file1 /home/john/file1
===========================================
2] mv (move or rename files) :-
mv command is used to move file or directory in Linux system. When we move a file or directory to a new location, we changed its location. That means we didn’t duplicate the file or directory and didn’t leave a copy in the original location. The Linux mv command also allows us to move multiple files to a new location in the Linux system.
mv’s basic syntax is
mv [option] SOURCE DESTINATION
Ex:
mv file1 file2
===========================================
3] rm (remove file or directories) :-
rm command is used to remove or to delete file and directory.
rm’s basic syntax is
rm [options] filenames
Ex:
rm file1.txt
===========================================
4] history ( history ) :-
history command is a convenient tool that you can use to review previous commands. To look at the most recent commands, simply press the up arrow key. Each time you press it, you will go deeper into the command history. To see all of the command history, type “history” from the command line. You can even export that list to a file to save for future use by entering:
Ex:
history
===========================================
5] vim (Vi Improved, a programmers text editor) :-
vim is an advanced text editor that seeks to provide the power of the de-facto UNIX editor ‘vi’, with a more complete feature set. Vim is not a simple text editor like nano or pico. It does require some time to learn, and a great amount of time to master.
vim’s basic syntax is
vim [options] [file ..]
Ex:
vi example.txt
===========================================