0% found this document useful (0 votes)
37 views1 page

Linux Commands:: 1) Copy A File

This document outlines common Linux commands for copying, moving, renaming, removing files and directories, viewing file contents, and text editing. It describes using cp to copy files and directories with or without contents, mv to move or rename files, rm to remove files and directories, cat and more/less to view file contents, head and tail to view parts of files, and nano, vim, or emacs as text editors.

Uploaded by

Chandan Kr
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
37 views1 page

Linux Commands:: 1) Copy A File

This document outlines common Linux commands for copying, moving, renaming, removing files and directories, viewing file contents, and text editing. It describes using cp to copy files and directories with or without contents, mv to move or rename files, rm to remove files and directories, cat and more/less to view file contents, head and tail to view parts of files, and nano, vim, or emacs as text editors.

Uploaded by

Chandan Kr
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

Linux commands:

1) Copy a file:

C:\> cp <filename> <destination path>

2) Copy directory :
a. cp <directory> <destination>
b. with contents of directory:
cp <directory> <destination> -r
1) rename a file:
C:\> mv <current name> <new name>
2) to move a file:
mv <source> <destination>

3) remove a file
rm <filename>
4) remove a directory
rm -r <directory name>
5) to view file
Cat <filename>
a. To view whole file
More <filename> or less <filename>
b. To view first few lines
i. head <filename> ( by default display first 10 lines)
c. To view last few lines
i. tail <filename> ( by default display last 10 lines)
6) text editor: nano
a. available on any distribution
b. syntax: nano <filename>
c. Alt+u to undo
7) powerful industry standard text editor: vim or emacs
8)

You might also like