Important Linux Command

Important Linux Command


Hello Everyone. I am enlist few important purposeful LINUX Command. Hope this helps you .There are a ton of other commands – more sophisticated commands – which you will one day learn. But for now, like learning to add before you learn to multiply, this list will provide you with your Linux Command foundation.


cat : Cat commands are most commonly used for displaying the contents of a file.

cat <filename> or <full path of file along with name>


tar : The tar program provides the ability to create archives from a number of specified files or to extract files from such an archive.

Create a new tar archive.

$ tar cvf archive_name.tar dirname/

Extract from an existing tar archive.

$ tar xvf archive_name.tar

View an existing tar archive.

$ tar tvf archive_name.tar


pwd : The pwd (print working directory) command displays the name of the current working directory.

cd : The cd command changes the current directory in Linux and can toggle between directories conveniently.

rm: The rm Command. The rm (i.e., remove) command is used to delete files and directories on Linux

Get confirmation before removing the file.

$ rm -i filename.txt/

Print the filename and get confirmation before removing the file.

$ rm -i file*

recursively removes all files and directories under the example directory. This also removes the example directory itself.

$ rm -r example/


cp: The cp command copies files and directories; copies can be made simultaneous to another directory if the copy is under a different name.

Copy file1 to file2 preserving the mode, ownership and timestamp.

$ cp -p file1 file2

Copy file1 to file2. if file2 exists prompt for confirmation before overwritting it.

$ cp -i file1 file2


mv: mv (short for move) is a Unix command that moves one or more files or directories from one place to another.

Rename file1 to file2. if file2 exists prompt for confirmation before overwritting it.

$ mv -i file1 file2

Note: mv -f is just the opposite, which will overwrite file2 without prompting.

$ mv -f file1 file2

mv -v will print what is happening during file rename.

$ mv -v file1 file2


SCP:  SSH may the most popular protocol to enable Linux administrator to manage the servers via remote in secure way. Built-in with SSH command there is SCP command. SCP is used to copy file(s) between servers in secure way.

The below command will read as “copy source_file_name” into “destination_folder” at “destination_host” using “username account”.

$ scp source_file_name username@destination_host:destination_folder

Note: Sometimes we need to copy directory and all files / directories inside it. It will be better if we can do it in 1 command. SCP support that scenario using “-r” parameter.

 

When copying file from remote host to local host (downloading), its looks just the reverse

$ scp user@remote_host:/some/remote/directory ~/my_local_file.txt


Contact US

Vendor Product Code Search in Odoo Globally

To install this Web App in your iPhone/iPad press and then Add to Home Screen.